diff --git a/proto/lbm/collection/v1/collection.proto b/proto/lbm/collection/v1/collection.proto index 0e8ede1ea0..f3afaa41f3 100644 --- a/proto/lbm/collection/v1/collection.proto +++ b/proto/lbm/collection/v1/collection.proto @@ -17,13 +17,13 @@ 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; + string 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; + // uri for the relevant resource stored off chain. + string uri = 4; } // FTClass defines the class of fungible token. @@ -203,11 +203,3 @@ message Attribute { string key = 1; string value = 2; } - -// Deprecated: use Attribute -// -// Change defines a field-value pair. -message Change { - string field = 1; - string value = 2; -} diff --git a/proto/lbm/collection/v1/event.proto b/proto/lbm/collection/v1/event.proto index 7a569248b1..360b1e4742 100644 --- a/proto/lbm/collection/v1/event.proto +++ b/proto/lbm/collection/v1/event.proto @@ -74,11 +74,11 @@ enum AttributeKey { ATTRIBUTE_KEY_NEW_ROOT_TOKEN_ID = 19 [(gogoproto.enumvalue_customname) = "AttributeKeyNewRoot"]; } -// EventSent is emitted when tokens are transferred. +// EventSend is emitted when tokens are transferred. // // Since: 0.46.0 (finschia) -message EventSent { - // contract id associated with the contract. +message EventSend { + // id associated with the contract. string contract_id = 1; // address which triggered the send. string operator = 2; @@ -90,11 +90,11 @@ message EventSent { repeated Coin amount = 5 [(gogoproto.nullable) = false]; } -// EventAuthorizedOperator is emitted when a holder authorizes an operator to manipulate its tokens. +// EventAuthorizeOperator is emitted when a holder authorizes an operator to manipulate its tokens. // // Since: 0.46.0 (finschia) -message EventAuthorizedOperator { - // contract id associated with the contract. +message EventAuthorizeOperator { + // id associated with the contract. string contract_id = 1; // address of a holder which authorized the `operator` address as an operator. string holder = 2; @@ -102,11 +102,11 @@ message EventAuthorizedOperator { string operator = 3; } -// EventRevokedOperator is emitted when an authorization is revoked. +// EventRevokeOperator is emitted when an authorization is revoked. // // Since: 0.46.0 (finschia) -message EventRevokedOperator { - // contract id associated with the contract. +message EventRevokeOperator { + // id associated with the contract. string contract_id = 1; // address of a holder which revoked the `operator` address as an operator. string holder = 2; @@ -114,27 +114,27 @@ message EventRevokedOperator { string operator = 3; } -// EventCreatedContract is emitted when a new contract is created. +// EventCreateContract is emitted when a new contract is created. // // Since: 0.46.0 (finschia) -message EventCreatedContract { +message EventCreateContract { // address which created the contract. string creator = 1; - // contract id associated with the contract. + // id associated with the contract. string contract_id = 2; // name of the contract. string name = 3; // metadata of the contract. string meta = 4; // uri for the contract image stored off chain. - string base_img_uri = 5; + string uri = 5; } -// EventCreatedFTClass is emitted when a new fungible token class is created. +// EventCreateFTClass is emitted when a new fungible token class is created. // // Since: 0.46.0 (finschia) -message EventCreatedFTClass { - // contract id associated with the contract. +message EventCreateFTClass { + // id associated with the contract. string contract_id = 1; // address which triggered the create. string operator = 2; @@ -150,11 +150,11 @@ message EventCreatedFTClass { bool mintable = 7; } -// EventCreatedNFTClass is emitted when a new non-fungible token class is created. +// EventCreateNFTClass is emitted when a new non-fungible token class is created. // // Since: 0.46.0 (finschia) -message EventCreatedNFTClass { - // contract id associated with the contract. +message EventCreateNFTClass { + // id associated with the contract. string contract_id = 1; // address which triggered the create. string operator = 2; @@ -166,13 +166,13 @@ message EventCreatedNFTClass { string meta = 5; } -// EventGranted is emitted when a granter grants its permission to a grantee. +// EventGrant is emitted when a granter grants its permission to a grantee. // // Info: `granter` would be empty if the permission is granted by an issuance. // // Since: 0.46.0 (finschia) -message EventGranted { - // contract id associated with the contract. +message EventGrant { + // id associated with the contract. string contract_id = 1; // address of the granter which grants the permission. string granter = 2; @@ -182,11 +182,11 @@ message EventGranted { Permission permission = 4; } -// EventRenounced is emitted when a grantee renounced its permission. +// EventRenounce is emitted when a grantee renounced its permission. // // Since: 0.46.0 (finschia) -message EventRenounced { - // contract id associated with the contract. +message EventRenounce { + // id associated with the contract. string contract_id = 1; // address of the grantee which abandons its grant. string grantee = 2; @@ -194,11 +194,11 @@ message EventRenounced { Permission permission = 3; } -// EventMintedFT is emitted when fungible tokens are minted. +// EventMintFT is emitted when fungible tokens are minted. // // Since: 0.46.0 (finschia) -message EventMintedFT { - // contract id associated with the contract. +message EventMintFT { + // id associated with the contract. string contract_id = 1; // address which triggered the mint. string operator = 2; @@ -208,11 +208,11 @@ message EventMintedFT { repeated Coin amount = 4 [(gogoproto.nullable) = false]; } -// EventMintedNFT is emitted when non-fungible tokens are minted. +// EventMintNFT is emitted when non-fungible tokens are minted. // // Since: 0.46.0 (finschia) -message EventMintedNFT { - // contract id associated with the contract. +message EventMintNFT { + // id associated with the contract. string contract_id = 1; // address which triggered the mint. string operator = 2; @@ -222,11 +222,11 @@ message EventMintedNFT { repeated NFT tokens = 4 [(gogoproto.nullable) = false]; } -// EventBurned is emitted when tokens are burnt. +// EventBurn is emitted when tokens are burnt. // // Since: 0.46.0 (finschia) -message EventBurned { - // contract id associated with the contract. +message EventBurn { + // id associated with the contract. string contract_id = 1; // address which triggered the burn. string operator = 2; @@ -236,53 +236,56 @@ message EventBurned { repeated Coin amount = 4 [(gogoproto.nullable) = false]; } -// EventModifiedContract is emitted when the information of a contract is modified. +// EventModifyContract is emitted when the information of a contract is modified. // // Since: 0.46.0 (finschia) -message EventModifiedContract { - // contract id associated with the contract. +message EventModifyContract { + // id associated with the contract. string contract_id = 1; // address which triggered the modify. string operator = 2; // changes of the attributes applied. + // refer to the comments on MsgModify for the possible keys. repeated Attribute changes = 3 [(gogoproto.nullable) = false]; } -// EventModifiedTokenClass is emitted when the information of a token class is modified. +// EventModifyTokenClass is emitted when the information of a token class is modified. // // Since: 0.46.0 (finschia) -message EventModifiedTokenClass { - // contract id associated with the contract. +message EventModifyTokenClass { + // id associated with the contract. string contract_id = 1; // address which triggered the modify. string operator = 2; // class id associated with the token class. string class_id = 3; // changes of the attributes applied. + // refer to the comments on MsgModify for the possible keys. repeated Attribute changes = 4 [(gogoproto.nullable) = false]; // type name of the token class. string type_name = 5; } -// EventModifiedNFT is emitted when the information of a non-fungible token is modified. +// EventModifyNFT is emitted when the information of a non-fungible token is modified. // // Since: 0.46.0 (finschia) -message EventModifiedNFT { - // contract id associated with the contract. +message EventModifyNFT { + // id associated with the contract. string contract_id = 1; // address which triggered the modify. string operator = 2; // token id associated with the non-fungible token. string token_id = 3; // changes of the attributes applied. + // refer to the comments on MsgModify for the possible keys. repeated Attribute changes = 4 [(gogoproto.nullable) = false]; } -// EventAttached is emitted when a token is attached to another. +// EventAttach is emitted when a token is attached to another. // // Since: 0.46.0 (finschia) -message EventAttached { - // contract id associated with the contract. +message EventAttach { + // id associated with the contract. string contract_id = 1; // address which triggered the attach. string operator = 2; @@ -294,11 +297,11 @@ message EventAttached { string target = 5; } -// EventDetached is emitted when a token is detached from its parent. +// EventDetach is emitted when a token is detached from its parent. // // Since: 0.46.0 (finschia) -message EventDetached { - // contract id associated with the contract. +message EventDetach { + // id associated with the contract. string contract_id = 1; // address which triggered the detach. string operator = 2; @@ -314,7 +317,7 @@ message EventDetached { // // Since: 0.46.0 (finschia) message EventOwnerChanged { - // contract id associated with the contract. + // id associated with the contract. string contract_id = 1; // token id associated with the token. string token_id = 2; @@ -328,7 +331,7 @@ message EventOwnerChanged { // // Since: 0.46.0 (finschia) message EventRootChanged { - // contract id associated with the contract. + // id associated with the contract. string contract_id = 1; // token id associated with the token. string token_id = 2; diff --git a/proto/lbm/collection/v1/query.proto b/proto/lbm/collection/v1/query.proto index 0193c79126..6c073d4cd6 100644 --- a/proto/lbm/collection/v1/query.proto +++ b/proto/lbm/collection/v1/query.proto @@ -19,9 +19,7 @@ service Query { // - `contract_id` is of invalid format. // - ErrInvalidAddress // - `address` is of invalid format. - rpc Balance(QueryBalanceRequest) returns (QueryBalanceResponse) { - option (google.api.http).get = "/lbm/collection/v1/contracts/{contract_id}/balances/{address}/{token_id}"; - } + rpc Balance(QueryBalanceRequest) returns (QueryBalanceResponse) {} // AllBalances queries the balance of all token classes for a single account. // Throws: @@ -29,9 +27,7 @@ service Query { // - `contract_id` is of invalid format. // - ErrInvalidAddress // - `address` is of invalid format. - rpc AllBalances(QueryAllBalancesRequest) returns (QueryAllBalancesResponse) { - option (google.api.http).get = "/lbm/collection/v1/contracts/{contract_id}/balances/{address}"; - } + rpc AllBalances(QueryAllBalancesRequest) returns (QueryAllBalancesResponse) {} // FTSupply queries the number of tokens from a given contract id and token id. // Throws: @@ -40,9 +36,7 @@ service Query { // - `class_id` is of invalid format. // - ErrNotFound // - there is no token class of `class_id`. - rpc FTSupply(QueryFTSupplyRequest) returns (QueryFTSupplyResponse) { - option (google.api.http).get = "/lbm/collection/v1/contracts/{contract_id}/fts/{token_id}/supply"; - } + rpc FTSupply(QueryFTSupplyRequest) returns (QueryFTSupplyResponse) {} // FTMinted queries the number of minted tokens from a given contract id and token id. // Throws: @@ -51,9 +45,7 @@ service Query { // - `class_id` is of invalid format. // - ErrNotFound // - there is no token class of `class_id`. - rpc FTMinted(QueryFTMintedRequest) returns (QueryFTMintedResponse) { - option (google.api.http).get = "/lbm/collection/v1/contracts/{contract_id}/fts/{token_id}/minted"; - } + rpc FTMinted(QueryFTMintedRequest) returns (QueryFTMintedResponse) {} // FTBurnt queries the number of burnt tokens from a given contract id and token id. // Throws: @@ -62,9 +54,7 @@ service Query { // - `class_id` is of invalid format. // - ErrNotFound // - there is no token class of `class_id`. - rpc FTBurnt(QueryFTBurntRequest) returns (QueryFTBurntResponse) { - option (google.api.http).get = "/lbm/collection/v1/contracts/{contract_id}/fts/{token_id}/burnt"; - } + rpc FTBurnt(QueryFTBurntRequest) returns (QueryFTBurntResponse) {} // NFTSupply queries the number of tokens from a given contract id and token type. // Throws: @@ -73,9 +63,7 @@ service Query { // - `class_id` is of invalid format. // - ErrNotFound // - there is no token class of `class_id`. - rpc NFTSupply(QueryNFTSupplyRequest) returns (QueryNFTSupplyResponse) { - option (google.api.http).get = "/lbm/collection/v1/contracts/{contract_id}/token_types/{token_type}/supply"; - } + rpc NFTSupply(QueryNFTSupplyRequest) returns (QueryNFTSupplyResponse) {} // NFTMinted queries the number of minted tokens from a given contract id and token type. // Throws: @@ -84,9 +72,7 @@ service Query { // - `class_id` is of invalid format. // - ErrNotFound // - there is no token class of `class_id`. - rpc NFTMinted(QueryNFTMintedRequest) returns (QueryNFTMintedResponse) { - option (google.api.http).get = "/lbm/collection/v1/contracts/{contract_id}/token_types/{token_type}/minted"; - } + rpc NFTMinted(QueryNFTMintedRequest) returns (QueryNFTMintedResponse) {} // NFTBurnt queries the number of burnt tokens from a given contract id and token type. // Throws: @@ -95,9 +81,7 @@ service Query { // - `class_id` is of invalid format. // - ErrNotFound // - there is no token class of `class_id`. - rpc NFTBurnt(QueryNFTBurntRequest) returns (QueryNFTBurntResponse) { - option (google.api.http).get = "/lbm/collection/v1/contracts/{contract_id}/token_types/{token_type}/burnt"; - } + rpc NFTBurnt(QueryNFTBurntRequest) returns (QueryNFTBurntResponse) {} // Contract queries a contract metadata based on its contract id. // Throws: @@ -105,11 +89,9 @@ service Query { // - `contract_id` is of invalid format. // - ErrNotFound // - there is no contract of `contract_id`. - rpc Contract(QueryContractRequest) returns (QueryContractResponse) { - option (google.api.http).get = "/lbm/collection/v1/contracts/{contract_id}"; - } + rpc Contract(QueryContractRequest) returns (QueryContractResponse) {} - // TokenClassTypeName queries the fully qualified message type name of a token class from its class id. + // ClassTypeName queries the fully qualified message type name of a token class from its class id. // Throws: // - ErrInvalidRequest // - `contract_id` is of invalid format. @@ -117,9 +99,7 @@ service Query { // - ErrNotFound // - there is no token class of `class_id`. // Since: 0.46.0 (finschia) - rpc TokenClassTypeName(QueryTokenClassTypeNameRequest) returns (QueryTokenClassTypeNameResponse) { - option (google.api.http).get = "/lbm/collection/v1/contracts/{contract_id}/token_classes/{class_id}/type_name"; - } + rpc ClassTypeName(QueryClassTypeNameRequest) returns (QueryClassTypeNameResponse) {} // TokenType queries metadata of a token type. // Throws: @@ -128,9 +108,7 @@ service Query { // - `class_id` is of invalid format. // - ErrNotFound // - there is no token class of `class_id`. - rpc TokenType(QueryTokenTypeRequest) returns (QueryTokenTypeResponse) { - option (google.api.http).get = "/lbm/collection/v1/contracts/{contract_id}/token_types/{token_type}"; - } + rpc TokenType(QueryTokenTypeRequest) returns (QueryTokenTypeResponse) {} // TokenTypes queries metadata of all the token types. // Throws: @@ -138,9 +116,7 @@ service Query { // - `contract_id` is of invalid format. // - ErrNotFound // - there is no token contract of `contract_id`. - rpc TokenTypes(QueryTokenTypesRequest) returns (QueryTokenTypesResponse) { - option (google.api.http).get = "/lbm/collection/v1/contracts/{contract_id}/token_types"; - } + rpc TokenTypes(QueryTokenTypesRequest) returns (QueryTokenTypesResponse) {} // Token queries a metadata of a token from its token id. // Throws: @@ -149,9 +125,7 @@ service Query { // - `token_id` is of invalid format. // - ErrNotFound // - there is no token of `token_id`. - rpc Token(QueryTokenRequest) returns (QueryTokenResponse) { - option (google.api.http).get = "/lbm/collection/v1/contracts/{contract_id}/tokens/{token_id}"; - } + rpc Token(QueryTokenRequest) returns (QueryTokenResponse) {} // TokensWithTokenType queries all token metadata with token type. // Throws: @@ -160,9 +134,7 @@ service Query { // - `token_type` is of invalid format. // - ErrNotFound // - there is no contract of `contract_id`. - rpc TokensWithTokenType(QueryTokensWithTokenTypeRequest) returns (QueryTokensWithTokenTypeResponse) { - option (google.api.http).get = "/lbm/collection/v1/contracts/{contract_id}/token_types/{token_type}/tokens"; - } + rpc TokensWithTokenType(QueryTokensWithTokenTypeRequest) returns (QueryTokensWithTokenTypeResponse) {} // Tokens queries all token metadata. // Throws: @@ -170,9 +142,7 @@ service Query { // - `contract_id` is of invalid format. // - ErrNotFound // - there is no contract of `contract_id`. - rpc Tokens(QueryTokensRequest) returns (QueryTokensResponse) { - option (google.api.http).get = "/lbm/collection/v1/contracts/{contract_id}/tokens"; - } + rpc Tokens(QueryTokensRequest) returns (QueryTokensResponse) {} // Root queries the root of a given nft. // Throws: @@ -181,9 +151,7 @@ service Query { // - `token_id` is of invalid format. // - ErrNotFound // - there is no token of `token_id`. - rpc Root(QueryRootRequest) returns (QueryRootResponse) { - option (google.api.http).get = "/lbm/collection/v1/contracts/{contract_id}/nfts/{token_id}/root"; - } + rpc Root(QueryRootRequest) returns (QueryRootResponse) {} // Parent queries the parent of a given nft. // Throws: @@ -193,28 +161,22 @@ service Query { // - ErrNotFound // - there is no token of `token_id`. // - token is the root. - rpc Parent(QueryParentRequest) returns (QueryParentResponse) { - option (google.api.http).get = "/lbm/collection/v1/contracts/{contract_id}/nfts/{token_id}/parent"; - } + rpc Parent(QueryParentRequest) returns (QueryParentResponse) {} // Children queries the children of a given nft. // Throws: // - ErrInvalidRequest // - `contract_id` is of invalid format. // - `token_id` is of invalid format. - rpc Children(QueryChildrenRequest) returns (QueryChildrenResponse) { - option (google.api.http).get = "/lbm/collection/v1/contracts/{contract_id}/nfts/{token_id}/children"; - } + rpc Children(QueryChildrenRequest) returns (QueryChildrenResponse) {} - // GranteeGrants queries all permissions on a given grantee. + // GrantsByGrantee queries all permissions on a given grantee. // Throws: // - ErrInvalidRequest // - `contract_id` is of invalid format. // - ErrInvalidAddress // - `grantee` is of invalid format. - rpc GranteeGrants(QueryGranteeGrantsRequest) returns (QueryGranteeGrantsResponse) { - option (google.api.http).get = "/lbm/collection/v1/contracts/{contract_id}/grants/{grantee}"; - } + rpc GrantsByGrantee(QueryGrantsByGranteeRequest) returns (QueryGrantsByGranteeResponse) {} // Approved queries whether the proxy is approved by the approver. // Throws: @@ -225,9 +187,7 @@ service Query { // - `approver` is of invalid format. // - ErrNotFound // - there is no authorization given by `approver` to `proxy`. - rpc Approved(QueryApprovedRequest) returns (QueryApprovedResponse) { - option (google.api.http).get = "/lbm/collection/v1/contracts/{contract_id}/accounts/{address}/proxies/{approver}"; - } + rpc Approved(QueryApprovedRequest) returns (QueryApprovedResponse) {} // Approvers queries approvers of a given proxy. // Throws: @@ -235,9 +195,7 @@ service Query { // - `contract_id` is of invalid format. // - ErrInvalidAddress // - `proxy` is of invalid format. - rpc Approvers(QueryApproversRequest) returns (QueryApproversResponse) { - option (google.api.http).get = "/lbm/collection/v1/contracts/{contract_id}/accounts/{address}/approvers"; - } + rpc Approvers(QueryApproversRequest) returns (QueryApproversResponse) {} } // QueryBalanceRequest is the request type for the Query/Balance RPC method. @@ -372,20 +330,20 @@ message QueryContractResponse { Contract contract = 1 [(gogoproto.nullable) = false]; } -// QueryTokenClassTypeNameRequest is the request type for the Query/TokenClassTypeName RPC method. +// QueryClassTypeNameRequest is the request type for the Query/ClassTypeName RPC method. // // Since: 0.46.0 (finschia) -message QueryTokenClassTypeNameRequest { +message QueryClassTypeNameRequest { // contract id associated with the contract. string contract_id = 1; // class id associated with the token class. string class_id = 2; } -// QueryTokenClassTypeNameResponse is the response type for the Query/TokenClassTypeName RPC method. +// QueryClassTypeNameResponse is the response type for the Query/ClassTypeName RPC method. // // Since: 0.46.0 (finschia) -message QueryTokenClassTypeNameResponse { +message QueryClassTypeNameResponse { // type name of the token class. string name = 1; } @@ -524,8 +482,8 @@ message QueryChildrenResponse { cosmos.base.query.v1beta1.PageResponse pagination = 2; } -// QueryGranteeGrantsRequest is the request type for the Query/GranteeGrants RPC method. -message QueryGranteeGrantsRequest { +// QueryGrantsByGranteeRequest is the request type for the Query/GrantsByGrantee RPC method. +message QueryGrantsByGranteeRequest { // contract id associated with the contract. string contract_id = 1; // the address of the grantee. @@ -535,8 +493,8 @@ message QueryGranteeGrantsRequest { cosmos.base.query.v1beta1.PageRequest pagination = 3; } -// QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method. -message QueryGranteeGrantsResponse { +// QueryGrantsByGranteeResponse is the response type for the Query/GrantsByGrantee RPC method. +message QueryGrantsByGranteeResponse { repeated Grant grants = 1 [(gogoproto.nullable) = false]; // pagination defines the pagination in the response. diff --git a/proto/lbm/collection/v1/tx.proto b/proto/lbm/collection/v1/tx.proto index 2015c061c6..c0e280d179 100644 --- a/proto/lbm/collection/v1/tx.proto +++ b/proto/lbm/collection/v1/tx.proto @@ -11,16 +11,16 @@ option (gogoproto.equal_all) = false; // Msg defines the collection Msg service. service Msg { - // TransferFT defines a method to send fungible tokens from one account to another account. + // SendFT defines a method to send fungible tokens from one account to another account. // Fires: // - EventSent // - transfer_ft (deprecated, not typed) // Throws: // - ErrInvalidRequest: // - the balance of `from` does not have enough tokens to spend. - rpc TransferFT(MsgTransferFT) returns (MsgTransferFTResponse); + rpc Send(MsgSendFT) returns (MsgSendFTResponse); - // TransferFTFrom defines a method to send fungible tokens from one account to another account by the proxy. + // OperatorSendFT defines a method to send fungible tokens from one account to another account by the proxy. // Fires: // - EventSent // - transfer_ft_from (deprecated, not typed) @@ -29,9 +29,9 @@ service Msg { // - the approver has not authorized the proxy. // - ErrInvalidRequest: // - the balance of `from` does not have enough tokens to spend. - rpc TransferFTFrom(MsgTransferFTFrom) returns (MsgTransferFTFromResponse); + rpc OperatorSendFT(MsgOperatorSendFT) returns (MsgOperatorSendFTResponse); - // TransferNFT defines a method to send non-fungible tokens from one account to another account. + // SendNFT defines a method to send non-fungible tokens from one account to another account. // Fires: // - EventSent // - transfer_nft (deprecated, not typed) @@ -39,9 +39,9 @@ service Msg { // Throws: // - ErrInvalidRequest: // - the balance of `from` does not have enough tokens to spend. - rpc TransferNFT(MsgTransferNFT) returns (MsgTransferNFTResponse); + rpc SendNFT(MsgSendNFT) returns (MsgSendNFTResponse); - // TransferNFTFrom defines a method to send non-fungible tokens from one account to another account by the proxy. + // OperatorSendNFT defines a method to send non-fungible tokens from one account to another account by the proxy. // Fires: // - EventSent // - transfer_nft_from (deprecated, not typed) @@ -51,9 +51,9 @@ service Msg { // - the approver has not authorized the proxy. // - ErrInvalidRequest: // - the balance of `from` does not have enough tokens to spend. - rpc TransferNFTFrom(MsgTransferNFTFrom) returns (MsgTransferNFTFromResponse); + rpc OperatorSendNFT(MsgOperatorSendNFT) returns (MsgOperatorSendNFTResponse); - // Approve allows one to send tokens on behalf of the approver. + // AuthorizeOperator allows one to send tokens on behalf of the approver. // Fires: // - EventAuthorizedOperator // - approve_collection (deprecated, not typed) @@ -62,9 +62,9 @@ service Msg { // - there is no contract of `contract_id`. // - ErrInvalidRequest: // - `approver` has already authorized `proxy`. - rpc Approve(MsgApprove) returns (MsgApproveResponse); + rpc AuthorizeOperator(MsgAuthorizeOperator) returns (MsgAuthorizeOperatorResponse); - // Disapprove revokes the authorization of the proxy to send the approver's token. + // RevokeOperator revokes the authorization of the proxy to send the approver's token. // Fires: // - EventRevokedOperator // - disapprove_collection (deprecated, not typed) @@ -72,7 +72,7 @@ service Msg { // - ErrNotFound: // - there is no contract of `contract_id`. // - there is no authorization by `approver` to `proxy`. - rpc Disapprove(MsgDisapprove) returns (MsgDisapproveResponse); + rpc RevokeOperator(MsgRevokeOperator) returns (MsgRevokeOperatorResponse); // CreateContract defines a method to create a contract for collection. // it grants `mint`, `burn`, `modify` and `issue` permissions on the contract to its creator. @@ -81,20 +81,20 @@ service Msg { // - create_collection (deprecated, not typed) rpc CreateContract(MsgCreateContract) returns (MsgCreateContractResponse); - // IssueFT defines a method to create a class of fungible token. + // CreateFTClass defines a method to create a class of fungible token. // Fires: // - EventCreatedFTClass // - EventMintedFT // - issue_ft (deprecated, not typed) // Note: it does not grant any permissions to its issuer. - rpc IssueFT(MsgIssueFT) returns (MsgIssueFTResponse); + rpc CreateFTClass(MsgCreateFTClass) returns (MsgCreateFTClassResponse); - // IssueNFT defines a method to create a class of non-fungible token. + // CreateNFTClass defines a method to create a class of non-fungible token. // Fires: // - EventCreatedNFTClass // - issue_nft (deprecated, not typed) // Note: it DOES grant `mint` and `burn` permissions to its issuer. - rpc IssueNFT(MsgIssueNFT) returns (MsgIssueNFTResponse); + rpc CreateNFTClass(MsgCreateNFTClass) returns (MsgCreateNFTClassResponse); // MintFT defines a method to mint fungible tokens. // Fires: @@ -127,7 +127,7 @@ service Msg { // - the balance of `from` does not have enough tokens to burn. rpc BurnFT(MsgBurnFT) returns (MsgBurnFTResponse); - // BurnFTFrom defines a method to burn fungible tokens of the approver by the proxy. + // OperatorBurnFT defines a method to burn fungible tokens of the approver by the proxy. // Fires: // - EventBurned // - burn_ft_from (deprecated, not typed) @@ -139,7 +139,7 @@ service Msg { // - the approver has not authorized `proxy`. // - ErrInvalidRequest: // - the balance of `from` does not have enough tokens to burn. - rpc BurnFTFrom(MsgBurnFTFrom) returns (MsgBurnFTFromResponse); + rpc OperatorBurnFT(MsgOperatorBurnFT) returns (MsgOperatorBurnFTResponse); // BurnNFT defines a method to burn non-fungible tokens. // Fires: @@ -154,7 +154,7 @@ service Msg { // - the balance of `from` does not have enough tokens to burn. rpc BurnNFT(MsgBurnNFT) returns (MsgBurnNFTResponse); - // BurnNFTFrom defines a method to burn non-fungible tokens of the approver by the proxy. + // OperatorBurnNFT defines a method to burn non-fungible tokens of the approver by the proxy. // Fires: // - EventBurned // - burn_ft_from (deprecated, not typed) @@ -166,7 +166,7 @@ service Msg { // - the approver has not authorized `proxy`. // - ErrInvalidRequest: // - the balance of `from` does not have enough tokens to burn. - rpc BurnNFTFrom(MsgBurnNFTFrom) returns (MsgBurnNFTFromResponse); + rpc OperatorBurnNFT(MsgOperatorBurnNFT) returns (MsgOperatorBurnNFTResponse); // Modify defines a method to modify metadata. // Fires: @@ -185,7 +185,7 @@ service Msg { // - there is no token of `token_id`. rpc Modify(MsgModify) returns (MsgModifyResponse); - // GrantPermission allows one to mint or burn tokens or modify metadata. + // Grant allows one to mint or burn tokens or modify metadata. // Fires: // - EventGranted // - grant_perm (deprecated, not typed) @@ -194,16 +194,16 @@ service Msg { // - `granter` does not have `permission`. // - ErrInvalidRequest // - `grantee` already has `permission`. - rpc GrantPermission(MsgGrantPermission) returns (MsgGrantPermissionResponse); + rpc Grant(MsgGrant) returns (MsgGrantResponse); - // RevokePermission abandons a permission. + // Renounce abandons a permission. // Fires: // - EventRenounced // - revoke_perm (deprecated, not typed) // Throws: // - ErrUnauthorized // - `grantee` does not have `permission`. - rpc RevokePermission(MsgRevokePermission) returns (MsgRevokePermissionResponse); + rpc Renounce(MsgRenounce) returns (MsgRenounceResponse); // Attach defines a method to attach a token to another token. // Fires: @@ -229,7 +229,7 @@ service Msg { // - `owner` does not owns `token_id`. rpc Detach(MsgDetach) returns (MsgDetachResponse); - // AttachFrom defines a method to attach a token to another token by proxy. + // OperatorAttach defines a method to attach a token to another token by proxy. // Fires: // - EventAttach // - attach_from (deprecated, not typed) @@ -243,9 +243,9 @@ service Msg { // - `subject` is not root. // - `subject` is an ancestor of `target`, which creates a cycle as a result. // - depth of `to` exceeds an app-specific limit. - rpc AttachFrom(MsgAttachFrom) returns (MsgAttachFromResponse); + rpc OperatorAttach(MsgOperatorAttach) returns (MsgOperatorAttachResponse); - // DetachFrom defines a method to detach a token from another token by proxy. + // OperatorDetach defines a method to detach a token from another token by proxy. // Fires: // - EventDetach // - detach_from (deprecated, not typed) @@ -255,11 +255,11 @@ service Msg { // - the approver has not authorized `proxy`. // - ErrInvalidRequest // - `owner` does not owns `subject`. - rpc DetachFrom(MsgDetachFrom) returns (MsgDetachFromResponse); + rpc OperatorDetach(MsgOperatorDetach) returns (MsgOperatorDetachResponse); } -// MsgTransferFT is the Msg/TransferFT request type. -message MsgTransferFT { +// MsgSendFT is the Msg/SendFT request type. +message MsgSendFT { // contract id associated with the contract. string contract_id = 1; // the address which the transfer is from. @@ -271,15 +271,15 @@ message MsgTransferFT { repeated Coin amount = 4 [(gogoproto.nullable) = false]; } -// MsgTransferFTResponse is the Msg/TransferFT response type. -message MsgTransferFTResponse {} +// MsgSendFTResponse is the Msg/SendFT response type. +message MsgSendFTResponse {} -// MsgTransferFTFrom is the Msg/TransferFTFrom request type. -message MsgTransferFTFrom { +// MsgOperatorSendFT is the Msg/OperatorSendFT request type. +message MsgOperatorSendFT { // contract id associated with the contract. string contract_id = 1; // the address of the proxy. - string proxy = 2; + string operator = 2; // the address which the transfer is from. string from = 3; // the address which the transfer is to. @@ -289,11 +289,11 @@ message MsgTransferFTFrom { repeated Coin amount = 5 [(gogoproto.nullable) = false]; } -// MsgTransferFTFromResponse is the Msg/TransferFTFrom response type. -message MsgTransferFTFromResponse {} +// MsgOperatorSendFTResponse is the Msg/OperatorSendFT response type. +message MsgOperatorSendFTResponse {} -// MsgTransferNFT is the Msg/TransferNFT request type. -message MsgTransferNFT { +// MsgSendNFT is the Msg/SendNFT request type. +message MsgSendNFT { // contract id associated with the contract. string contract_id = 1; // the address which the transfer is from. @@ -304,15 +304,15 @@ message MsgTransferNFT { repeated string token_ids = 4; } -// MsgTransferNFTResponse is the Msg/TransferNFT response type. -message MsgTransferNFTResponse {} +// MsgSendNFTResponse is the Msg/SendNFT response type. +message MsgSendNFTResponse {} -// MsgTransferNFTFrom is the Msg/TransferNFTFrom request type. -message MsgTransferNFTFrom { +// MsgOperatorSendNFT is the Msg/OperatorSendNFT request type. +message MsgOperatorSendNFT { // contract id associated with the contract. string contract_id = 1; // the address of the proxy. - string proxy = 2; + string operator = 2; // the address which the transfer is from. string from = 3; // the address which the transfer is to. @@ -321,34 +321,34 @@ message MsgTransferNFTFrom { repeated string token_ids = 5; } -// MsgTransferNFTFromResponse is the Msg/TransferNFTFrom response type. -message MsgTransferNFTFromResponse {} +// MsgOperatorSendNFTResponse is the Msg/OperatorSendNFT response type. +message MsgOperatorSendNFTResponse {} -// MsgApprove is the Msg/Approve request type. -message MsgApprove { +// MsgAuthorizeOperator is the Msg/AuthorizeOperator request type. +message MsgAuthorizeOperator { // contract id associated with the contract. string contract_id = 1; // address of the approver who allows the manipulation of its token. - string approver = 2; + string holder = 2; // address which the manipulation is allowed to. - string proxy = 3; + string operator = 3; } -// MsgApproveResponse is the Msg/Approve response type. -message MsgApproveResponse {} +// MsgAuthorizeOperatorResponse is the Msg/AuthorizeOperator response type. +message MsgAuthorizeOperatorResponse {} -// MsgDisapprove is the Msg/Disapprove request type. -message MsgDisapprove { +// MsgRevokeOperator is the Msg/RevokeOperator request type. +message MsgRevokeOperator { // contract id associated with the contract. string contract_id = 1; // address of the approver who allows the manipulation of its token. - string approver = 2; + string holder = 2; // address which the manipulation is allowed to. - string proxy = 3; + string operator = 3; } -// MsgDisapproveResponse is the Msg/Disapprove response type. -message MsgDisapproveResponse {} +// MsgRevokeOperatorResponse is the Msg/RevokeOperator response type. +message MsgRevokeOperatorResponse {} // MsgCreateContract is the Msg/CreateContract request type. // @@ -363,12 +363,12 @@ message MsgDisapproveResponse {} // Signer: `owner` message MsgCreateContract { // address which all the permissions on the contract will be granted to (not a permanent property). - string owner = 1; + string creator = 1; // name defines the human-readable name of the contract. string name = 2; - // base img uri is an uri for the contract image stored off chain. - string base_img_uri = 3; + // uri for the resource of the contract stored off chain. + string uri = 3; // meta is a brief description of the contract. string meta = 4; } @@ -376,10 +376,10 @@ message MsgCreateContract { // MsgCreateContractResponse is the Msg/CreateContract response type. message MsgCreateContractResponse { // id of the new contract. - string id = 1; + string contract_id = 1; } -// MsgIssueFT is the Msg/IssueFT request type. +// MsgCreateFTClass is the Msg/CreateFTClass request type. // // Throws: // - ErrInvalidAddress @@ -395,7 +395,7 @@ message MsgCreateContractResponse { // - `mintable` == false, amount == 1 and decimals == 0 (weird, but for the backward compatibility). // // Signer: `owner` -message MsgIssueFT { +message MsgCreateFTClass { // contract id associated with the contract. string contract_id = 1; // name defines the human-readable name of the token type. @@ -408,7 +408,7 @@ message MsgIssueFT { bool mintable = 5; // the address of the grantee which must have the permission to issue a token. - string owner = 6; + string operator = 6; // the address to send the minted tokens to. mandatory. string to = 7; @@ -418,13 +418,13 @@ message MsgIssueFT { string amount = 8 [(gogoproto.customtype) = "github.com/line/lbm-sdk/types.Int", (gogoproto.nullable) = false]; } -// MsgIssueFTResponse is the Msg/IssueFT response type. -message MsgIssueFTResponse { +// MsgCreateFTClassResponse is the Msg/CreateFTClass response type. +message MsgCreateFTClassResponse { // id of the new token type. - string id = 1; + string class_id = 1; } -// MsgIssueNFT is the Msg/IssueNFT request type. +// MsgCreateNFTClass is the Msg/CreateNFTClass request type. // // Throws: // - ErrInvalidAddress @@ -435,7 +435,7 @@ message MsgIssueFTResponse { // - `meta` exceeds the app-specific limit in length. // // Signer: `owner` -message MsgIssueNFT { +message MsgCreateNFTClass { // contract id associated with the contract. string contract_id = 1; // name defines the human-readable name of the token type. @@ -444,13 +444,13 @@ message MsgIssueNFT { string meta = 3; // the address of the grantee which must have the permission to issue a token. - string owner = 4; + string operator = 4; } -// MsgIssueNFTResponse is the Msg/IssueNFT response type. -message MsgIssueNFTResponse { - // id of the new token type. - string id = 1; +// MsgCreateNFTClassResponse is the Msg/CreateNFTClass response type. +message MsgCreateNFTClassResponse { + // the new token type. + string token_type = 1; } // MsgMintFT is the Msg/MintFT request type. @@ -468,7 +468,7 @@ message MsgMintFT { // contract id associated with the contract. string contract_id = 1; // address of the grantee which has the permission for the mint. - string from = 2; + string operator = 2; // address which the minted tokens will be sent to. string to = 3; // the amount of the mint. @@ -495,7 +495,7 @@ message MsgMintNFT { // contract id associated with the contract. string contract_id = 1; // address of the grantee which has the permission for the mint. - string from = 2; + string operator = 2; // address which the minted token will be sent to. string to = 3; // parameters for the minted tokens. @@ -505,7 +505,7 @@ message MsgMintNFT { // MsgMintNFTResponse is the Msg/MintNFT response type. message MsgMintNFTResponse { // ids of the new non-fungible tokens. - repeated string ids = 1; + repeated string token_ids = 1; } // MintNFTParam defines a parameter for minting nft. @@ -536,8 +536,8 @@ message MsgBurnFT { // MsgBurnFTResponse is the Msg/BurnFT response type. message MsgBurnFTResponse {} -// MsgBurnFTFrom is the Msg/BurnFTFrom request type. -message MsgBurnFTFrom { +// MsgOperatorBurnFT is the Msg/OperatorBurnFT request type. +message MsgOperatorBurnFT { // contract id associated with the contract. string contract_id = 1; // address which triggers the burn. @@ -551,8 +551,8 @@ message MsgBurnFTFrom { repeated Coin amount = 4 [(gogoproto.nullable) = false]; } -// MsgBurnFTFromResponse is the Msg/BurnFTFrom response type. -message MsgBurnFTFromResponse {} +// MsgOperatorBurnFTResponse is the Msg/OperatorBurnFT response type. +message MsgOperatorBurnFTResponse {} // MsgBurnNFT is the Msg/BurnNFT request type. message MsgBurnNFT { @@ -569,8 +569,8 @@ message MsgBurnNFT { // MsgBurnNFTResponse is the Msg/BurnNFT response type. message MsgBurnNFTResponse {} -// MsgBurnNFTFrom is the Msg/BurnNFTFrom request type. -message MsgBurnNFTFrom { +// MsgOperatorBurnNFT is the Msg/OperatorBurnNFT request type. +message MsgOperatorBurnNFT { // contract id associated with the contract. string contract_id = 1; // address which triggers the burn. @@ -584,8 +584,8 @@ message MsgBurnNFTFrom { repeated string token_ids = 4; } -// MsgBurnNFTFromResponse is the Msg/BurnNFTFrom response type. -message MsgBurnNFTFromResponse {} +// MsgOperatorBurnNFTResponse is the Msg/OperatorBurnNFT response type. +message MsgOperatorBurnNFTResponse {} // MsgModify is the Msg/Modify request type. message MsgModify { @@ -601,16 +601,17 @@ message MsgModify { // Note: if token type is of FTs, the index cannot be empty. string token_index = 4; // changes to apply. - // on modifying collection: name, base_img_uri, meta. - // on modifying token type and token: name, meta. - repeated Change changes = 5 [(gogoproto.nullable) = false]; + // possible keys: + // on modifying collection: name, uri, meta + // on modifying token type and token: name, meta + repeated Attribute changes = 5 [(gogoproto.nullable) = false]; } // MsgModifyResponse is the Msg/Modify response type. message MsgModifyResponse {} -// MsgGrantPermission is the Msg/GrantPermission request type. -message MsgGrantPermission { +// MsgGrant is the Msg/Grant request type. +message MsgGrant { // contract id associated with the contract. string contract_id = 1; // address of the granter which must have the permission to give. @@ -621,11 +622,11 @@ message MsgGrantPermission { string permission = 4; } -// MsgGrantPermissionResponse is the Msg/GrantPermission response type. -message MsgGrantPermissionResponse {} +// MsgGrantResponse is the Msg/Grant response type. +message MsgGrantResponse {} -// MsgRevokePermission is the Msg/RevokePermission request type. -message MsgRevokePermission { +// MsgRenounce is the Msg/Renounce request type. +message MsgRenounce { // contract id associated with the contract. string contract_id = 1; // address of the grantee which abandons the permission. @@ -634,8 +635,8 @@ message MsgRevokePermission { string permission = 3; } -// MsgRevokePermissionResponse is the Msg/RevokePermission response type. -message MsgRevokePermissionResponse {} +// MsgRenounceResponse is the Msg/Renounce response type. +message MsgRenounceResponse {} // MsgAttach is the Msg/Attach request type. // @@ -685,8 +686,8 @@ message MsgDetach { // MsgDetachResponse is the Msg/Detach response type. message MsgDetachResponse {} -// MsgAttachFrom is the Msg/AttachFrom request type. -message MsgAttachFrom { +// MsgOperatorAttach is the Msg/OperatorAttach request type. +message MsgOperatorAttach { // contract id associated with the contract. string contract_id = 1; // address of the proxy. @@ -699,11 +700,11 @@ message MsgAttachFrom { string to_token_id = 5; } -// MsgAttachFromResponse is the Msg/AttachFrom response type. -message MsgAttachFromResponse {} +// MsgOperatorAttachResponse is the Msg/OperatorAttach response type. +message MsgOperatorAttachResponse {} -// MsgDetachFrom is the Msg/DetachFrom request type. -message MsgDetachFrom { +// MsgOperatorDetach is the Msg/OperatorDetach request type. +message MsgOperatorDetach { // contract id associated with the contract. string contract_id = 1; // address of the proxy. @@ -714,5 +715,5 @@ message MsgDetachFrom { string token_id = 4; } -// MsgDetachFromResponse is the Msg/DetachFrom response type. -message MsgDetachFromResponse {} +// MsgOperatorDetachResponse is the Msg/OperatorDetach response type. +message MsgOperatorDetachResponse {} diff --git a/proto/lbm/token/v1/event.proto b/proto/lbm/token/v1/event.proto index 934628e090..19ddd19441 100644 --- a/proto/lbm/token/v1/event.proto +++ b/proto/lbm/token/v1/event.proto @@ -51,11 +51,11 @@ enum AttributeKey { ATTRIBUTE_KEY_PROXY = 14 [(gogoproto.enumvalue_customname) = "AttributeKeyProxy"]; } -// EventSent is emitted when tokens are transferred. +// EventSend is emitted when tokens are transferred. // // Since: 0.46.0 (finschia) -message EventSent { - // contract id associated with the token class. +message EventSend { + // id associated with the token contract. string contract_id = 1; // address which triggered the send. string operator = 2; @@ -67,11 +67,11 @@ message EventSent { string amount = 5 [(gogoproto.customtype) = "github.com/line/lbm-sdk/types.Int", (gogoproto.nullable) = false]; } -// EventAuthorizedOperator is emitted when a holder authorizes an operator to manipulate its tokens. +// EventAuthorizeOperator is emitted when a holder authorizes an operator to manipulate its tokens. // // Since: 0.46.0 (finschia) -message EventAuthorizedOperator { - // contract id associated with the token class. +message EventAuthorizeOperator { + // id associated with the token contract. string contract_id = 1; // address of a holder which authorized the `operator` address as an operator. string holder = 2; @@ -79,11 +79,11 @@ message EventAuthorizedOperator { string operator = 3; } -// EventRevokedOperator is emitted when an authorization is revoked. +// EventRevokeOperator is emitted when an authorization is revoked. // // Since: 0.46.0 (finschia) -message EventRevokedOperator { - // contract id associated with the token class. +message EventRevokeOperator { + // id associated with the token contract. string contract_id = 1; // address of a holder which revoked the `operator` address as an operator. string holder = 2; @@ -91,21 +91,21 @@ message EventRevokedOperator { string operator = 3; } -// EventIssued is emitted when a new token class is created. +// EventCreateContract is emitted when a new token contract is created. // // Since: 0.46.0 (finschia) -message EventIssued { +message EventCreateContract { // address which created the contract. string creator = 1; - // contract id associated with the token class. + // id associated with the token contract. string contract_id = 2; - // name defines the human-readable name of the token class. + // name defines the human-readable name of the token contract. string name = 3; - // symbol is an abbreviated name for token class. + // symbol is an abbreviated name for token contract. string symbol = 4; - // uri is an uri for the resource of the token class stored off chain. + // uri is an uri for the resource of the token contract stored off chain. string uri = 5; - // meta is a brief description of token class. + // meta is a brief description of token contract. string meta = 6; // decimals is the number of decimals which one must divide the amount by to get its user representation. int32 decimals = 7; @@ -113,40 +113,40 @@ message EventIssued { bool mintable = 8; } -// EventGranted is emitted when a granter grants its permission to a grantee. +// EventGrant is emitted when a granter grants its permission to a grantee. // // Info: `granter` would be empty if the permission is granted by an issuance. // // Since: 0.46.0 (finschia) -message EventGranted { - // contract id associated with the token class. +message EventGrant { + // id associated with the token contract. string contract_id = 1; // address which granted the permission to `grantee`. // it would be empty where the event is triggered by the issuance. string granter = 2; // address of the grantee. string grantee = 3; - // permission on the token class. + // permission on the token contract. Permission permission = 4; } -// EventRenounced is emitted when a grantee renounces its permission. +// EventRenounce is emitted when a grantee renounces its permission. // // Since: 0.46.0 (finschia) -message EventRenounced { - // contract id associated with the token class. +message EventRenounce { + // id associated with the token contract. string contract_id = 1; // address of the grantee which abandons its grant. string grantee = 2; - // permission on the token class. + // permission on the token contract. Permission permission = 3; } -// EventMinted is emitted when tokens are minted. +// EventMint is emitted when tokens are minted. // // Since: 0.46.0 (finschia) -message EventMinted { - // contract id associated with the token class. +message EventMint { + // id associated with the token contract. string contract_id = 1; // address which triggered the mint. string operator = 2; @@ -156,11 +156,11 @@ message EventMinted { string amount = 4 [(gogoproto.customtype) = "github.com/line/lbm-sdk/types.Int", (gogoproto.nullable) = false]; } -// EventBurned is emitted when tokens are burnt. +// EventBurn is emitted when tokens are burnt. // // Since: 0.46.0 (finschia) -message EventBurned { - // contract id associated with the token class. +message EventBurn { + // id associated with the token contract. string contract_id = 1; // address which triggered the burn. string operator = 2; @@ -170,14 +170,15 @@ message EventBurned { string amount = 4 [(gogoproto.customtype) = "github.com/line/lbm-sdk/types.Int", (gogoproto.nullable) = false]; } -// EventModified is emitted when the information of a token class is modified. +// EventModifyContract is emitted when the information of a token contract is modified. // // Since: 0.46.0 (finschia) -message EventModified { - // contract id associated with the token class. +message EventModifyContract { + // id associated with the token contract. string contract_id = 1; // address which triggered the modify. string operator = 2; - // changes on the metadata of the class. - repeated Pair changes = 3 [(gogoproto.nullable) = false]; + // changes on the metadata of the contract. + // refer to the comments on MsgModify for the possible keys. + repeated Attribute changes = 3 [(gogoproto.nullable) = false]; } diff --git a/proto/lbm/token/v1/genesis.proto b/proto/lbm/token/v1/genesis.proto index b9b4850ad0..c927adabb5 100644 --- a/proto/lbm/token/v1/genesis.proto +++ b/proto/lbm/token/v1/genesis.proto @@ -18,7 +18,7 @@ message GenesisState { repeated ContractBalances balances = 3 [(gogoproto.nullable) = false]; // classes defines the metadata of the differents tokens. - repeated TokenClass classes = 4 [(gogoproto.nullable) = false]; + repeated Contract contracts = 4 [(gogoproto.nullable) = false]; // grants defines the grant information. repeated ContractGrants grants = 5 [(gogoproto.nullable) = false]; diff --git a/proto/lbm/token/v1/query.proto b/proto/lbm/token/v1/query.proto index d47c5b4580..695583c6f6 100644 --- a/proto/lbm/token/v1/query.proto +++ b/proto/lbm/token/v1/query.proto @@ -18,7 +18,7 @@ service Query { // - ErrInvalidAddress // - `address` is of invalid format. rpc Balance(QueryBalanceRequest) returns (QueryBalanceResponse) { - option (google.api.http).get = "/lbm/token/v1/token_classes/{contract_id}/balances/{address}"; + option (google.api.http).get = "/lbm/token/v1/contracts/{contract_id}/balances/{address}"; } // Supply queries the number of tokens from the given contract id. @@ -28,7 +28,7 @@ service Query { // - ErrNotFound // - there is no token class of `contract_id`. rpc Supply(QuerySupplyRequest) returns (QuerySupplyResponse) { - option (google.api.http).get = "/lbm/token/v1/token_classes/{contract_id}/supply"; + option (google.api.http).get = "/lbm/token/v1/contracts/{contract_id}/supply"; } // Minted queries the number of minted tokens from the given contract id. @@ -38,7 +38,7 @@ service Query { // - ErrNotFound // - there is no token class of `contract_id`. rpc Minted(QueryMintedRequest) returns (QueryMintedResponse) { - option (google.api.http).get = "/lbm/token/v1/token_classes/{contract_id}/minted"; + option (google.api.http).get = "/lbm/token/v1/contracts/{contract_id}/minted"; } // Burnt queries the number of burnt tokens from the given contract id. @@ -48,32 +48,32 @@ service Query { // - ErrNotFound // - there is no token class of `contract_id`. rpc Burnt(QueryBurntRequest) returns (QueryBurntResponse) { - option (google.api.http).get = "/lbm/token/v1/token_classes/{contract_id}/burnt"; + option (google.api.http).get = "/lbm/token/v1/contracts/{contract_id}/burnt"; } - // TokenClass queries an token metadata based on its contract id. + // Contract queries an token metadata based on its contract id. // Throws: // - ErrInvalidRequest // - `contract_id` is of invalid format. // - ErrNotFound // - there is no token class of `contract_id`. - rpc TokenClass(QueryTokenClassRequest) returns (QueryTokenClassResponse) { - option (google.api.http).get = "/lbm/token/v1/token_classes/{contract_id}"; + rpc Contract(QueryContractRequest) returns (QueryContractResponse) { + option (google.api.http).get = "/lbm/token/v1/contracts/{contract_id}"; } - // TokenClasses queries all token metadata. - rpc TokenClasses(QueryTokenClassesRequest) returns (QueryTokenClassesResponse) { - option (google.api.http).get = "/lbm/token/v1/token_classes"; + // Contracts queries all token metadata. + rpc Contracts(QueryContractsRequest) returns (QueryContractsResponse) { + option (google.api.http).get = "/lbm/token/v1/contracts"; } - // GranteeGrants queries permissions on a given grantee. + // GrantsByGrantee queries permissions on a given grantee. // Throws: // - ErrInvalidRequest // - `contract_id` is of invalid format. // - ErrInvalidAddress // - `grantee` is of invalid format. - rpc GranteeGrants(QueryGranteeGrantsRequest) returns (QueryGranteeGrantsResponse) { - option (google.api.http).get = "/lbm/token/v1/token_classes/{contract_id}/grants/{grantee}"; + rpc GrantsByGrantee(QueryGrantsByGranteeRequest) returns (QueryGrantsByGranteeResponse) { + option (google.api.http).get = "/lbm/token/v1/contracts/{contract_id}/grants_by_grantee/{grantee}"; } // Approved queries authorization on a given proxy approver pair. @@ -84,7 +84,7 @@ service Query { // - `proxy` is of invalid format. // - `approver` is of invalid format. rpc Approved(QueryApprovedRequest) returns (QueryApprovedResponse) { - option (google.api.http).get = "/lbm/token/v1/token_classes/{contract_id}/accounts/{approver}/proxies/{proxy}"; + option (google.api.http).get = "/lbm/token/v1/contracts/{contract_id}/accounts/{approver}/proxies/{proxy}"; } // Approvers queries approvers on a given proxy. @@ -94,7 +94,7 @@ service Query { // - ErrInvalidAddress // - `proxy` is of invalid format. rpc Approvers(QueryApproversRequest) returns (QueryApproversResponse) { - option (google.api.http).get = "/lbm/token/v1/token_classes/{contract_id}/accounts/{address}/approvers"; + option (google.api.http).get = "/lbm/token/v1/contracts/{contract_id}/accounts/{address}/approvers"; } } @@ -148,33 +148,33 @@ message QueryBurntResponse { string amount = 1 [(gogoproto.customtype) = "github.com/line/lbm-sdk/types.Int", (gogoproto.nullable) = false]; } -// QueryTokenClassRequest is the request type for the Query/TokenClass RPC method -message QueryTokenClassRequest { +// QueryContractRequest is the request type for the Query/Contract RPC method +message QueryContractRequest { // contract id associated with the token class. string contract_id = 1; } -// QueryTokenClassResponse is the response type for the Query/TokenClass RPC method -message QueryTokenClassResponse { - TokenClass class = 1 [(gogoproto.nullable) = false]; +// QueryContractResponse is the response type for the Query/Contract RPC method +message QueryContractResponse { + Contract contract = 1 [(gogoproto.nullable) = false]; } -// QueryTokenClassesRequest is the request type for the Query/TokenClasses RPC method -message QueryTokenClassesRequest { +// QueryContractsRequest is the request type for the Query/Contracts RPC method +message QueryContractsRequest { // pagination defines an optional pagination for the request. cosmos.base.query.v1beta1.PageRequest pagination = 1; } -// QueryTokenClassesResponse is the response type for the Query/TokenClasses RPC method -message QueryTokenClassesResponse { +// QueryContractsResponse is the response type for the Query/Contracts RPC method +message QueryContractsResponse { // information of the token classes. - repeated TokenClass classes = 1 [(gogoproto.nullable) = false]; + repeated Contract contracts = 1 [(gogoproto.nullable) = false]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; } -// QueryGranteeGrantsRequest is the request type for the Query/GranteeGrants RPC method -message QueryGranteeGrantsRequest { +// QueryGrantsByGranteeRequest is the request type for the Query/GrantsByGrantee RPC method +message QueryGrantsByGranteeRequest { // contract id associated with the token class. string contract_id = 1; // grantee which has permissions on the token class. @@ -184,8 +184,8 @@ message QueryGranteeGrantsRequest { cosmos.base.query.v1beta1.PageRequest pagination = 3; } -// QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method -message QueryGranteeGrantsResponse { +// QueryGrantsByGranteeResponse is the response type for the Query/GrantsByGrantee RPC method +message QueryGrantsByGranteeResponse { // all the grants on the grantee. repeated Grant grants = 1 [(gogoproto.nullable) = false]; // pagination defines the pagination in the response. diff --git a/proto/lbm/token/v1/token.proto b/proto/lbm/token/v1/token.proto index e4d51f9f7e..d1d75b5e89 100644 --- a/proto/lbm/token/v1/token.proto +++ b/proto/lbm/token/v1/token.proto @@ -10,16 +10,16 @@ import "gogoproto/gogo.proto"; // Params defines the parameters for the token module. message Params {} -// TokenClass defines token information. -message TokenClass { - // contract_id defines the unique identifier of the token class. - string contract_id = 1; +// Contract defines token information. +message Contract { + // id defines the unique identifier of the token class. + string id = 1; // name defines the human-readable name of the token class. mandatory (not ERC20 compliant). string name = 2; // symbol is an abbreviated name for token class. mandatory (not ERC20 compliant). string symbol = 3; - // image_uri is an uri for the image of the token class stored off chain. - string image_uri = 4; + // uri for the resource of the token class stored off chain. + string uri = 4; // meta is a brief description of token class. string meta = 5; // decimals is the number of decimals which one must divide the amount by to get its user representation. @@ -28,9 +28,9 @@ message TokenClass { bool mintable = 7; } -// Pair defines a key-value pair. -message Pair { - string field = 1; +// Attribute defines a key-value pair. +message Attribute { + string key = 1; string value = 2; } diff --git a/proto/lbm/token/v1/tx.proto b/proto/lbm/token/v1/tx.proto index d572080064..2d7609e4cd 100644 --- a/proto/lbm/token/v1/tx.proto +++ b/proto/lbm/token/v1/tx.proto @@ -20,7 +20,7 @@ service Msg { // - the balance of `from` does not have enough tokens to spend. rpc Send(MsgSend) returns (MsgSendResponse); - // TransferFrom defines a method to send tokens from one account to another account by the proxy. + // OperatorSend defines a method to send tokens from one account to another account by the proxy. // Fires: // - EventSent // - transfer_from (deprecated, not typed) @@ -30,7 +30,7 @@ service Msg { // - ErrInvalidRequest: // - the balance of `from` does not have enough tokens to spend. // Note: the approval has no value of limit (not ERC20 compliant). - rpc TransferFrom(MsgTransferFrom) returns (MsgTransferFromResponse); + rpc OperatorSend(MsgOperatorSend) returns (MsgOperatorSendResponse); // RevokeOperator revoke the authorization of the operator to send the holder's tokens. // Fires: @@ -43,7 +43,7 @@ service Msg { // Since: 0.46.0 (finschia) rpc RevokeOperator(MsgRevokeOperator) returns (MsgRevokeOperatorResponse); - // Approve allows one to send tokens on behalf of the approver. + // AuthorizeOperator allows one to send tokens on behalf of the approver. // Fires: // - EventAuthorizedOperator // - approve_token (deprecated, not typed) @@ -52,17 +52,17 @@ service Msg { // - there is no token class of `contract_id`. // - ErrInvalidRequest: // - `approver` has already authorized `proxy`. - rpc Approve(MsgApprove) returns (MsgApproveResponse); + rpc AuthorizeOperator(MsgAuthorizeOperator) returns (MsgAuthorizeOperatorResponse); - // Issue defines a method to create a class of token. + // CreateContract defines a method to create a class of token. // it grants `mint`, `burn` and `modify` permissions on the token class to its creator (see also `mintable`). // Fires: - // - EventIssue + // - EventCreateContract // - EventMinted // - issue (deprecated, not typed) - rpc Issue(MsgIssue) returns (MsgIssueResponse); + rpc CreateContract(MsgCreateContract) returns (MsgCreateContractResponse); - // GrantPermission allows one to mint or burn tokens or modify a token metadata. + // Grant allows one to mint or burn tokens or modify a token metadata. // Fires: // - EventGrant // - grant_perm (deprecated, not typed) @@ -71,16 +71,16 @@ service Msg { // - `granter` does not have `permission`. // - ErrInvalidRequest // - `grantee` already has `permission`. - rpc GrantPermission(MsgGrantPermission) returns (MsgGrantPermissionResponse); + rpc Grant(MsgGrant) returns (MsgGrantResponse); - // RevokePermission abandons a permission. + // Renounce abandons a permission. // Fires: // - EventAbandon // - revoke_perm (deprecated, not typed) // Throws: // - ErrUnauthorized // - `grantee` does not have `permission`. - rpc RevokePermission(MsgRevokePermission) returns (MsgRevokePermissionResponse); + rpc Renounce(MsgRenounce) returns (MsgRenounceResponse); // Mint defines a method to mint tokens. // Fires: @@ -102,7 +102,7 @@ service Msg { // - the balance of `from` does not have enough tokens to burn. rpc Burn(MsgBurn) returns (MsgBurnResponse); - // BurnFrom defines a method to burn tokens by the proxy. + // OperatorBurn defines a method to burn tokens by the proxy. // Fires: // - EventBurned // - burn_from (deprecated, not typed) @@ -112,9 +112,9 @@ service Msg { // - the approver has not authorized `proxy`. // - ErrInvalidRequest: // - the balance of `from` does not have enough tokens to burn. - rpc BurnFrom(MsgBurnFrom) returns (MsgBurnFromResponse); + rpc OperatorBurn(MsgOperatorBurn) returns (MsgOperatorBurnResponse); - // Modify defines a method to modify a token class. + // ModifyContract defines a method to modify a token class. // Fires: // - EventModified // - modify_token (deprecated, not typed) @@ -123,7 +123,7 @@ service Msg { // - the proxy does not have `modify` permission. // - ErrNotFound // - there is no token class of `contract_id`. - rpc Modify(MsgModify) returns (MsgModifyResponse); + rpc ModifyContract(MsgModifyContract) returns (MsgModifyContractResponse); } // MsgSend defines the Msg/Send request type. @@ -151,7 +151,7 @@ message MsgSend { // MsgSendResponse defines the Msg/Send response type. message MsgSendResponse {} -// MsgTransferFrom defines the Msg/TransferFrom request type. +// MsgOperatorSend defines the Msg/OperatorSend request type. // Throws: // - ErrInvalidAddress // - `proxy` is of invalid format. @@ -162,11 +162,11 @@ message MsgSendResponse {} // - `amount` is not positive. // // Signer: `proxy` -message MsgTransferFrom { +message MsgOperatorSend { // contract id associated with the token class. string contract_id = 1; // the address of the proxy. - string proxy = 2; + string operator = 2; // the address which the transfer is from. string from = 3; // the address which the transfer is to. @@ -175,8 +175,8 @@ message MsgTransferFrom { string amount = 5 [(gogoproto.customtype) = "github.com/line/lbm-sdk/types.Int", (gogoproto.nullable) = false]; } -// MsgTransferFromResponse defines the Msg/TransferFrom response type. -message MsgTransferFromResponse {} +// MsgOperatorSendResponse defines the Msg/OperatorSend response type. +message MsgOperatorSendResponse {} // MsgRevokeOperator defines the Msg/RevokeOperator request type. // @@ -204,7 +204,7 @@ message MsgRevokeOperator { // Since: 0.46.0 (finschia) message MsgRevokeOperatorResponse {} -// MsgApprove defines the Msg/Approve request type. +// MsgAuthorizeOperator defines the Msg/AuthorizeOperator request type. // // Throws: // - ErrInvalidAddress @@ -214,19 +214,19 @@ message MsgRevokeOperatorResponse {} // - `contract_id` is of invalid format. // // Signer: `approver` -message MsgApprove { +message MsgAuthorizeOperator { // contract id associated with the token class. string contract_id = 1; // address of the token approver which approves the authorization. - string approver = 2; + string holder = 2; // address of the proxy which the authorization is granted to. - string proxy = 3; + string operator = 3; } -// MsgApproveResponse defines the Msg/Approve response type. -message MsgApproveResponse {} +// MsgAuthorizeOperatorResponse defines the Msg/AuthorizeOperator response type. +message MsgAuthorizeOperatorResponse {} -// MsgIssue defines the Msg/Issue request type. +// MsgCreateContract defines the Msg/CreateContract request type. // // Throws: // - ErrInvalidAddress @@ -242,13 +242,13 @@ message MsgApproveResponse {} // - `amount` is not positive. // // Signer: `owner` -message MsgIssue { +message MsgCreateContract { // name defines the human-readable name of the token class. mandatory (not ERC20 compliant). string name = 1; // symbol is an abbreviated name for token class. mandatory (not ERC20 compliant). string symbol = 2; - // image_uri is an uri for the image of the token class stored off chain. - string image_uri = 3; + // uri for the resource of the token class stored off chain. + string uri = 3; // meta is a brief description of token class. string meta = 4; // decimals is the number of decimals which one must divide the amount by to get its user representation. @@ -257,7 +257,7 @@ message MsgIssue { bool mintable = 6; // the address which all permissions on the token class will be granted to (not a permanent property). - string owner = 7; + string creator = 7; // the address to send the minted token to. mandatory. string to = 8; @@ -265,13 +265,13 @@ message MsgIssue { string amount = 9 [(gogoproto.customtype) = "github.com/line/lbm-sdk/types.Int", (gogoproto.nullable) = false]; } -// MsgIssueResponse defines the Msg/Issue response type. -message MsgIssueResponse { +// MsgCreateContractResponse defines the Msg/CreateContract response type. +message MsgCreateContractResponse { // id of the new token class. - string id = 1; + string contract_id = 1; } -// MsgGrantPermission defines the Msg/GrantPermission request type. +// MsgGrant defines the Msg/Grant request type. // // Throws: // - ErrInvalidAddress @@ -282,21 +282,21 @@ message MsgIssueResponse { // - `permission` is not a valid permission. // // Signer: `granter` -message MsgGrantPermission { +message MsgGrant { // contract id associated with the token class. string contract_id = 1; // address of the granter which must have the permission to give. - string from = 2; + string granter = 2; // address of the grantee. - string to = 3; + string grantee = 3; // permission on the token class. string permission = 4; } -// MsgGrantPermissionResponse defines the Msg/GrantPermission response type. -message MsgGrantPermissionResponse {} +// MsgGrantResponse defines the Msg/Grant response type. +message MsgGrantResponse {} -// MsgRevokePermission defines the Msg/RevokePermission request type. +// MsgRenounce defines the Msg/Renounce request type. // // Throws: // - ErrInvalidAddress @@ -306,17 +306,17 @@ message MsgGrantPermissionResponse {} // - `permission` is not a valid permission. // // Signer: `grantee` -message MsgRevokePermission { +message MsgRenounce { // contract id associated with the token class. string contract_id = 1; // address of the grantee which abandons the permission. - string from = 2; + string grantee = 2; // permission on the token class. string permission = 3; } -// MsgRevokePermissionResponse defines the Msg/RevokePermission response type. -message MsgRevokePermissionResponse {} +// MsgRenounceResponse defines the Msg/Renounce response type. +message MsgRenounceResponse {} // MsgMint defines the Msg/Mint request type. // @@ -333,7 +333,7 @@ message MsgMint { // contract id associated with the token class. string contract_id = 1; // address which triggers the mint. - string from = 2; + string operator = 2; // recipient of the tokens. string to = 3; // number of tokens to mint. @@ -365,7 +365,7 @@ message MsgBurn { // MsgBurnResponse defines the Msg/Burn response type. message MsgBurnResponse {} -// MsgBurnFrom defines the Msg/BurnFrom request type. +// MsgOperatorBurn defines the Msg/OperatorBurn request type. // // Throws: // - ErrInvalidAddress @@ -376,21 +376,21 @@ message MsgBurnResponse {} // - `amount` is not positive. // // Signer: `proxy` -message MsgBurnFrom { +message MsgOperatorBurn { // contract id associated with the token class. string contract_id = 1; // address which triggers the burn. - string proxy = 2; + string operator = 2; // address which the tokens will be burnt from. string from = 3; // the amount of the burn. string amount = 4 [(gogoproto.customtype) = "github.com/line/lbm-sdk/types.Int", (gogoproto.nullable) = false]; } -// MsgBurnFromResponse defines the Msg/BurnFrom response type. -message MsgBurnFromResponse {} +// MsgOperatorBurnResponse defines the Msg/OperatorBurn response type. +message MsgOperatorBurnResponse {} -// MsgModify defines the Msg/Modify request type. +// MsgModifyContract defines the Msg/ModifyContract request type. // // Throws: // - ErrInvalidAddress @@ -402,14 +402,15 @@ message MsgBurnFromResponse {} // - `changes` is empty. // // Signer: `owner` -message MsgModify { +message MsgModifyContract { // contract id associated with the contract. string contract_id = 1; // the address of the grantee which must have modify permission. - string owner = 2; + string operator = 2; // changes to apply. - repeated Pair changes = 3 [(gogoproto.nullable) = false]; + // possible keys: name, uri, meta + repeated Attribute changes = 3 [(gogoproto.nullable) = false]; } -// MsgModifyResponse defines the Msg/Modify response type. -message MsgModifyResponse {} +// MsgModifyContractResponse defines the Msg/ModifyContract response type. +message MsgModifyContractResponse {}