Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add x/collection proto #571

Merged
merged 20 commits into from
Jul 18, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
186 changes: 186 additions & 0 deletions proto/lbm/collection/v1/collection.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
syntax = "proto3";
package lbm.collection.v1;

option go_package = "github.com/line/lbm-sdk/x/collection";
option (gogoproto.equal_all) = false;
option (gogoproto.goproto_getters_all) = false;

import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";

// Params defines the parameters for the collection module.
message Params {}

// Contract defines the information of the contract for the collection.
message Contract {
// contract_id defines the unique identifier of the contract.
string contract_id = 1;
// name defines the human-readable name of the contract.
string name = 2;
// meta is a brief description of the contract.
string meta = 3;
// base img uri is an uri for the contract image stored off chain.
string base_img_uri = 4;
}

// FTClass defines the class of fungible token.
//
// Since: 0.46.0 (finschia)
message FTClass {
0Tech marked this conversation as resolved.
Show resolved Hide resolved
option (gogoproto.goproto_getters) = true;
option (cosmos_proto.implements_interface) = "TokenClass";

// id defines the unique identifier of the token class.
// Note: size of the class id is 8 in length.
// Note: token id of the fungible token would be `id` + `00000000`.
string id = 1;
// name defines the human-readable name of the token class.
string name = 2;
// meta is a brief description of the token class.
string meta = 3;
// decimals is the number of decimals which one must divide the amount by to get its user representation.
int32 decimals = 4;
// mintable represents whether the token class is allowed to mint or burn its tokens.
bool mintable = 5;
}

// NFTClass defines the class of non-fungible token.
//
// Since: 0.46.0 (finschia)
message NFTClass {
0Tech marked this conversation as resolved.
Show resolved Hide resolved
option (gogoproto.goproto_getters) = true;
option (cosmos_proto.implements_interface) = "TokenClass";

// id defines the unique identifier of the token class.
// Note: size of the class id is 8 in length.
string id = 1;
// name defines the human-readable name of the token class.
string name = 2;
// meta is a brief description of the token class.
string meta = 3;
}

// NFT defines the information of non-fungible token.
//
// Since: 0.46.0 (finschia)
message NFT {
0Tech marked this conversation as resolved.
Show resolved Hide resolved
// id defines the unique identifier of the token.
string id = 1;
// name defines the human-readable name of the token.
string name = 2;
// meta is a brief description of the token.
string meta = 3;
}

// OwnerNFT defines the information of non-fungible token.
//
// Note: deprecated (use NFT)
message OwnerNFT {
option (cosmos_proto.implements_interface) = "Token";

// contract id associated with the contract.
string contract_id = 1;
// id defines the unique identifier of the token.
string token_id = 2;
// name defines the human-readable name of the token.
string name = 3;
// meta is a brief description of the token.
string meta = 4;

// owner of the token.
string owner = 5;
}

// FT defines the information of fungible token.
//
// Note: deprecated (use FTClass)
message FT {
option (cosmos_proto.implements_interface) = "Token";

// contract id associated with the contract.
string contract_id = 1;
// token id defines the unique identifier of the fungible token.
string token_id = 2;
// name defines the human-readable name of the fungible token.
string name = 3;
// meta is a brief description of the fungible token.
string meta = 4;
// decimals is the number of decimals which one must divide the amount by to get its user representation.
int32 decimals = 5;
// mintable represents whether the fungible token is allowed to be minted or burnt.
bool mintable = 6;
}

// TokenType defines the information of token type.
//
// Note: deprecated (use TokenClass)
message TokenType {
// contract id associated with the contract.
string contract_id = 1;
// token type defines the unique identifier of the token type.
string token_type = 2;
// name defines the human-readable name of the token type.
string name = 3;
// meta is a brief description of the token type.
string meta = 4;
}

// Coin defines a token with a token id and an amount.
message Coin {
option (gogoproto.equal) = true;

// token id associated with the token.
string token_id = 1;
0Tech marked this conversation as resolved.
Show resolved Hide resolved
// amount of the token.
string amount = 2 [(gogoproto.customtype) = "github.com/line/lbm-sdk/types.Int", (gogoproto.nullable) = false];
}

// Grant defines permission given to a grantee.
//
// Since: 0.46.0 (finschia)
message Grant {
// address of the grantee.
string grantee = 2;
// permission on the contract.
string permission = 3;
}

// Permission enumerates the valid permissions on a contract.
enum Permission {
// unspecified defines the default permission which is invalid.
unspecified = 0 [(gogoproto.enumvalue_customname) = "Unspecified"];
// issue defines a permission to create a token class.
issue = 1 [(gogoproto.enumvalue_customname) = "Issue"];
// modify defines a permission to modify a contract.
modify = 2 [(gogoproto.enumvalue_customname) = "Modify"];
// mint defines a permission to mint tokens of a contract.
mint = 3 [(gogoproto.enumvalue_customname) = "Mint"];
// burn defines a permission to burn tokens of a contract.
burn = 4 [(gogoproto.enumvalue_customname) = "Burn"];
}

// Authorization defines an authorization given to the operator on tokens of the holder.
//
// Since: 0.46.0 (finschia)
message Authorization {
// address of the holder which authorizes the manipulation of its tokens.
string holder = 1;
// address of the operator which the authorization is granted to.
string operator = 2;
}

// Attribute defines a key and value of the attribute.
//
// Since: 0.46.0 (finschia)
message Attribute {
string key = 1;
string value = 2;
}

// Change defines a field-value pair.
//
// Note: deprecated (use Attribute)
message Change {
string field = 1;
string value = 2;
}
Loading