Core Collection

https://github.com/BitBadges/bitbadgeschain/blob/master/proto/badges/collections.proto
syntax = "proto3";
package badges;

import "google/protobuf/any.proto";
import "badges/transfers.proto";
import "badges/balances.proto";
import "badges/permissions.proto";
import "badges/metadata.proto";
import "badges/timelines.proto";
import "gogoproto/gogo.proto";

option go_package = "github.com/bitbadges/bitbadgeschain/x/badges/types";

/* 
  A BadgeCollection is the top-level object for a collection of tokens. 
  It defines everything about the collection, such as the manager, metadata, etc.

  All collections are identified by a collectionId assigned by the blockchain, which is a uint64 that increments (i.e. the first collection has ID 1).

  All collections can have a manager who is responsible for managing the collection and can be granted certain admin
  permissions, such as the ability to mint new tokens.

  Certain fields are timeline-based, which means they may have different values at different block heights. 
  We fetch the value according to the current time.
  For example, we may set the manager to be Alice from Time1 to Time2, and then set the manager to be Bob from Time2 to Time3.

  Collections may have different balance types: standard vs. off-chain - indexed vs. inherited.vs off-chain - non-indexed vs non-public.
  
  See documentation for more details.
*/
message BadgeCollection {
  // The unique identifier for this collection. This is assigned by the blockchain. First collection has ID 1.
  string collectionId = 1 [(gogoproto.customtype) = "Uint", (gogoproto.nullable) = false];
  
  // The metadata for the collection itself, which can vary over time.
  repeated CollectionMetadataTimeline collectionMetadataTimeline = 2;
  
  // The metadata for each token in the collection, also subject to changes over time.
  repeated BadgeMetadataTimeline badgeMetadataTimeline = 3;
  
  // The type of balances this collection uses ("Standard", "Off-Chain - Indexed", "Off-Chain - Non-Indexed", or "Non-Public").
  string balancesType = 4;
  
  // Metadata for fetching balances for collections with off-chain balances, subject to changes over time.
  repeated OffChainBalancesMetadataTimeline offChainBalancesMetadataTimeline = 5;

  // An arbitrary field that can store any data, subject to changes over time.
  repeated CustomDataTimeline customDataTimeline = 7;
  
  // The address of the manager of this collection, subject to changes over time.
  repeated ManagerTimeline managerTimeline = 8;
  
  // Permissions that define what the manager of the collection can do or not do.
  CollectionPermissions collectionPermissions = 9;
  
  // Transferability of the collection for collections with standard balances, subject to changes over time.
  // Overrides user approvals for a transfer if specified.
  // Transfer must satisfy both user and collection-level approvals.
  // Only applicable to on-chain balances.
  repeated CollectionApproval collectionApprovals = 10;
  
  // Standards that define how to interpret the fields of the collection, subject to changes over time.
  repeated StandardsTimeline standardsTimeline = 11;

  // Whether the collection is archived or not, subject to changes over time.
  // When archived, it becomes read-only, and no transactions can be processed until it is unarchived.
  repeated IsArchivedTimeline isArchivedTimeline = 12;

  // The default store of a balance for a user, upon genesis.
  UserBalanceStore defaultBalances = 13;

  // The user or entity who created the collection.
  string createdBy = 14;

  // The valid token IDs for this collection.
  repeated UintRange validBadgeIds = 15;

  //The generated address of the collection. Also used to escrow Mint balances.
  string mintEscrowAddress = 16;

  // The IBC wrapper (sdk.coin) paths for the collection.
  repeated CosmosCoinWrapperPath cosmosCoinWrapperPaths = 17;

  // Collection-level invariants that cannot be broken.
  // These are set upon genesis and cannot be modified.
  CollectionInvariants invariants = 18;
}

message CosmosCoinWrapperPath {
  string address = 1;
  string denom = 2;
  repeated Balance balances = 3;
  string symbol = 4;
  repeated DenomUnit denomUnits = 5;
  bool allowOverrideWithAnyValidToken = 6;
  bool allowCosmosWrapping = 7;
}

message DenomUnit {
  string decimals = 1 [(gogoproto.customtype) = "Uint", (gogoproto.nullable) = false];
  string symbol = 2;
  bool isDefaultDisplay = 3;
}

// CollectionInvariants defines the invariants that apply to a collection.
message CollectionInvariants {
  // If true, all ownership times must be full ranges [{ start: 1, end: GoMaxUInt64 }].
  // This prevents time-based restrictions on token ownership.
  bool noCustomOwnershipTimes = 1;
  
  // Maximum supply per token ID. If set, no balance can exceed this amount.
  // This prevents any single token ID from having more than the specified supply.
  string maxSupplyPerId = 2 [(gogoproto.customtype) = "Uint", (gogoproto.nullable) = false];
}

Last updated