From 34dae59e5538162c712463173c6f0eb2e9562330 Mon Sep 17 00:00:00 2001 From: Marri Harish Date: Sat, 28 Oct 2023 13:14:54 +0530 Subject: [PATCH] feat: migrate onft to use x/nft base structure and keepers (#107) * add onft proto files * add generated types * add onft types and keys * feat: add onft module as native module (x/onft) * fix issues with onft module integration * lint * update nft builder file * fix event issues * fix lint issues * fix lint & simulation issues * update lint config * lint * update linter verison * update golint config --- .github/workflows/build.yml | 2 +- .github/workflows/lint.yml | 6 +- .golangci.yml | 8 +- app/keepers/keepers.go | 4 +- app/keepers/keys.go | 2 +- app/modules.go | 7 +- app/upgrades/v2/upgrades.go | 2 +- go.mod | 3 +- go.sum | 2 - proto/OmniFlix/itc/v1/itc.proto | 1 + proto/OmniFlix/onft/v1beta1/genesis.proto | 13 + proto/OmniFlix/onft/v1beta1/onft.proto | 124 + proto/OmniFlix/onft/v1beta1/params.proto | 18 + proto/OmniFlix/onft/v1beta1/query.proto | 126 + proto/OmniFlix/onft/v1beta1/tx.proto | 145 + readme.md | 4 +- scripts/protoc_swagger_openapi_gen.sh | 6 - x/itc/keeper/campaign.go | 19 +- x/itc/keeper/keeper_test.go | 13 +- x/itc/keeper/msg_server_test.go | 2 +- x/itc/types/expected_keepers.go | 27 +- x/itc/types/itc.pb.go | 199 +- x/itc/types/msgs.go | 2 +- x/marketplace/keeper/auction.go | 2 +- x/marketplace/keeper/keeper.go | 2 +- x/marketplace/types/expected_keepers.go | 8 +- x/onft/README.md | 274 ++ x/onft/client/cli/flags.go | 67 + x/onft/client/cli/query.go | 299 ++ x/onft/client/cli/tx.go | 444 ++ x/onft/exported/onft.go | 37 + x/onft/genesis.go | 34 + x/onft/keeper/alias.go | 12 + x/onft/keeper/collection.go | 90 + x/onft/keeper/denom.go | 224 + x/onft/keeper/events.go | 78 + x/onft/keeper/grpc_query.go | 284 ++ x/onft/keeper/keeper.go | 63 + x/onft/keeper/migrator.go | 28 + x/onft/keeper/msg_server.go | 207 + x/onft/keeper/onft.go | 226 + x/onft/keeper/pagination.go | 39 + x/onft/keeper/params.go | 35 + x/onft/migrations/v2/expected_keepers.go | 22 + x/onft/migrations/v2/keeper.go | 184 + x/onft/migrations/v2/keys.go | 102 + x/onft/migrations/v2/migrate.go | 46 + x/onft/migrations/v2/migrator_test.go | 45 + x/onft/migrations/v2/store.go | 132 + x/onft/module.go | 166 + x/onft/simulation/decoder.go | 38 + x/onft/simulation/genesis.go | 103 + x/onft/simulation/operations.go | 466 ++ x/onft/types/builder.go | 347 ++ x/onft/types/codec.go | 65 + x/onft/types/collection.go | 26 + x/onft/types/constants.go | 14 + x/onft/types/denom.go | 17 + x/onft/types/errors.go | 34 + x/onft/types/events.go | 24 + x/onft/types/expected_keepers.go | 26 + x/onft/types/genesis.go | 68 + x/onft/types/genesis.pb.go | 388 ++ x/onft/types/keys.go | 146 + x/onft/types/msgs.go | 353 ++ x/onft/types/onft.go | 108 + x/onft/types/onft.pb.go | 3383 +++++++++++++++ x/onft/types/params.go | 46 + x/onft/types/params.pb.go | 322 ++ x/onft/types/params_legacy.go | 21 + x/onft/types/query.pb.go | 4082 ++++++++++++++++++ x/onft/types/query.pb.gw.go | 1059 +++++ x/onft/types/tx.pb.go | 4073 +++++++++++++++++ x/onft/types/utils.go | 22 + x/onft/types/validations.go | 126 + x/tokenfactory/types/authorityMetadata.pb.go | 14 +- x/tokenfactory/types/genesis.pb.go | 50 +- x/tokenfactory/types/params.pb.go | 48 +- x/tokenfactory/types/query.pb.go | 75 +- x/tokenfactory/types/tx.pb.go | 107 +- 80 files changed, 19261 insertions(+), 275 deletions(-) create mode 100644 proto/OmniFlix/onft/v1beta1/genesis.proto create mode 100644 proto/OmniFlix/onft/v1beta1/onft.proto create mode 100644 proto/OmniFlix/onft/v1beta1/params.proto create mode 100644 proto/OmniFlix/onft/v1beta1/query.proto create mode 100644 proto/OmniFlix/onft/v1beta1/tx.proto create mode 100644 x/onft/README.md create mode 100644 x/onft/client/cli/flags.go create mode 100644 x/onft/client/cli/query.go create mode 100644 x/onft/client/cli/tx.go create mode 100644 x/onft/exported/onft.go create mode 100644 x/onft/genesis.go create mode 100644 x/onft/keeper/alias.go create mode 100644 x/onft/keeper/collection.go create mode 100644 x/onft/keeper/denom.go create mode 100644 x/onft/keeper/events.go create mode 100644 x/onft/keeper/grpc_query.go create mode 100644 x/onft/keeper/keeper.go create mode 100644 x/onft/keeper/migrator.go create mode 100644 x/onft/keeper/msg_server.go create mode 100644 x/onft/keeper/onft.go create mode 100644 x/onft/keeper/pagination.go create mode 100644 x/onft/keeper/params.go create mode 100644 x/onft/migrations/v2/expected_keepers.go create mode 100644 x/onft/migrations/v2/keeper.go create mode 100644 x/onft/migrations/v2/keys.go create mode 100644 x/onft/migrations/v2/migrate.go create mode 100644 x/onft/migrations/v2/migrator_test.go create mode 100644 x/onft/migrations/v2/store.go create mode 100644 x/onft/module.go create mode 100644 x/onft/simulation/decoder.go create mode 100644 x/onft/simulation/genesis.go create mode 100644 x/onft/simulation/operations.go create mode 100644 x/onft/types/builder.go create mode 100644 x/onft/types/codec.go create mode 100644 x/onft/types/collection.go create mode 100644 x/onft/types/constants.go create mode 100644 x/onft/types/denom.go create mode 100644 x/onft/types/errors.go create mode 100644 x/onft/types/events.go create mode 100644 x/onft/types/expected_keepers.go create mode 100644 x/onft/types/genesis.go create mode 100644 x/onft/types/genesis.pb.go create mode 100644 x/onft/types/keys.go create mode 100644 x/onft/types/msgs.go create mode 100644 x/onft/types/onft.go create mode 100644 x/onft/types/onft.pb.go create mode 100644 x/onft/types/params.go create mode 100644 x/onft/types/params.pb.go create mode 100644 x/onft/types/params_legacy.go create mode 100644 x/onft/types/query.pb.go create mode 100644 x/onft/types/query.pb.gw.go create mode 100644 x/onft/types/tx.pb.go create mode 100644 x/onft/types/utils.go create mode 100644 x/onft/types/validations.go diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 11545427..ac6b38af 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ on: workflow_dispatch: env: - GO_VERSION: "1.20.5" + GO_VERSION: "1.21.3" concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2b150a81..99289db5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,7 +11,7 @@ on: - '**.go' env: - GO_VERSION: '1.20.0' + GO_VERSION: '1.21.3' permissions: contents: read @@ -26,10 +26,10 @@ jobs: name: lint runs-on: ubuntu-latest steps: - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v4 with: go-version: ${{env.GO_VERSION}} - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: diff --git a/.golangci.yml b/.golangci.yml index 244ce91e..42a4abc5 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -44,6 +44,9 @@ issues: text: "SA1019:" linters: - staticcheck + - path: cli + linters: + - goconst - text: "leading space" linters: - nolintlint @@ -71,6 +74,9 @@ linters-settings: rules: - name: var-naming disabled: true + govet: + excludes: + - SA1019 maligned: # print struct with more effective memory layout or not, false by default suggest-new: true @@ -78,4 +84,4 @@ linters-settings: allow-unused: false allow-leading-space: true require-explanation: false - require-specific: false + require-specific: false \ No newline at end of file diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index 1cd73570..2e20bc56 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -91,8 +91,8 @@ import ( allockeeper "github.com/OmniFlix/omniflixhub/v2/x/alloc/keeper" alloctypes "github.com/OmniFlix/omniflixhub/v2/x/alloc/types" - onftkeeper "github.com/OmniFlix/onft/keeper" - onfttypes "github.com/OmniFlix/onft/types" + onftkeeper "github.com/OmniFlix/omniflixhub/v2/x/onft/keeper" + onfttypes "github.com/OmniFlix/omniflixhub/v2/x/onft/types" marketplacekeeper "github.com/OmniFlix/omniflixhub/v2/x/marketplace/keeper" marketplacetypes "github.com/OmniFlix/omniflixhub/v2/x/marketplace/types" diff --git a/app/keepers/keys.go b/app/keepers/keys.go index 3ba2710c..37aae3f4 100644 --- a/app/keepers/keys.go +++ b/app/keepers/keys.go @@ -5,8 +5,8 @@ import ( globalfeetypes "github.com/OmniFlix/omniflixhub/v2/x/globalfee/types" itctypes "github.com/OmniFlix/omniflixhub/v2/x/itc/types" marketplacetypes "github.com/OmniFlix/omniflixhub/v2/x/marketplace/types" + onfttypes "github.com/OmniFlix/omniflixhub/v2/x/onft/types" tokenfactorytypes "github.com/OmniFlix/omniflixhub/v2/x/tokenfactory/types" - onfttypes "github.com/OmniFlix/onft/types" streampaytypes "github.com/OmniFlix/streampay/v2/x/streampay/types" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/app/modules.go b/app/modules.go index d30367f1..ddf8e2c5 100644 --- a/app/modules.go +++ b/app/modules.go @@ -3,7 +3,6 @@ package app import ( appparams "github.com/OmniFlix/omniflixhub/v2/app/params" "github.com/OmniFlix/omniflixhub/v2/x/globalfee" - "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/auth" authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" @@ -11,6 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/consensus" consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" "github.com/cosmos/cosmos-sdk/x/group" + "github.com/cosmos/cosmos-sdk/x/nft" "github.com/cosmos/cosmos-sdk/x/auth/vesting" vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" @@ -79,8 +79,8 @@ import ( "github.com/OmniFlix/omniflixhub/v2/x/alloc" alloctypes "github.com/OmniFlix/omniflixhub/v2/x/alloc/types" - "github.com/OmniFlix/onft" - onfttypes "github.com/OmniFlix/onft/types" + "github.com/OmniFlix/omniflixhub/v2/x/onft" + onfttypes "github.com/OmniFlix/omniflixhub/v2/x/onft/types" "github.com/OmniFlix/omniflixhub/v2/x/marketplace" marketplacetypes "github.com/OmniFlix/omniflixhub/v2/x/marketplace/types" @@ -144,6 +144,7 @@ var ( tokenfactorytypes.ModuleName: {authtypes.Minter, authtypes.Burner}, globalfee.ModuleName: nil, alloctypes.ModuleName: {authtypes.Minter, authtypes.Burner, authtypes.Staking}, + nft.ModuleName: nil, onfttypes.ModuleName: nil, marketplacetypes.ModuleName: nil, streampaytypes.ModuleName: nil, diff --git a/app/upgrades/v2/upgrades.go b/app/upgrades/v2/upgrades.go index e894ccc4..655021d1 100644 --- a/app/upgrades/v2/upgrades.go +++ b/app/upgrades/v2/upgrades.go @@ -6,8 +6,8 @@ import ( alloctypes "github.com/OmniFlix/omniflixhub/v2/x/alloc/types" itctypes "github.com/OmniFlix/omniflixhub/v2/x/itc/types" marketplacetypes "github.com/OmniFlix/omniflixhub/v2/x/marketplace/types" + onfttypes "github.com/OmniFlix/omniflixhub/v2/x/onft/types" tokenfactorytypes "github.com/OmniFlix/omniflixhub/v2/x/tokenfactory/types" - onfttypes "github.com/OmniFlix/onft/types" streampaytypes "github.com/OmniFlix/streampay/v2/x/streampay/types" "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/go.mod b/go.mod index 7f6a97c6..b96790e1 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,6 @@ module github.com/OmniFlix/omniflixhub/v2 go 1.20 require ( - github.com/OmniFlix/onft v0.6.1-0.20230923181114-30842581416b github.com/OmniFlix/streampay/v2 v2.1.1-0.20230922163133-93e80c4663ef github.com/cometbft/cometbft v0.37.2 github.com/cometbft/cometbft-db v0.8.0 @@ -135,7 +134,7 @@ require ( github.com/mtibben/percent v0.2.1 // indirect github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect - github.com/pkg/errors v0.9.1 // indirect + github.com/pkg/errors v0.9.1 github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.14.0 // indirect github.com/prometheus/client_model v0.3.0 // indirect diff --git a/go.sum b/go.sum index cb6ee536..3676a3f5 100644 --- a/go.sum +++ b/go.sum @@ -227,8 +227,6 @@ github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwS github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= -github.com/OmniFlix/onft v0.6.1-0.20230923181114-30842581416b h1:K59wrzZyVey3GZFfE5VaODw3iIS2+nwxvC/OOTaTkKI= -github.com/OmniFlix/onft v0.6.1-0.20230923181114-30842581416b/go.mod h1:57nDQZxRTJIfyNlu/mGv7nPag5nRt4Si6mAUQCFv90M= github.com/OmniFlix/streampay/v2 v2.1.1-0.20230922163133-93e80c4663ef h1:odIDkcCWx5PTTGM01OgKicnuIx2KaxjNAxrUqdBgtHE= github.com/OmniFlix/streampay/v2 v2.1.1-0.20230922163133-93e80c4663ef/go.mod h1:geZrSHVaGHERqTn1tuFfoH3PIHV5TOwaRErzi4Jnbcw= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= diff --git a/proto/OmniFlix/itc/v1/itc.proto b/proto/OmniFlix/itc/v1/itc.proto index 2d244807..dff1fd20 100644 --- a/proto/OmniFlix/itc/v1/itc.proto +++ b/proto/OmniFlix/itc/v1/itc.proto @@ -108,6 +108,7 @@ message NFTDetails { bool extensible = 8; bool nsfw = 9; string data = 10; + string uri_hash = 11; } message Claim { diff --git a/proto/OmniFlix/onft/v1beta1/genesis.proto b/proto/OmniFlix/onft/v1beta1/genesis.proto new file mode 100644 index 00000000..e05a30ff --- /dev/null +++ b/proto/OmniFlix/onft/v1beta1/genesis.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package OmniFlix.onft.v1beta1; + +import "gogoproto/gogo.proto"; +import "OmniFlix/onft/v1beta1/onft.proto"; +import "OmniFlix/onft/v1beta1/params.proto"; +option go_package = "github.com/OmniFlix/omniflixhub/v2/x/onft/types"; + +// GenesisState defines the nft module's genesis state. +message GenesisState { + repeated Collection collections = 1 [(gogoproto.nullable) = false]; + Params params = 2 [(gogoproto.nullable) = false]; +} diff --git a/proto/OmniFlix/onft/v1beta1/onft.proto b/proto/OmniFlix/onft/v1beta1/onft.proto new file mode 100644 index 00000000..a0b171ab --- /dev/null +++ b/proto/OmniFlix/onft/v1beta1/onft.proto @@ -0,0 +1,124 @@ +syntax = "proto3"; +package OmniFlix.onft.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/OmniFlix/omniflixhub/v2/x/onft/types"; +option (gogoproto.goproto_getters_all) = false; + +// Collection +message Collection { + option (gogoproto.equal) = true; + + Denom denom = 1 [(gogoproto.nullable) = false]; + repeated ONFT onfts = 2 [(gogoproto.customname) = "ONFTs", (gogoproto.nullable) = false]; +} + +message IDCollection { + option (gogoproto.equal) = true; + + string denom_id = 1 [(gogoproto.moretags) = "yaml:\"denom_id\""]; + repeated string onft_ids = 2 [(gogoproto.moretags) = "yaml:\"onft_ids\""]; +} + +message Denom { + option (gogoproto.equal) = true; + + string id = 1; + string symbol = 2; + string name = 3; + string schema = 4; + string creator = 5; + string description = 6; + string preview_uri = 7 [ + (gogoproto.moretags) = "yaml:\"preview_uri\"", + (gogoproto.customname) = "PreviewURI" + ]; + string uri = 8; + string uri_hash = 9; + string data = 10; +} + +message DenomMetadata { + string creator = 1; + string schema = 2; + string description = 3; + string preview_uri = 4; + string data = 5; + string uri_hash = 6; +} + +//ASSET or ONFT +message ONFT { + option (gogoproto.equal) = true; + + string id = 1; + Metadata metadata = 2 [(gogoproto.nullable) = false]; + string data = 3; + string owner = 4; + bool transferable = 5; + bool extensible = 6; + google.protobuf.Timestamp created_at = 7 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"created_at\"" + ]; + bool nsfw = 8; + string royalty_share = 9 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"royalty_share\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec" + ]; +} + +message Metadata { + option (gogoproto.equal) = true; + + string name = 1 [(gogoproto.moretags) = "yaml:\"name\""]; + string description = 2 [(gogoproto.moretags) = "yaml:\"description\""]; + string media_uri = 3 [ + (gogoproto.moretags) = "yaml:\"media_uri\"", + (gogoproto.customname) = "MediaURI" + ]; + string preview_uri = 4 [ + (gogoproto.moretags) = "yaml:\"preview_uri\"", + (gogoproto.customname) = "PreviewURI" + ]; + string uri_hash = 5; +} + +message ONFTMetadata { + string name = 1; + string description =2; + string preview_uri = 3 [ + (gogoproto.moretags) = "yaml:\"preview_uri\"", + (gogoproto.customname) = "PreviewURI" + ]; + string data = 4; + bool transferable = 5; + bool extensible = 6; + google.protobuf.Timestamp created_at = 7 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"created_at\"" + ]; + bool nsfw = 8; + string royalty_share = 9 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"royalty_share\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec" + ]; + string uri_hash = 10; +} + +message Owner { + option (gogoproto.equal) = true; + + string address = 1; + repeated IDCollection id_collections = 2 [ + (gogoproto.moretags) = "yaml:\"idcs\"", + (gogoproto.customname) = "IDCollections", + (gogoproto.nullable) = false + ]; +} \ No newline at end of file diff --git a/proto/OmniFlix/onft/v1beta1/params.proto b/proto/OmniFlix/onft/v1beta1/params.proto new file mode 100644 index 00000000..384f08da --- /dev/null +++ b/proto/OmniFlix/onft/v1beta1/params.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +package OmniFlix.onft.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/OmniFlix/omniflixhub/v2/x/onft/types"; +option (gogoproto.goproto_getters_all) = false; + + + +message Params { + cosmos.base.v1beta1.Coin denom_creation_fee = 1 [ + (gogoproto.moretags) = "yaml:\"denom_creation_fee\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.nullable) = false + ]; +} \ No newline at end of file diff --git a/proto/OmniFlix/onft/v1beta1/query.proto b/proto/OmniFlix/onft/v1beta1/query.proto new file mode 100644 index 00000000..ded6e10e --- /dev/null +++ b/proto/OmniFlix/onft/v1beta1/query.proto @@ -0,0 +1,126 @@ +syntax = "proto3"; +package OmniFlix.onft.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "OmniFlix/onft/v1beta1/onft.proto"; +import "OmniFlix/onft/v1beta1/params.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; + +option go_package = "github.com/OmniFlix/omniflixhub/v2/x/onft/types"; + +service Query { + rpc Collection(QueryCollectionRequest) returns (QueryCollectionResponse) { + option (google.api.http).get = "/omniflix/onft/v1beta1/collections/{denom_id}"; + } + + rpc IBCCollection(QueryIBCCollectionRequest) returns (QueryCollectionResponse) { + option (google.api.http).get = "/omniflix/onft/v1beta1/collections/ibc/{hash}"; + } + + rpc Denom(QueryDenomRequest) returns (QueryDenomResponse) { + option (google.api.http).get = "/omniflix/onft/v1beta1/denoms/{denom_id}"; + } + + rpc IBCDenom(QueryIBCDenomRequest) returns (QueryDenomResponse) { + option (google.api.http).get = "/omniflix/onft/v1beta1/denoms/ibc/{hash}"; + } + + rpc Denoms(QueryDenomsRequest) returns (QueryDenomsResponse) { + option (google.api.http).get = "/omniflix/onft/v1beta1/denoms"; + } + rpc ONFT(QueryONFTRequest) returns (QueryONFTResponse) { + option (google.api.http).get = "/omniflix/onft/v1beta1/denoms/{denom_id}/onfts/{id}"; + } + rpc OwnerONFTs(QueryOwnerONFTsRequest) returns (QueryOwnerONFTsResponse) { + option (google.api.http).get = "/omniflix/onft/v1beta1/onfts/{denom_id}/{owner}"; + } + rpc Supply(QuerySupplyRequest) returns (QuerySupplyResponse) { + option (google.api.http).get = "/omniflix/onft/v1beta1/denoms/{denom_id}/supply"; + } + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/omniflix/onft/v1beta1/params"; + } +} + +message QueryCollectionRequest { + string denom_id = 1 [(gogoproto.moretags) = "yaml:\"denom_id\""]; + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +message QueryCollectionResponse { + Collection collection = 1; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryIBCCollectionRequest { + string hash = 1 [(gogoproto.moretags) = "yaml:\"hash\""]; + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +message QueryDenomRequest { + string denom_id = 1 [(gogoproto.moretags) = "yaml:\"denom_id\""]; +} + +message QueryDenomResponse { + Denom denom = 1; +} + +message QueryIBCDenomRequest { + string hash = 1 [(gogoproto.moretags) = "yaml:\"hash\""]; +} + +message QueryDenomsRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; + string owner = 2; +} + +message QueryDenomsResponse { + repeated Denom denoms = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryONFTRequest { + string denom_id = 1 [(gogoproto.moretags) = "yaml:\"denom_id\""]; + string id = 2; +} + +message QueryONFTResponse { + ONFT onft = 1 [(gogoproto.customname) = "ONFT"]; +} + + +message QueryOwnerONFTsRequest { + string denom_id = 1 [(gogoproto.moretags) = "yaml:\"denom_id\""]; + string owner = 2; + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +message QueryOwnerONFTsResponse { + Owner owner = 1; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QuerySupplyRequest { + string denom_id = 1 [(gogoproto.moretags) = "yaml:\"denom_id\""]; + string owner = 2; +} + +message QuerySupplyResponse { + uint64 amount = 1; +} + +message OwnerONFTCollection { + Denom denom = 1 [(gogoproto.nullable) = false]; + repeated ONFT onfts = 2 [(gogoproto.nullable) = false]; +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // params defines the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false]; +} \ No newline at end of file diff --git a/proto/OmniFlix/onft/v1beta1/tx.proto b/proto/OmniFlix/onft/v1beta1/tx.proto new file mode 100644 index 00000000..f38a7aad --- /dev/null +++ b/proto/OmniFlix/onft/v1beta1/tx.proto @@ -0,0 +1,145 @@ +syntax = "proto3"; +package OmniFlix.onft.v1beta1; + +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; +import "OmniFlix/onft/v1beta1/params.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; +import "OmniFlix/onft/v1beta1/onft.proto"; + +option go_package = "github.com/OmniFlix/omniflixhub/v2/x/onft/types"; +option (gogoproto.goproto_getters_all) = false; + +service Msg { + rpc CreateDenom(MsgCreateDenom) returns (MsgCreateDenomResponse); + + rpc UpdateDenom(MsgUpdateDenom) returns (MsgUpdateDenomResponse); + + rpc TransferDenom(MsgTransferDenom) returns (MsgTransferDenomResponse); + + rpc MintONFT(MsgMintONFT) returns (MsgMintONFTResponse); + + rpc TransferONFT(MsgTransferONFT) returns (MsgTransferONFTResponse); + + rpc BurnONFT(MsgBurnONFT) returns (MsgBurnONFTResponse); + + // UpdateParams defines a governance operation for updating the onft module + // parameters. The authority is hard-coded to the onft module account. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +message MsgCreateDenom { + option (gogoproto.equal) = true; + + string id = 1; + string symbol = 2; + string name = 3; + string description = 4; + string preview_uri = 5 [ + (gogoproto.moretags) = "yaml:\"preview_uri\"", + (gogoproto.customname) = "PreviewURI" + ]; + string schema = 6; + string sender = 7; + cosmos.base.v1beta1.Coin creation_fee = 8 [ + (gogoproto.moretags) = "yaml:\"creation_fee\"", + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; + string uri = 9; + string uri_hash = 10; + string data = 11; +} + +message MsgCreateDenomResponse {} + +message MsgUpdateDenom { + option (gogoproto.equal) = true; + + string id = 1; + string name = 2; + string description = 3; + string preview_uri = 4 [ + (gogoproto.moretags) = "yaml:\"preview_uri\"", + (gogoproto.customname) = "PreviewURI" + ]; + string sender = 5; +} + +message MsgUpdateDenomResponse {} + +message MsgTransferDenom { + option (gogoproto.equal) = true; + + string id = 1; + string sender = 2; + string recipient = 3; +} + +message MsgTransferDenomResponse {} + +message MsgMintONFT { + option (gogoproto.equal) = true; + + string id = 1; + string denom_id = 2 [(gogoproto.moretags) = "yaml:\"denom_id\""]; + Metadata metadata = 3 [(gogoproto.nullable) = false]; + string data = 4; + bool transferable = 5; + bool extensible = 6; + bool nsfw = 7; + string royalty_share = 8 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"royalty_share\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec" + ]; + string sender = 9; + string recipient = 10; +} + +message MsgMintONFTResponse {} + +message MsgTransferONFT { + option (gogoproto.equal) = true; + + string id = 1; + string denom_id = 2 [(gogoproto.moretags) = "yaml:\"denom_id\""]; + string sender = 3; + string recipient = 4; +} + +message MsgTransferONFTResponse {} + +message MsgBurnONFT { + option (gogoproto.equal) = true; + + string id = 1; + string denom_id = 2 [(gogoproto.moretags) = "yaml:\"denom_id\""]; + string sender = 3; +} + +message MsgBurnONFTResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address of the governance account. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the onft module parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/readme.md b/readme.md index a883e227..53163972 100644 --- a/readme.md +++ b/readme.md @@ -53,8 +53,8 @@ curl https://raw.githubusercontent.com/OmniFlix/mainnet/main/omniflixhub-1/genes - [NodeStake snapshot](https://nodestake.top/omniflix) ### OmniFlix Modules -- [oNFT](https://github.com/OmniFlix/onft) -- [Marketplace](https://github.com/OmniFlix/marketplace) +- [oNFT](https://github.com/OmniFlix/omniflixhub/tree/main/x/onft) +- [Marketplace](https://github.com/OmniFlix/omniflixhub/tree/main/marketplace) - [StreamPay](https://github.com/OmniFlix/streampay) ### Documentation diff --git a/scripts/protoc_swagger_openapi_gen.sh b/scripts/protoc_swagger_openapi_gen.sh index 23f44541..5da90805 100644 --- a/scripts/protoc_swagger_openapi_gen.sh +++ b/scripts/protoc_swagger_openapi_gen.sh @@ -13,8 +13,6 @@ mkdir -p ./tmp-swagger-gen # Get the paths used repos from go/pkg/mod cosmos_sdk_dir=$(go list -f '{{ .Dir }}' -m github.com/cosmos/cosmos-sdk) ibc_go=$(go list -f '{{ .Dir }}' -m github.com/cosmos/ibc-go/v7) -onft=$(go list -f '{{ .Dir }}' -m github.com/OmniFlix/onft) -marketplace=$(go list -f '{{ .Dir }}' -m github.com/OmniFlix/marketplace) streampay=$(go list -f '{{ .Dir }}' -m github.com/OmniFlix/streampay) @@ -59,10 +57,6 @@ for f in $files; do cp $f ./tmp-swagger-gen/_all/cosmos-$counter.json elif [[ "$f" =~ "omniflix" ]]; then cp $f ./tmp-swagger-gen/_all/omniflix-$counter.json - elif [[ "$f" =~ "onft" ]]; then - cp $f ./tmp-swagger-gen/_all/onft-$counter.json - elif [[ "$f" =~ "marketplace" ]]; then - cp $f ./tmp-swagger-gen/_all/marketplace-$counter.json elif [[ "$f" =~ "streampay" ]]; then cp $f ./tmp-swagger-gen/_all/streampay-$counter.json else diff --git a/x/itc/keeper/campaign.go b/x/itc/keeper/campaign.go index 6b6b4a8b..67928207 100644 --- a/x/itc/keeper/campaign.go +++ b/x/itc/keeper/campaign.go @@ -7,7 +7,7 @@ import ( errorsmod "cosmossdk.io/errors" "github.com/OmniFlix/omniflixhub/v2/x/itc/types" - nfttypes "github.com/OmniFlix/onft/types" + nfttypes "github.com/OmniFlix/omniflixhub/v2/x/onft/types" streampaytypes "github.com/OmniFlix/streampay/v2/x/streampay/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -20,7 +20,7 @@ func (k Keeper) CreateCampaign( campaign types.Campaign, creationFee sdk.Coin, ) error { - _, err := k.nftKeeper.GetDenom(ctx, campaign.NftDenomId) + _, err := k.nftKeeper.GetDenomInfo(ctx, campaign.NftDenomId) if err != nil { return err } @@ -37,7 +37,7 @@ func (k Keeper) CreateCampaign( if campaign.ClaimType == types.CLAIM_TYPE_NFT || campaign.ClaimType == types.CLAIM_TYPE_FT_AND_NFT { // check if the mint collection exists - mintCollection, err := k.nftKeeper.GetDenom(ctx, campaign.NftMintDetails.DenomId) + mintCollection, err := k.nftKeeper.GetDenomInfo(ctx, campaign.NftMintDetails.DenomId) if err != nil { return err } @@ -198,18 +198,17 @@ func (k Keeper) Claim(ctx sdk.Context, campaign types.Campaign, claimer sdk.AccA ctx, campaign.NftMintDetails.DenomId, generateClaimNftId(ctx, campaign.Id, campaign.MintCount), - nfttypes.Metadata{ - Name: campaign.NftMintDetails.Name + fmt.Sprintf("%d", campaign.MintCount), - Description: campaign.NftMintDetails.Description, - MediaURI: campaign.NftMintDetails.MediaUri, - PreviewURI: campaign.NftMintDetails.PreviewUri, - }, + campaign.NftMintDetails.Name+fmt.Sprintf("%d", campaign.MintCount), + campaign.NftMintDetails.Description, + campaign.NftMintDetails.MediaUri, + campaign.NftMintDetails.UriHash, + campaign.NftMintDetails.PreviewUri, campaign.NftMintDetails.Data, + ctx.BlockTime().UTC(), campaign.NftMintDetails.Transferable, campaign.NftMintDetails.Extensible, campaign.NftMintDetails.Nsfw, campaign.NftMintDetails.RoyaltyShare, - campaign.GetCreator(), claimer, ); err != nil { return errorsmod.Wrapf(types.ErrClaimingNFT, diff --git a/x/itc/keeper/keeper_test.go b/x/itc/keeper/keeper_test.go index 4bbd0435..60444cde 100644 --- a/x/itc/keeper/keeper_test.go +++ b/x/itc/keeper/keeper_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - onftkeeper "github.com/OmniFlix/onft/keeper" - onfttypes "github.com/OmniFlix/onft/types" + onftkeeper "github.com/OmniFlix/omniflixhub/v2/x/onft/keeper" + onfttypes "github.com/OmniFlix/omniflixhub/v2/x/onft/types" "github.com/OmniFlix/omniflixhub/v2/app/apptesting" "github.com/OmniFlix/omniflixhub/v2/x/itc/keeper" @@ -135,7 +135,10 @@ func (suite *KeeperTestSuite) createDefaultNftDenom() { "test11", "{}", "test description", + "ipfs://testuri", + "ipfs://testUriHash", "ipfs://testpreviewuri", + "", suite.TestAccs[0].String(), onfttypes.DefaultDenomCreationFee, ) @@ -153,7 +156,10 @@ func (suite *KeeperTestSuite) createSecondaryNftDenom() { "test12", "{}", "test description", + "ipfs://testuri", + "ipfs://testUriHash", "ipfs://testpreviewuri", + "", suite.TestAccs[0].String(), onfttypes.DefaultDenomCreationFee, ) @@ -171,7 +177,10 @@ func (suite *KeeperTestSuite) createDefaultMintNftDenom() { "test22", "{}", "test description", + "ipfs://testuri", + "ipfs://testUriHash", "ipfs://testpreviewuri", + "", suite.TestAccs[0].String(), onfttypes.DefaultDenomCreationFee, ) diff --git a/x/itc/keeper/msg_server_test.go b/x/itc/keeper/msg_server_test.go index 04619786..9aa001ed 100644 --- a/x/itc/keeper/msg_server_test.go +++ b/x/itc/keeper/msg_server_test.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - onfttypes "github.com/OmniFlix/onft/types" + onfttypes "github.com/OmniFlix/omniflixhub/v2/x/onft/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/OmniFlix/omniflixhub/v2/x/itc/types" diff --git a/x/itc/types/expected_keepers.go b/x/itc/types/expected_keepers.go index 58c48873..cc7ee076 100644 --- a/x/itc/types/expected_keepers.go +++ b/x/itc/types/expected_keepers.go @@ -3,8 +3,8 @@ package types import ( "time" - nft "github.com/OmniFlix/onft/exported" - nfttypes "github.com/OmniFlix/onft/types" + nft "github.com/OmniFlix/omniflixhub/v2/x/onft/exported" + nfttypes "github.com/OmniFlix/omniflixhub/v2/x/onft/types" streampaytypes "github.com/OmniFlix/streampay/v2/x/streampay/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -29,12 +29,23 @@ type BankKeeper interface { // NftKeeper defines the expected nft keeper type NftKeeper interface { GetONFT(ctx sdk.Context, denomId, onftId string) (nft nft.ONFTI, err error) - GetDenom(ctx sdk.Context, denomId string) (nfttypes.Denom, error) - MintONFT(ctx sdk.Context, - denomID, onftID string, - metadata nfttypes.Metadata, data string, - transferable, extensible, nsfw bool, - royaltyShare sdk.Dec, sender, recipient sdk.AccAddress, + GetDenomInfo(ctx sdk.Context, denomId string) (*nfttypes.Denom, error) + MintONFT( + ctx sdk.Context, + denomID, + nftID, + name, + description, + mediaURI, + uriHash, + previewURI, + nftData string, + createdAt time.Time, + transferable, + extensible, + nsfw bool, + royaltyShare sdk.Dec, + receiver sdk.AccAddress, ) error TransferOwnership(ctx sdk.Context, denomId, nftId string, srcOwner, dstOwner sdk.AccAddress) error BurnONFT(ctx sdk.Context, denomId, nftId string, owner sdk.AccAddress) error diff --git a/x/itc/types/itc.pb.go b/x/itc/types/itc.pb.go index b2b7eebd..0c4eae76 100644 --- a/x/itc/types/itc.pb.go +++ b/x/itc/types/itc.pb.go @@ -242,6 +242,7 @@ type NFTDetails struct { Extensible bool `protobuf:"varint,8,opt,name=extensible,proto3" json:"extensible,omitempty"` Nsfw bool `protobuf:"varint,9,opt,name=nsfw,proto3" json:"nsfw,omitempty"` Data string `protobuf:"bytes,10,opt,name=data,proto3" json:"data,omitempty"` + UriHash string `protobuf:"bytes,11,opt,name=uri_hash,json=uriHash,proto3" json:"uri_hash,omitempty"` } func (m *NFTDetails) Reset() { *m = NFTDetails{} } @@ -331,83 +332,84 @@ func init() { func init() { proto.RegisterFile("OmniFlix/itc/v1/itc.proto", fileDescriptor_bab9913014645745) } var fileDescriptor_bab9913014645745 = []byte{ - // 1202 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcd, 0x6e, 0xdb, 0xc6, - 0x16, 0x16, 0x15, 0x3b, 0x91, 0x8e, 0x14, 0x59, 0x99, 0xfc, 0xd1, 0xf6, 0xb5, 0xa4, 0xcb, 0xc5, - 0x85, 0x61, 0xe0, 0x52, 0x70, 0xee, 0x2d, 0x8a, 0x74, 0xa7, 0xdf, 0x96, 0x68, 0x4c, 0x1b, 0x23, - 0xba, 0x68, 0xb2, 0x21, 0x46, 0xe4, 0xc8, 0x19, 0x58, 0x24, 0x05, 0x72, 0xa4, 0xd8, 0x6f, 0x11, - 0xa0, 0x9b, 0x6e, 0xfa, 0x28, 0xdd, 0x67, 0x99, 0x65, 0xd1, 0x85, 0xda, 0x24, 0x6f, 0x60, 0xf4, - 0x01, 0x8a, 0x99, 0x21, 0x2d, 0x46, 0x2e, 0x1a, 0x34, 0x2b, 0xcd, 0xf9, 0xfb, 0xce, 0x99, 0xa3, - 0x8f, 0x1f, 0x09, 0xdb, 0xc7, 0x41, 0xc8, 0x86, 0x53, 0x76, 0xd1, 0x66, 0xdc, 0x6b, 0x2f, 0x0e, - 0xc5, 0x8f, 0x39, 0x8b,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 0x2b, 0xbf, 0x39, 0x7e, 0xd6, 0xaf, 0x17, 0x0f, 0xce, 0xa1, 0x96, 0x7d, 0x24, - 0x8c, 0x38, 0xe1, 0xf3, 0x04, 0x35, 0x61, 0xb7, 0xd7, 0x39, 0x3a, 0xe9, 0x58, 0x5f, 0xdb, 0xee, - 0xc8, 0xe9, 0x38, 0xa7, 0x23, 0xf7, 0xd4, 0x1e, 0x9d, 0x0c, 0x7a, 0xd6, 0xd0, 0x1a, 0xf4, 0xd5, - 0xe0, 0xeb, 0x09, 0x96, 0x2d, 0xa0, 0xbf, 0x1b, 0xd4, 0x35, 0xb4, 0x03, 0x8f, 0xd6, 0xa3, 0x69, - 0xac, 0x78, 0x70, 0x04, 0xe5, 0xeb, 0x17, 0x11, 0xba, 0x07, 0x77, 0x7b, 0xcf, 0x3a, 0xd6, 0x91, - 0x1a, 0x67, 0x28, 0x56, 0x82, 0xa0, 0x96, 0x73, 0xd9, 0x43, 0x47, 0xcd, 0xfe, 0x51, 0x9a, 0xdb, - 0xb1, 0xfb, 0x32, 0x54, 0xec, 0x9e, 0xbc, 0x79, 0xd7, 0x28, 0xbc, 0x7d, 0xd7, 0x28, 0xbc, 0x79, - 0xdf, 0xd0, 0xde, 0xbe, 0x6f, 0x68, 0xbf, 0xbf, 0x6f, 0x68, 0xaf, 0x3f, 0x34, 0x0a, 0x6f, 0x3f, - 0x34, 0x0a, 0xbf, 0x7c, 0x68, 0x14, 0x5e, 0x98, 0x39, 0xc2, 0x5f, 0x7f, 0xb1, 0x45, 0x41, 0xc8, - 0x26, 0x53, 0x76, 0xf1, 0x72, 0x3e, 0x6e, 0x2f, 0x9e, 0xb4, 0xd5, 0x27, 0x9c, 0x24, 0xff, 0xf8, - 0xb6, 0x94, 0x82, 0xff, 0xfd, 0x19, 0x00, 0x00, 0xff, 0xff, 0x88, 0x71, 0x04, 0x22, 0xdf, 0x09, - 0x00, 0x00, + // 1220 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08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f, + 0xf5, 0xc6, 0x84, 0x05, 0x89, 0x5e, 0x14, 0x1b, 0xdb, 0xde, 0xbd, 0x9a, 0xd7, 0xb7, 0x14, 0xc0, + 0xcd, 0x18, 0x03, 0x57, 0x03, 0x72, 0xd1, 0x52, 0xb6, 0x8e, 0x34, 0xa1, 0x36, 0x94, 0x59, 0xc8, + 0x69, 0x4c, 0x3c, 0xb9, 0xe3, 0xa5, 0x86, 0xb6, 0x57, 0x79, 0xdc, 0x30, 0x97, 0x08, 0x64, 0x5a, + 0x8b, 0x18, 0xe7, 0x72, 0x42, 0x71, 0x3e, 0x09, 0x3d, 0x01, 0x90, 0x05, 0x5c, 0x7e, 0x39, 0xa1, + 0x3a, 0x48, 0x88, 0xed, 0x1b, 0x10, 0xb2, 0xa0, 0x4c, 0x2e, 0x79, 0xd9, 0x10, 0xf9, 0x50, 0xe5, + 0xd1, 0x39, 0x0d, 0x13, 0x77, 0x42, 0x63, 0xd5, 0xa6, 0x5e, 0x96, 0x9b, 0xbf, 0x65, 0x2a, 0xce, + 0x9a, 0x82, 0xb3, 0x66, 0xca, 0x59, 0xb3, 0x13, 0xb1, 0xb0, 0x5d, 0x4f, 0xf7, 0xfe, 0x91, 0x5a, + 0xe8, 0x32, 0x80, 0x81, 0x2b, 0xca, 0x74, 0x4c, 0x63, 0x59, 0x14, 0x3d, 0x87, 0x0d, 0x1e, 0x71, + 0x32, 0x76, 0x95, 0x5d, 0xdf, 0xf8, 0x58, 0x85, 0xec, 0x74, 0xef, 0x65, 0x15, 0x16, 0xc9, 0x06, + 0x2e, 0xcb, 0xa9, 0x23, 0x67, 0x88, 0x42, 0x95, 0xcc, 0x08, 0x1b, 0x93, 0xe1, 0x98, 0x66, 0xf0, + 0x77, 0xfe, 0xe7, 0x02, 0x96, 0x01, 0x0c, 0xbc, 0x79, 0x6d, 0x4a, 0xcb, 0xf4, 0xa0, 0x1a, 0x53, + 0x8f, 0xb2, 0x19, 0xf5, 0x5d, 0xc1, 0x0c, 0xe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, 0x55, 0x43, 0xdb, 0xf0, 0x70, 0xd9, + 0x9b, 0xfa, 0x56, 0xf6, 0x0f, 0xa1, 0x74, 0xfd, 0x46, 0xa1, 0xbb, 0x70, 0xa7, 0xf3, 0xac, 0x65, + 0x1d, 0xaa, 0x76, 0xfa, 0x62, 0x4b, 0x10, 0x54, 0x72, 0x26, 0xbb, 0xef, 0xa8, 0xde, 0x3f, 0x08, + 0x73, 0x5b, 0x76, 0x57, 0xba, 0x56, 0xda, 0xc7, 0xaf, 0xdf, 0xd6, 0x0a, 0x6f, 0xde, 0xd6, 0x0a, + 0xaf, 0xdf, 0xd5, 0xb4, 0x37, 0xef, 0x6a, 0xda, 0xdf, 0xef, 0x6a, 0xda, 0xab, 0xf7, 0xb5, 0xc2, + 0x9b, 0xf7, 0xb5, 0xc2, 0x1f, 0xef, 0x6b, 0x85, 0x17, 0x66, 0xee, 0x2e, 0x5c, 0xff, 0xcc, 0x45, + 0x41, 0xc8, 0x46, 0x63, 0x76, 0x71, 0x36, 0x1d, 0x36, 0x67, 0x8f, 0x9b, 0xea, 0xef, 0x4e, 0xde, + 0x8b, 0xe1, 0x6d, 0xa9, 0x12, 0x5f, 0xfd, 0x13, 0x00, 0x00, 0xff, 0xff, 0x35, 0x7f, 0xf1, 0x13, + 0xfa, 0x09, 0x00, 0x00, } func (m *Campaign) Marshal() (dAtA []byte, err error) { @@ -632,6 +634,13 @@ func (m *NFTDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.UriHash) > 0 { + i -= len(m.UriHash) + copy(dAtA[i:], m.UriHash) + i = encodeVarintItc(dAtA, i, uint64(len(m.UriHash))) + i-- + dAtA[i] = 0x5a + } if len(m.Data) > 0 { i -= len(m.Data) copy(dAtA[i:], m.Data) @@ -897,6 +906,10 @@ func (m *NFTDetails) Size() (n int) { if l > 0 { n += 1 + l + sovItc(uint64(l)) } + l = len(m.UriHash) + if l > 0 { + n += 1 + l + sovItc(uint64(l)) + } return n } @@ -1907,6 +1920,38 @@ func (m *NFTDetails) Unmarshal(dAtA []byte) error { } m.Data = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UriHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowItc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthItc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthItc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UriHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipItc(dAtA[iNdEx:]) diff --git a/x/itc/types/msgs.go b/x/itc/types/msgs.go index 4d68b73d..df985384 100644 --- a/x/itc/types/msgs.go +++ b/x/itc/types/msgs.go @@ -5,7 +5,7 @@ import ( errorsmod "cosmossdk.io/errors" - "github.com/OmniFlix/onft/types" + "github.com/OmniFlix/omniflixhub/v2/x/onft/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" diff --git a/x/marketplace/keeper/auction.go b/x/marketplace/keeper/auction.go index 2640ae0c..63e519d3 100644 --- a/x/marketplace/keeper/auction.go +++ b/x/marketplace/keeper/auction.go @@ -266,7 +266,7 @@ func (k Keeper) processBid(ctx sdk.Context, auction types.AuctionListing, bid ty if err != nil { return err } - denom, err := k.nftKeeper.GetDenom(ctx, auction.DenomId) + denom, err := k.nftKeeper.GetDenomInfo(ctx, auction.DenomId) if err != nil { return err } diff --git a/x/marketplace/keeper/keeper.go b/x/marketplace/keeper/keeper.go index 60d73940..9a95bbd0 100644 --- a/x/marketplace/keeper/keeper.go +++ b/x/marketplace/keeper/keeper.go @@ -106,7 +106,7 @@ func (k Keeper) Buy(ctx sdk.Context, listing types.Listing, buyer sdk.AccAddress if err != nil { return err } - denom, err := k.nftKeeper.GetDenom(ctx, listing.DenomId) + denom, err := k.nftKeeper.GetDenomInfo(ctx, listing.DenomId) if err != nil { return err } diff --git a/x/marketplace/types/expected_keepers.go b/x/marketplace/types/expected_keepers.go index 896f8f8e..f609114a 100644 --- a/x/marketplace/types/expected_keepers.go +++ b/x/marketplace/types/expected_keepers.go @@ -1,8 +1,8 @@ package types import ( - nft "github.com/OmniFlix/onft/exported" - nftypes "github.com/OmniFlix/onft/types" + nft "github.com/OmniFlix/omniflixhub/v2/x/onft/exported" + nftypes "github.com/OmniFlix/omniflixhub/v2/x/onft/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" ) @@ -23,10 +23,10 @@ type BankKeeper interface { SendCoinsFromAccountToModule(ctx sdk.Context, fromAddr sdk.AccAddress, toModule string, amt sdk.Coins) error } +// NftKeeper methods imported from nft should be defined here type NftKeeper interface { - // methods imported from nft should be defined here GetONFT(ctx sdk.Context, denomId, onftId string) (nft nft.ONFTI, err error) - GetDenom(ctx sdk.Context, denomId string) (nftypes.Denom, error) + GetDenomInfo(ctx sdk.Context, denomId string) (*nftypes.Denom, error) TransferOwnership(ctx sdk.Context, denomId, nftId string, srcOwner, dstOwner sdk.AccAddress) error } diff --git a/x/onft/README.md b/x/onft/README.md new file mode 100644 index 00000000..dc9d805f --- /dev/null +++ b/x/onft/README.md @@ -0,0 +1,274 @@ +# oNFT - OmniFlix Non-Fungible Token + +The `oNFT` module is a part of the OmniFlix Network and enables the classification and tokenization of assets. + +- Assets can be classified under `denoms` (aka `collections` across various ecosystems) +- Tokenize media assets by minting NFTs + +`Note:` This module used the [irismod/nft](https://github.com/irismod/nft) repository for initial development and has been modified to meet the requirements of the OmniFlix Network. +### Denom / Collection +A denom is a collection of NFTs. It is a unique identifier for a collection of NFTs. + +```protobuf +message Denom { + option (gogoproto.equal) = true; + + string id = 1; + string symbol = 2; + string name = 3; + string schema = 4; + string creator = 5; + string description = 6; + string preview_uri = 7 [ + (gogoproto.moretags) = "yaml:\"preview_uri\"", + (gogoproto.customname) = "PreviewURI" + ]; +} +``` +## oNFT +oNFT is a non-fungible token that represents a unique asset + +```protobuf +message ONFT { + option (gogoproto.equal) = true; + + string id = 1; + Metadata metadata = 2 [(gogoproto.nullable) = false]; + string data = 3; + string owner = 4; + bool transferable = 5; + bool extensible = 6; + google.protobuf.Timestamp created_at = 7 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "yaml:\"created_at\"" + ]; + bool nsfw = 8; + string royalty_share = 9 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"royalty_share\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec" + ]; +} + +message Metadata { + option (gogoproto.equal) = true; + + string name = 1 [(gogoproto.moretags) = "yaml:\"name\""]; + string description = 2 [(gogoproto.moretags) = "yaml:\"description\""]; + string media_uri = 3 [ + (gogoproto.moretags) = "yaml:\"media_uri\"", + (gogoproto.customname) = "MediaURI" + ]; + string preview_uri = 4 [ + (gogoproto.moretags) = "yaml:\"preview_uri\"", + (gogoproto.customname) = "PreviewURI" + ]; +} +``` +### State +The state of the module is expressed by following fields +1. `Collection`: an object contains denom & list of NFTs +2. `Params`: an object contains the parameters of the module + + +```protobuf +message GenesisState { + repeated Collection collections = 1 [(gogoproto.nullable) = false]; + Params params = 2 [(gogoproto.nullable) = false]; +} + +message Collection { + option (gogoproto.equal) = true; + + Denom denom = 1 [(gogoproto.nullable) = false]; + repeated ONFT onfts = 2 [(gogoproto.customname) = "ONFTs", (gogoproto.nullable) = false]; +} + +// module params +message Params { + cosmos.base.v1beta1.Coin denom_creation_fee = 1 [ + (gogoproto.moretags) = "yaml:\"denom_creation_fee\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.nullable) = false + ]; +} +``` + + + +The module supports the following capabilities for classification and tokenization: + +- Creation of collections (denoms) +- Minting of NFTs +- Transferring of NFTs +- Burning of NFTs + +Various queries are available to get details about denoms/collections, NFTs, and related metadata including but not limited to ownership. Click here to try them out by interacting with the chain. + + + +### 1) Create Denom (Collection) +To create an oNFT denom, you will need to use the "onftd tx onft create" command with the following args and flags: + +args: +symbol: denom symbol + +flags: +name : name of denom/collection +description: description for the denom +preview-uri: display picture url for denom +schema: json schema for additional properties +creation-fee: denom creation-fee to create denom + +Example: +``` + onftd tx onft create \ + --name= \ + --description= \ + --preview-uri= \ + --schema= \ + --creation-fee= \ + --chain-id= \ + --fees= \ + --from= +``` + +### 2) Mint an oNFT + +To create an oNFT, you will need to use the "onftd tx onft mint" command with the following flags: + +denom-id: the ID of the collection in which you want to mint the NFT +name: the name of the NFT +description: a description of the NFT +media-uri: the IPFS URI of the NFT +preview-uri: the preview URI of the NFT +data: any additional properties for the NFT (optional) +recipient: the recipient of the NFT (optional, default is the minter of the NFT) +non-transferable: flag to mint a non-transferable NFT (optional, default is false) +inextensible: flag to mint an inextensible NFT (optional, default is false) +nsfw: flag to mark the NFT as not safe for work (optional, default is false) +royalty-share: the royalty share for the NFT (optional, default is 0.00) + +Example: + +``` +onftd tx onft mint \ +--name="NFT name" \ +--description="NFT description" \ +--media-uri="https://ipfs.io/ipfs/...." \ +--preview-uri="https://ipfs.io/ipfs/...." \ +--data="{}" \ +--recipient="" \ +--chain-id= \ +--fees= \ +--from= +``` + +Optional flags: +``` +--non-transferable +--inextensible +--nsfw +``` + +For a royalty share: + +``` +--royalty-share="0.05" # 5% +``` + +### 3) Transfer an oNFT + +To transfer an oNFT, you will need to use the "onftd tx onft transfer" command with the following flags: + +recipient: the recipient's account address +denom-id: the ID of the collection in which the NFT is located +onft-id: the ID of the NFT to be transferred +chain-id: the ID of the blockchain where the transaction will be made (required) +fees: the transaction fees (required) +from: the name of the key to sign the transaction with (required) + +Example: + +``` +onftd tx onft transfer \ +--chain-id= \ +--fees= \ +--from= +``` + +### 4) Burn an oNFT + +To burn an oNFT, you will need to use the "onftd tx onft burn" command with the following flags: + +denom-id: the ID of the collection in which the NFT is located +onft-id: the ID of the NFT to be burned +chain-id: the ID of the blockchain where the transaction will be made (required) +fees: the transaction fees (required) +from: the name of the key to sign the transaction with (required) + +Example: + +``` +onftd tx onft burn \ +--chain-id= \ +--fees= \ +--from= +``` + +### Queries +List of queries available for the module: + +```protobuf +service Query { + rpc Collection(QueryCollectionRequest) returns (QueryCollectionResponse) { + option (google.api.http).get = "/omniflix/onft/v1beta1/collections/{denom_id}"; + } + + rpc Denom(QueryDenomRequest) returns (QueryDenomResponse) { + option (google.api.http).get = "/omniflix/onft/v1beta1/denoms/{denom_id}"; + } + + rpc Denoms(QueryDenomsRequest) returns (QueryDenomsResponse) { + option (google.api.http).get = "/omniflix/onft/v1beta1/denoms"; + } + rpc ONFT(QueryONFTRequest) returns (QueryONFTResponse) { + option (google.api.http).get = "/omniflix/onft/v1beta1/denoms/{denom_id}/onfts/{id}"; + } + rpc OwnerONFTs(QueryOwnerONFTsRequest) returns (QueryOwnerONFTsResponse) { + option (google.api.http).get = "/omniflix/onft/v1beta1/onfts/{denom_id}/{owner}"; + } + rpc Supply(QuerySupplyRequest) returns (QuerySupplyResponse) { + option (google.api.http).get = "/omniflix/onft/v1beta1/denoms/{denom_id}/supply"; + } + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/omniflix/onft/v1beta1/params"; + } +} +``` +### CLI Queries + - #### Get List of denoms (collections) + ```bash + onftd query onft denoms + ``` + - #### Get Denom details by it's Id + ```bash + onftd query onft denom + ``` + - #### Get List of NFTs in a collection + ```bash + onftd query onft collection + ``` + - #### Get Total Count of NFTs in a collection + ```bash + onftd query onft supply + ``` + - #### Get NFT details by it's Id + ```bash + onftd query onft asset + ``` + - #### Get All NFTs owned by an address + ```bash + onftd query onft owner + ``` diff --git a/x/onft/client/cli/flags.go b/x/onft/client/cli/flags.go new file mode 100644 index 00000000..0805ae06 --- /dev/null +++ b/x/onft/client/cli/flags.go @@ -0,0 +1,67 @@ +package cli + +import ( + flag "github.com/spf13/pflag" +) + +const ( + FlagName = "name" + FlagDescription = "description" + FlagMediaURI = "media-uri" + FlagPreviewURI = "preview-uri" + FlagData = "data" + FlagNonTransferable = "non-transferable" + FlagInExtensible = "inextensible" + FlagRecipient = "recipient" + FlagOwner = "owner" + FlagDenomID = "denom-id" + FlagSchema = "schema" + FlagNsfw = "nsfw" + FlagRoyaltyShare = "royalty-share" + FlagCreationFee = "creation-fee" + FlagURI = "uri" + FlagURIHash = "uri-hash" +) + +var ( + FsCreateDenom = flag.NewFlagSet("", flag.ContinueOnError) + FsUpdateDenom = flag.NewFlagSet("", flag.ContinueOnError) + FsTransferDenom = flag.NewFlagSet("", flag.ContinueOnError) + FsMintONFT = flag.NewFlagSet("", flag.ContinueOnError) + FsTransferONFT = flag.NewFlagSet("", flag.ContinueOnError) + FsQuerySupply = flag.NewFlagSet("", flag.ContinueOnError) + FsQueryOwner = flag.NewFlagSet("", flag.ContinueOnError) +) + +func init() { + FsCreateDenom.String(FlagSchema, "", "Denom schema") + FsCreateDenom.String(FlagName, "", "Name of the denom") + FsCreateDenom.String(FlagDescription, "", "Description for denom") + FsCreateDenom.String(FlagPreviewURI, "", "Preview image uri for denom") + FsCreateDenom.String(FlagCreationFee, "", "fee amount for creating denom") + + FsUpdateDenom.String(FlagName, "[do-not-modify]", "Name of the denom") + FsUpdateDenom.String(FlagDescription, "[do-not-modify]", "Description for denom") + FsUpdateDenom.String(FlagPreviewURI, "[do-not-modify]", "Preview image uri for denom") + FsCreateDenom.String(FlagURI, "", "uri for denom") + FsCreateDenom.String(FlagURIHash, "", "uri hash for denom") + FsCreateDenom.String(FlagData, "", "json data of the denom") + + FsTransferDenom.String(FlagRecipient, "", "recipient of the denom") + + FsMintONFT.String(FlagMediaURI, "", "Media uri of onft") + FsMintONFT.String(FlagRecipient, "", "Receiver of the onft. default value is sender address of transaction") + FsMintONFT.String(FlagPreviewURI, "", "Preview uri of onft") + FsMintONFT.String(FlagName, "", "Name of onft") + FsMintONFT.String(FlagDescription, "", "Description of onft") + FsMintONFT.String(FlagData, "", "custom data of onft") + FsMintONFT.Bool(FlagNonTransferable, false, "To mint non-transferable onft") + FsMintONFT.Bool(FlagInExtensible, false, "To mint non-extensisble onft") + FsMintONFT.Bool(FlagNsfw, false, "not safe for work flag for onft") + FsMintONFT.String(FlagRoyaltyShare, "", "Royalty share value decimal value between 0 and 1") + FsMintONFT.String(FlagURIHash, "", "uri hash for the nft") + + FsTransferONFT.String(FlagRecipient, "", "Receiver of the onft. default value is sender address of transaction") + FsQuerySupply.String(FlagOwner, "", "The owner of a nft") + FsQueryOwner.String(FlagDenomID, "", "id of the denom") +} diff --git a/x/onft/client/cli/query.go b/x/onft/client/cli/query.go new file mode 100644 index 00000000..036aee2a --- /dev/null +++ b/x/onft/client/cli/query.go @@ -0,0 +1,299 @@ +package cli + +import ( + "context" + "fmt" + "strings" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/version" + "github.com/spf13/cobra" + + "github.com/OmniFlix/omniflixhub/v2/x/onft/types" +) + +func GetQueryCmd() *cobra.Command { + queryCmd := &cobra.Command{ + Use: types.ModuleName, + Short: "Querying commands for the oNFT module", + DisableFlagParsing: true, + } + + queryCmd.AddCommand( + GetCmdQueryDenom(), + GetCmdQueryDenoms(), + GetCmdQueryCollection(), + GetCmdQuerySupply(), + GetCmdQueryONFT(), + GetCmdQueryOwner(), + GetCmdQueryParams(), + ) + + return queryCmd +} + +func GetCmdQuerySupply() *cobra.Command { + cmd := &cobra.Command{ + Use: "supply [denom-id]", + Long: strings.TrimSpace( + fmt.Sprintf(`total supply of a collection of oNFTs. +Example: +$ %s query onft supply [denom-id]`, version.AppName)), + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + clientCtx, err := client.ReadPersistentCommandFlags(clientCtx, cmd.Flags()) + if err != nil { + return err + } + + var owner sdk.AccAddress + ownerStr, err := cmd.Flags().GetString(FlagOwner) + if err != nil { + return err + } + + if len(ownerStr) > 0 { + owner, err = sdk.AccAddressFromBech32(ownerStr) + if err != nil { + return err + } + } + + denomId := strings.ToLower(strings.TrimSpace(args[0])) + + queryClient := types.NewQueryClient(clientCtx) + resp, err := queryClient.Supply(context.Background(), &types.QuerySupplyRequest{ + DenomId: denomId, + Owner: owner.String(), + }) + if err != nil { + return err + } + return clientCtx.PrintProto(resp) + }, + } + cmd.Flags().AddFlagSet(FsQuerySupply) + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func GetCmdQueryOwner() *cobra.Command { + cmd := &cobra.Command{ + Use: "owner [address]", + Long: "Get the oNFTs owned by an account address.", + Example: fmt.Sprintf("$ %s query onft owner --denom-id=", version.AppName), + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + if _, err := sdk.AccAddressFromBech32(args[0]); err != nil { + return err + } + pagination, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + denomID, err := cmd.Flags().GetString(FlagDenomID) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + resp, err := queryClient.OwnerONFTs(context.Background(), &types.QueryOwnerONFTsRequest{ + DenomId: denomID, + Owner: args[0], + Pagination: pagination, + }) + if err != nil { + return err + } + return clientCtx.PrintProto(resp) + }, + } + cmd.Flags().AddFlagSet(FsQueryOwner) + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "owner onfts") + + return cmd +} + +func GetCmdQueryCollection() *cobra.Command { + cmd := &cobra.Command{ + Use: "collection [denom-id]", + Long: strings.TrimSpace( + fmt.Sprintf(`Get all the oNFTs from a given collection +Example: +$ %s query onft collection `, version.AppName)), + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + clientCtx, err := client.ReadPersistentCommandFlags(clientCtx, cmd.Flags()) + if err != nil { + return err + } + + denomId := args[0] + pagination, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + resp, err := queryClient.Collection(context.Background(), &types.QueryCollectionRequest{ + DenomId: denomId, + Pagination: pagination, + }) + if err != nil { + return err + } + return clientCtx.PrintProto(resp.Collection) + }, + } + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "onfts") + return cmd +} + +func GetCmdQueryDenoms() *cobra.Command { + cmd := &cobra.Command{ + Use: "denoms", + Long: strings.TrimSpace( + fmt.Sprintf(`Query all denominations of all collections of oNFTs +Example: +$ %s query onft denoms`, version.AppName)), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + clientCtx, err := client.ReadPersistentCommandFlags(clientCtx, cmd.Flags()) + if err != nil { + return err + } + pagination, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + owner, err := cmd.Flags().GetString(FlagOwner) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + resp, err := queryClient.Denoms( + context.Background(), + &types.QueryDenomsRequest{ + Pagination: pagination, + Owner: owner, + }, + ) + if err != nil { + return err + } + return clientCtx.PrintProto(resp) + }, + } + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "denoms") + cmd.Flags().String(FlagOwner, "", "filter by collection owner address") + return cmd +} + +func GetCmdQueryDenom() *cobra.Command { + cmd := &cobra.Command{ + Use: "denom [denom-id]", + Long: strings.TrimSpace( + fmt.Sprintf(`Query the denominations by the specified denom name +Example: +$ %s query onft denom `, version.AppName)), + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + clientCtx, err := client.ReadPersistentCommandFlags(clientCtx, cmd.Flags()) + if err != nil { + return err + } + + denomId := strings.ToLower(strings.TrimSpace(args[0])) + if err := types.ValidateDenomID(denomId); err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + resp, err := queryClient.Denom(context.Background(), &types.QueryDenomRequest{ + DenomId: denomId, + }) + if err != nil { + return err + } + return clientCtx.PrintProto(resp.Denom) + }, + } + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func GetCmdQueryONFT() *cobra.Command { + cmd := &cobra.Command{ + Use: "asset [denom-id] [onft-id]", + Long: strings.TrimSpace( + fmt.Sprintf(`Query a single oNFT from a collection +Example: +$ %s query onft asset `, version.AppName)), + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + clientCtx, err := client.ReadPersistentCommandFlags(clientCtx, cmd.Flags()) + if err != nil { + return err + } + + denomId := args[0] + onftId := args[1] + + queryClient := types.NewQueryClient(clientCtx) + resp, err := queryClient.ONFT(context.Background(), &types.QueryONFTRequest{ + DenomId: denomId, + Id: onftId, + }) + if err != nil { + return err + } + return clientCtx.PrintProto(resp.ONFT) + }, + } + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +// GetCmdQueryParams implements the query params command. +func GetCmdQueryParams() *cobra.Command { + cmd := &cobra.Command{ + Use: "params", + Args: cobra.NoArgs, + Short: "Query oNFT params", + RunE: func(cmd *cobra.Command, _ []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{}) + if err != nil { + return err + } + + return clientCtx.PrintProto(&res.Params) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + return cmd +} diff --git a/x/onft/client/cli/tx.go b/x/onft/client/cli/tx.go new file mode 100644 index 00000000..57ee04e5 --- /dev/null +++ b/x/onft/client/cli/tx.go @@ -0,0 +1,444 @@ +package cli + +import ( + "fmt" + "strings" + + "github.com/OmniFlix/omniflixhub/v2/x/onft/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/version" + "github.com/spf13/cobra" +) + +// NewTxCmd returns the transaction commands for this module +func NewTxCmd() *cobra.Command { + txCmd := &cobra.Command{ + Use: types.ModuleName, + Short: "oNFT transactions subcommands", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + txCmd.AddCommand( + GetCmdCreateDenom(), + GetCmdUpdateDenom(), + GetCmdTransferDenom(), + GetCmdMintONFT(), + GetCmdTransferONFT(), + GetCmdBurnONFT(), + ) + + return txCmd +} + +func GetCmdCreateDenom() *cobra.Command { + cmd := &cobra.Command{ + Use: "create [symbol]", + Long: strings.TrimSpace( + fmt.Sprintf(`Create a new denom. +Example: +$ %s tx onft create [symbol] --name= --schema= --description= +--uri= --uri-hash= --preview-uri= --creation-fee +--chain-id= --from= --fees=`, + version.AppName, + ), + ), + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + symbol := args[0] + + denomName, err := cmd.Flags().GetString(FlagName) + if err != nil { + return err + } + + schema, err := cmd.Flags().GetString(FlagSchema) + if err != nil { + return err + } + + description, err := cmd.Flags().GetString(FlagDescription) + if err != nil { + return err + } + + URI, err := cmd.Flags().GetString(FlagURI) + if err != nil { + return err + } + + URIHash, err := cmd.Flags().GetString(FlagURIHash) + if err != nil { + return err + } + previewURI, err := cmd.Flags().GetString(FlagPreviewURI) + if err != nil { + return err + } + data, err := cmd.Flags().GetString(FlagData) + if err != nil { + return err + } + creationFeeStr, err := cmd.Flags().GetString(FlagCreationFee) + if err != nil { + return err + } + creationFee, err := sdk.ParseCoinNormalized(creationFeeStr) + if err != nil { + return fmt.Errorf("failed to parse creation fee: %s", creationFeeStr) + } + + msg := types.NewMsgCreateDenom( + symbol, + denomName, + schema, + description, + URI, + URIHash, + previewURI, + data, + clientCtx.GetFromAddress().String(), + creationFee, + ) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + cmd.Flags().AddFlagSet(FsCreateDenom) + _ = cmd.MarkFlagRequired(FlagName) + flags.AddTxFlagsToCmd(cmd) + + return cmd +} + +func GetCmdMintONFT() *cobra.Command { + cmd := &cobra.Command{ + Use: "mint [denom-id]", + Long: strings.TrimSpace( + fmt.Sprintf(`Mint an oNFT. +Example: +$ %s tx onft mint [denom-id] \ + --name \ + --description \ + --media-uri= \ + --preview-uri= \ + --uri-hash= \ + --from= \ + --chain-id= \ + --fees= + +Additional Flags + --non-trasferable + --inextensible + --nsfw + --royalty-share="0.05" +`, + version.AppName, + ), + ), + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + denomId := args[0] + + sender := clientCtx.GetFromAddress().String() + + recipient, err := cmd.Flags().GetString(FlagRecipient) + if err != nil { + return err + } + + if len(recipient) > 0 { + if _, err = sdk.AccAddressFromBech32(recipient); err != nil { + return err + } + } else { + recipient = sender + } + + onftMetadata := types.Metadata{} + onftName, err := cmd.Flags().GetString(FlagName) + if err != nil { + return err + } + + onftDescription, err := cmd.Flags().GetString(FlagDescription) + if err != nil { + return err + } + + onftMediaURI, err := cmd.Flags().GetString(FlagMediaURI) + if err != nil { + return err + } + + onftURIHash, err := cmd.Flags().GetString(FlagURIHash) + if err != nil { + return err + } + + onftPreviewURI, err := cmd.Flags().GetString(FlagPreviewURI) + if err != nil { + return err + } + + if len(onftName) > 0 { + onftMetadata.Name = onftName + } + if len(onftDescription) > 0 { + onftMetadata.Description = onftDescription + } + if len(onftMediaURI) > 0 { + onftMetadata.MediaURI = onftMediaURI + } + if len(onftPreviewURI) > 0 { + onftMetadata.PreviewURI = onftPreviewURI + } + if len(onftURIHash) > 0 { + onftMetadata.UriHash = onftURIHash + } + data, err := cmd.Flags().GetString(FlagData) + if err != nil { + return err + } + transferable := true + nonTransferable, err := cmd.Flags().GetBool(FlagNonTransferable) + if err != nil { + return err + } + if nonTransferable { + transferable = false + } + extensible := true + inExtensible, err := cmd.Flags().GetBool(FlagInExtensible) + if err != nil { + return err + } + if inExtensible { + extensible = false + } + nsfw := false + nsfwFlag, err := cmd.Flags().GetBool(FlagNsfw) + if err != nil { + return err + } + if nsfwFlag { + nsfw = true + } + royaltyShareStr, err := cmd.Flags().GetString(FlagRoyaltyShare) + if err != nil { + return err + } + royaltyShare := sdk.NewDec(0) + if len(royaltyShareStr) > 0 { + royaltyShare, err = sdk.NewDecFromStr(royaltyShareStr) + if err != nil { + return err + } + } + + msg := types.NewMsgMintONFT( + denomId, + sender, + recipient, + onftMetadata, + data, + transferable, + extensible, + nsfw, + royaltyShare, + ) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + cmd.Flags().AddFlagSet(FsMintONFT) + _ = cmd.MarkFlagRequired(FlagMediaURI) + _ = cmd.MarkFlagRequired(FlagName) + flags.AddTxFlagsToCmd(cmd) + + return cmd +} + +func GetCmdUpdateDenom() *cobra.Command { + cmd := &cobra.Command{ + Use: "update-denom [denom-id]", + Long: strings.TrimSpace( + fmt.Sprintf(`Edit the data of Denom. +Example: +$ %s tx onft update-denom [denom-id] --name= --description= +--preview-uri= --from= --chain-id= --fees=`, + version.AppName, + ), + ), + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + denomId := args[0] + + denomName, err := cmd.Flags().GetString(FlagName) + if err != nil { + return err + } + + denomDescription, err := cmd.Flags().GetString(FlagDescription) + if err != nil { + return err + } + + denomPreviewURI, err := cmd.Flags().GetString(FlagPreviewURI) + if err != nil { + return err + } + + msg := types.NewMsgUpdateDenom( + denomId, + denomName, + denomDescription, + denomPreviewURI, + clientCtx.GetFromAddress().String(), + ) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + cmd.Flags().AddFlagSet(FsUpdateDenom) + flags.AddTxFlagsToCmd(cmd) + + return cmd +} + +func GetCmdTransferDenom() *cobra.Command { + cmd := &cobra.Command{ + Use: "transfer-denom [recipient] [denom-id]", + Long: strings.TrimSpace( + fmt.Sprintf(`Transfer a denom to a recipient. +Example: +$ %s tx onft transfer-denom [recipient] [denom-id] --from= --chain-id= --fees=`, + version.AppName, + ), + ), + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + recipient, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + return err + } + + denomId := args[1] + + msg := types.NewMsgTransferDenom( + denomId, + clientCtx.GetFromAddress().String(), + recipient.String(), + ) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + cmd.Flags().AddFlagSet(FsTransferDenom) + flags.AddTxFlagsToCmd(cmd) + + return cmd +} + +func GetCmdTransferONFT() *cobra.Command { + cmd := &cobra.Command{ + Use: "transfer [recipient] [denom-id] [onft-id]", + Long: strings.TrimSpace( + fmt.Sprintf(`Transfer an oNFT to a recipient. +Example: +$ %s tx onft transfer [recipient] [denom-id] [onft-id] --from= --chain-id= --fees=`, + version.AppName, + ), + ), + Args: cobra.ExactArgs(3), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + recipient, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + return err + } + + denomId := args[1] + onftId := args[2] + + msg := types.NewMsgTransferONFT( + onftId, + denomId, + clientCtx.GetFromAddress().String(), + recipient.String(), + ) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + cmd.Flags().AddFlagSet(FsTransferONFT) + flags.AddTxFlagsToCmd(cmd) + + return cmd +} + +func GetCmdBurnONFT() *cobra.Command { + cmd := &cobra.Command{ + Use: "burn [denom-id] [onft-id]", + Long: strings.TrimSpace( + fmt.Sprintf(`Burn an oNFT. +Example: +$ %s tx onft burn [denom-id] [onft-id] --from= --chain-id= --fees=`, + version.AppName, + ), + ), + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + denomId := args[0] + onftId := args[1] + + msg := types.NewMsgBurnONFT(denomId, onftId, clientCtx.GetFromAddress().String()) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/onft/exported/onft.go b/x/onft/exported/onft.go new file mode 100644 index 00000000..05d10469 --- /dev/null +++ b/x/onft/exported/onft.go @@ -0,0 +1,37 @@ +package exported + +import ( + "time" + + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +type ONFTI interface { + GetID() string + GetOwner() sdk.AccAddress + GetName() string + GetDescription() string + GetMediaURI() string + GetURIHash() string + GetPreviewURI() string + GetData() string + IsTransferable() bool + IsExtensible() bool + IsNSFW() bool + GetCreatedTime() time.Time + GetRoyaltyShare() sdk.Dec +} + +type ( + ParamSet = paramtypes.ParamSet + + // Subspace defines an interface that implements the legacy x/params Subspace + // type. + // + // NOTE: This is used solely for migration of x/params managed parameters. + Subspace interface { + GetParamSet(ctx sdk.Context, ps ParamSet) + } +) diff --git a/x/onft/genesis.go b/x/onft/genesis.go new file mode 100644 index 00000000..c2643034 --- /dev/null +++ b/x/onft/genesis.go @@ -0,0 +1,34 @@ +package onft + +import ( + "github.com/OmniFlix/omniflixhub/v2/x/onft/keeper" + "github.com/OmniFlix/omniflixhub/v2/x/onft/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func InitGenesis(ctx sdk.Context, k keeper.Keeper, data types.GenesisState) { + if err := types.ValidateGenesis(data); err != nil { + panic(err.Error()) + } + + for _, c := range data.Collections { + if err := k.SetCollection(ctx, c); err != nil { + panic(err) + } + } + if err := k.SetParams(ctx, data.Params); err != nil { + panic(err) + } +} + +func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { + collections, err := k.GetCollections(ctx) + if err != nil { + panic(err.Error()) + } + return types.NewGenesisState(collections, k.GetParams(ctx)) +} + +func DefaultGenesisState() *types.GenesisState { + return types.NewGenesisState([]types.Collection{}, types.DefaultParams()) +} diff --git a/x/onft/keeper/alias.go b/x/onft/keeper/alias.go new file mode 100644 index 00000000..53073856 --- /dev/null +++ b/x/onft/keeper/alias.go @@ -0,0 +1,12 @@ +package keeper + +import ( + "github.com/OmniFlix/omniflixhub/v2/x/onft/types" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" +) + +// GetONFTModuleAccount returns oNFT ModuleAccount +func (k Keeper) GetONFTModuleAccount(ctx sdk.Context) authtypes.ModuleAccountI { + return k.accountKeeper.GetModuleAccount(ctx, types.ModuleName) +} diff --git a/x/onft/keeper/collection.go b/x/onft/keeper/collection.go new file mode 100644 index 00000000..b5cb86a4 --- /dev/null +++ b/x/onft/keeper/collection.go @@ -0,0 +1,90 @@ +package keeper + +import ( + errorsmod "cosmossdk.io/errors" + "github.com/OmniFlix/omniflixhub/v2/x/onft/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k Keeper) SetCollection(ctx sdk.Context, collection types.Collection) error { + denom := collection.Denom + creator, err := sdk.AccAddressFromBech32(denom.Creator) + if err != nil { + return err + } + if err := k.SaveDenom(ctx, + denom.Id, + denom.Symbol, + denom.Name, + denom.Schema, + creator, + denom.Description, + denom.PreviewURI, + denom.Uri, + denom.UriHash, + denom.Data, + ); err != nil { + return err + } + + for _, onft := range collection.ONFTs { + if err := k.MintONFT(ctx, + denom.Id, + onft.GetID(), + onft.GetName(), + onft.GetDescription(), + onft.GetMediaURI(), + onft.GetURIHash(), + onft.GetPreviewURI(), + onft.GetData(), + onft.GetCreatedTime(), + onft.IsTransferable(), + onft.IsExtensible(), + onft.IsNSFW(), + onft.GetRoyaltyShare(), + onft.GetOwner(), + ); err != nil { + return err + } + } + return nil +} + +func (k Keeper) GetCollection(ctx sdk.Context, denomID string) (types.Collection, error) { + denom, err := k.GetDenomInfo(ctx, denomID) + if err != nil { + return types.Collection{}, errorsmod.Wrapf(types.ErrInvalidDenom, "denomID %s not existed ", denomID) + } + + onfts, err := k.GetONFTs(ctx, denomID) + if err != nil { + return types.Collection{}, err + } + return types.NewCollection(*denom, onfts), nil +} + +func (k Keeper) GetCollections(ctx sdk.Context) (collections []types.Collection, err error) { + for _, class := range k.nk.GetClasses(ctx) { + onfts, err := k.GetONFTs(ctx, class.Id) + if err != nil { + return nil, err + } + + denom, err := k.GetDenomInfo(ctx, class.Id) + if err != nil { + return nil, err + } + + collections = append(collections, types.NewCollection(*denom, onfts)) + } + return collections, nil +} + +func (k Keeper) GetTotalSupply(ctx sdk.Context, denomID string) uint64 { + return k.nk.GetTotalSupply(ctx, denomID) +} + +// GetBalance returns the amount of NFTs owned in a class by an account +func (k Keeper) GetBalance(ctx sdk.Context, id string, owner sdk.AccAddress) (supply uint64) { + return k.nk.GetBalance(ctx, id, owner) +} diff --git a/x/onft/keeper/denom.go b/x/onft/keeper/denom.go new file mode 100644 index 00000000..6334f332 --- /dev/null +++ b/x/onft/keeper/denom.go @@ -0,0 +1,224 @@ +package keeper + +import ( + errorsmod "cosmossdk.io/errors" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/x/nft" + + "github.com/OmniFlix/omniflixhub/v2/x/onft/types" +) + +// SaveDenom saves a denom +func (k Keeper) SaveDenom( + ctx sdk.Context, + id, + symbol, + name, + schema string, + creator sdk.AccAddress, + description, + previewUri string, + uri, + uriHash, + data string, +) error { + denomMetadata := &types.DenomMetadata{ + Creator: creator.String(), + Schema: schema, + PreviewUri: previewUri, + Data: data, + } + metadata, err := codectypes.NewAnyWithValue(denomMetadata) + if err != nil { + return err + } + err = k.nk.SaveClass(ctx, nft.Class{ + Id: id, + Name: name, + Symbol: symbol, + Description: description, + Uri: uri, + UriHash: uriHash, + Data: metadata, + }) + if err != nil { + return err + } + // emit events + k.emitCreateONFTDenomEvent(ctx, id, symbol, name, creator.String()) + + return nil +} + +// TransferDenomOwner transfers the ownership to new address +func (k Keeper) TransferDenomOwner( + ctx sdk.Context, + denomID string, + srcOwner, + dstOwner sdk.AccAddress, +) error { + denom, err := k.GetDenomInfo(ctx, denomID) + if err != nil { + return err + } + sender := srcOwner.String() + recipient := dstOwner.String() + + // authorize + if sender != denom.Creator { + return errorsmod.Wrapf( + sdkerrors.ErrUnauthorized, + "%s is not allowed to transfer denom %s", sender, + denomID, + ) + } + + denomMetadata := &types.DenomMetadata{ + Creator: recipient, + Schema: denom.Schema, + PreviewUri: denom.PreviewURI, + Data: denom.Data, + } + data, err := codectypes.NewAnyWithValue(denomMetadata) + if err != nil { + return err + } + class := nft.Class{ + Id: denom.Id, + Name: denom.Name, + Symbol: denom.Symbol, + Description: denom.Description, + Uri: denom.Uri, + UriHash: denom.UriHash, + Data: data, + } + + err = k.nk.UpdateClass(ctx, class) + if err != nil { + return err + } + k.emitTransferONFTDenomEvent(ctx, denomID, denom.Symbol, sender, recipient) + return nil +} + +func (k Keeper) HasDenom(ctx sdk.Context, id string) bool { + return k.nk.HasClass(ctx, id) +} + +func (k Keeper) UpdateDenom(ctx sdk.Context, msg *types.MsgUpdateDenom) error { + denom, err := k.GetDenomInfo(ctx, msg.Id) + if err != nil { + return err + } + + // authorize + if msg.Sender != denom.Creator { + return errorsmod.Wrapf( + sdkerrors.ErrUnauthorized, + "%s is not allowed to transfer denom %s", msg.Sender, + denom.Id, + ) + } + + denomMetadata := &types.DenomMetadata{ + Creator: denom.Creator, + Schema: denom.Schema, + PreviewUri: denom.PreviewURI, + Data: denom.Data, + } + if msg.PreviewURI != types.DoNotModify { + denomMetadata.PreviewUri = msg.PreviewURI + } + data, err := codectypes.NewAnyWithValue(denomMetadata) + if err != nil { + return err + } + class := nft.Class{ + Id: denom.Id, + Name: denom.Name, + Symbol: denom.Symbol, + Description: denom.Description, + Uri: denom.Uri, + UriHash: denom.UriHash, + Data: data, + } + if msg.Name != types.DoNotModify { + class.Name = msg.Name + } + if msg.Description != types.DoNotModify { + class.Description = msg.Description + } + k.emitUpdateONFTDenomEvent(ctx, class.Id, class.Name, class.Description, denomMetadata.PreviewUri, msg.Sender) + return k.nk.UpdateClass(ctx, class) +} + +func (k Keeper) GetDenoms(ctx sdk.Context) (denoms []types.Denom, err error) { + classes := k.nk.GetClasses(ctx) + for _, class := range classes { + var denomMetadata types.DenomMetadata + if err := k.cdc.Unmarshal(class.Data.GetValue(), &denomMetadata); err != nil { + return nil, err + } + denoms = append(denoms, types.Denom{ + Id: class.Id, + Name: class.Name, + Schema: denomMetadata.Schema, + Creator: denomMetadata.Creator, + Symbol: class.Symbol, + Description: class.Description, + PreviewURI: denomMetadata.PreviewUri, + Uri: class.Uri, + UriHash: class.UriHash, + }) + } + return denoms, nil +} + +func (k Keeper) AuthorizeDenomCreator(ctx sdk.Context, id string, creator sdk.AccAddress) error { + denom, err := k.GetDenomInfo(ctx, id) + if err != nil { + return err + } + + if creator.String() != denom.Creator { + return errorsmod.Wrap(types.ErrUnauthorized, creator.String()) + } + return nil +} + +func (k Keeper) HasPermissionToMint(ctx sdk.Context, denomID string, sender sdk.AccAddress) bool { + denom, err := k.GetDenomInfo(ctx, denomID) + if err != nil { + return false + } + + if sender.String() == denom.Creator { + return true + } + return false +} + +func (k Keeper) GetDenomInfo(ctx sdk.Context, denomID string) (*types.Denom, error) { + class, ok := k.nk.GetClass(ctx, denomID) + if !ok { + return nil, errorsmod.Wrapf(types.ErrInvalidDenom, "denom ID %s not exists", denomID) + } + + var denomMetadata types.DenomMetadata + if err := k.cdc.Unmarshal(class.Data.GetValue(), &denomMetadata); err != nil { + return nil, err + } + return &types.Denom{ + Id: class.Id, + Name: class.Name, + Schema: denomMetadata.Schema, + Creator: denomMetadata.Creator, + Symbol: class.Symbol, + Description: class.Description, + PreviewURI: denomMetadata.PreviewUri, + Uri: class.Uri, + UriHash: class.UriHash, + }, nil +} diff --git a/x/onft/keeper/events.go b/x/onft/keeper/events.go new file mode 100644 index 00000000..e61b602f --- /dev/null +++ b/x/onft/keeper/events.go @@ -0,0 +1,78 @@ +package keeper + +import ( + onfttypes "github.com/OmniFlix/omniflixhub/v2/x/onft/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k Keeper) emitCreateONFTDenomEvent(ctx sdk.Context, denomId, symbol, name, creator string) { + ctx.EventManager().EmitEvent( + sdk.NewEvent( + onfttypes.EventTypeCreateONFTDenom, + sdk.NewAttribute(onfttypes.AttributeKeyDenomID, denomId), + sdk.NewAttribute(onfttypes.AttributeKeySymbol, symbol), + sdk.NewAttribute(onfttypes.AttributeKeyName, name), + sdk.NewAttribute(onfttypes.AttributeKeyCreator, creator), + ), + ) +} + +func (k Keeper) emitUpdateONFTDenomEvent(ctx sdk.Context, denomId, name, description, previewURI, creator string) { + ctx.EventManager().EmitEvent( + sdk.NewEvent( + onfttypes.EventTypeUpdateONFTDenom, + sdk.NewAttribute(onfttypes.AttributeKeyDenomID, denomId), + sdk.NewAttribute(onfttypes.AttributeKeyName, name), + sdk.NewAttribute(onfttypes.AttributeKeyDescription, description), + sdk.NewAttribute(onfttypes.AttributeKeyPreviewURI, previewURI), + sdk.NewAttribute(onfttypes.AttributeKeyCreator, creator), + ), + ) +} + +func (k Keeper) emitTransferONFTDenomEvent(ctx sdk.Context, denomId, symbol, sender, recipient string) { + ctx.EventManager().EmitEvent( + sdk.NewEvent( + onfttypes.EventTypeTransferONFTDenom, + sdk.NewAttribute(onfttypes.AttributeKeyDenomID, denomId), + sdk.NewAttribute(onfttypes.AttributeKeySymbol, symbol), + sdk.NewAttribute(onfttypes.AttributeKeySender, sender), + sdk.NewAttribute(onfttypes.AttributeKeyRecipient, recipient), + ), + ) +} + +func (k Keeper) emitMintONFTEvent(ctx sdk.Context, nftId, denomId, uri, owner string) { + ctx.EventManager().EmitEvent( + sdk.NewEvent( + onfttypes.EventTypeMintONFT, + sdk.NewAttribute(onfttypes.AttributeKeyNFTID, nftId), + sdk.NewAttribute(onfttypes.AttributeKeyDenomID, denomId), + sdk.NewAttribute(onfttypes.AttributeKeyMediaURI, uri), + sdk.NewAttribute(onfttypes.AttributeKeyOwner, owner), + ), + ) +} + +func (k Keeper) emitTransferONFTEvent(ctx sdk.Context, nftId, denomId, sender, recipient string) { + ctx.EventManager().EmitEvent( + sdk.NewEvent( + onfttypes.EventTypeTransferONFT, + sdk.NewAttribute(onfttypes.AttributeKeyNFTID, nftId), + sdk.NewAttribute(onfttypes.AttributeKeyDenomID, denomId), + sdk.NewAttribute(onfttypes.AttributeKeySender, sender), + sdk.NewAttribute(onfttypes.AttributeKeyRecipient, recipient), + ), + ) +} + +func (k Keeper) emitBurnONFTEvent(ctx sdk.Context, nftId, denomId, owner string) { + ctx.EventManager().EmitEvent( + sdk.NewEvent( + onfttypes.EventTypeBurnONFT, + sdk.NewAttribute(onfttypes.AttributeKeyNFTID, nftId), + sdk.NewAttribute(onfttypes.AttributeKeyDenomID, denomId), + sdk.NewAttribute(onfttypes.AttributeKeyOwner, owner), + ), + ) +} diff --git a/x/onft/keeper/grpc_query.go b/x/onft/keeper/grpc_query.go new file mode 100644 index 00000000..9f90fd63 --- /dev/null +++ b/x/onft/keeper/grpc_query.go @@ -0,0 +1,284 @@ +package keeper + +import ( + "context" + "strings" + + "github.com/cosmos/cosmos-sdk/x/nft" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/OmniFlix/omniflixhub/v2/x/onft/types" +) + +var _ types.QueryServer = Keeper{} + +func (k Keeper) Supply(c context.Context, request *types.QuerySupplyRequest) (*types.QuerySupplyResponse, error) { + denom := strings.ToLower(strings.TrimSpace(request.DenomId)) + ctx := sdk.UnwrapSDKContext(c) + + var supply uint64 + switch { + case len(request.Owner) == 0 && len(denom) > 0: + supply = k.GetTotalSupply(ctx, denom) + default: + owner, err := sdk.AccAddressFromBech32(request.Owner) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid owner address %s", request.Owner) + } + supply = k.GetBalance(ctx, denom, owner) + } + return &types.QuerySupplyResponse{ + Amount: supply, + }, nil +} + +func (k Keeper) Collection(c context.Context, request *types.QueryCollectionRequest) (*types.QueryCollectionResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + denom, err := k.GetDenomInfo(ctx, request.DenomId) + if err != nil { + return nil, err + } + + r := &nft.QueryNFTsRequest{ + ClassId: request.DenomId, + Pagination: shapePageRequest(request.Pagination), + } + + result, err := k.nk.NFTs(c, r) + if err != nil { + return nil, err + } + + var nfts []types.ONFT + for _, _nft := range result.Nfts { + owner := k.nk.GetOwner(ctx, request.DenomId, _nft.Id) + + nftMetadata, err := types.UnmarshalNFTMetadata(k.cdc, _nft.Data.GetValue()) + if err != nil { + return nil, err + } + + nfts = append(nfts, types.ONFT{ + Id: _nft.Id, + Metadata: types.Metadata{ + Name: nftMetadata.Name, + Description: nftMetadata.Description, + MediaURI: _nft.Uri, + UriHash: _nft.UriHash, + PreviewURI: nftMetadata.PreviewURI, + }, + Owner: owner.String(), + Data: nftMetadata.Data, + Transferable: nftMetadata.Transferable, + Extensible: nftMetadata.Extensible, + CreatedAt: nftMetadata.CreatedAt, + Nsfw: nftMetadata.Nsfw, + RoyaltyShare: nftMetadata.RoyaltyShare, + }) + } + + collection := &types.Collection{ + Denom: *denom, + ONFTs: nfts, + } + + response := &types.QueryCollectionResponse{ + Collection: collection, + Pagination: result.Pagination, + } + + return response, nil +} + +func (k Keeper) IBCCollection(c context.Context, request *types.QueryIBCCollectionRequest) (*types.QueryCollectionResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + + denom, err := k.GetDenomInfo(ctx, "ibc/"+request.Hash) + if err != nil { + return nil, err + } + + r := &nft.QueryNFTsRequest{ + ClassId: denom.Id, + Pagination: shapePageRequest(request.Pagination), + } + + result, err := k.nk.NFTs(c, r) + if err != nil { + return nil, err + } + var onfts []types.ONFT + for _, _nft := range result.Nfts { + owner := k.nk.GetOwner(ctx, denom.Id, _nft.Id) + + nftMetadata, err := types.UnmarshalNFTMetadata(k.cdc, _nft.Data.GetValue()) + if err != nil { + return nil, err + } + + onfts = append(onfts, types.ONFT{ + Id: _nft.Id, + Metadata: types.Metadata{ + Name: nftMetadata.Name, + Description: nftMetadata.Description, + MediaURI: _nft.Uri, + UriHash: _nft.UriHash, + PreviewURI: nftMetadata.PreviewURI, + }, + Owner: owner.String(), + Data: nftMetadata.Data, + Transferable: nftMetadata.Transferable, + Extensible: nftMetadata.Extensible, + CreatedAt: nftMetadata.CreatedAt, + Nsfw: nftMetadata.Nsfw, + RoyaltyShare: nftMetadata.RoyaltyShare, + }) + } + + collection := &types.Collection{ + Denom: *denom, + ONFTs: onfts, + } + return &types.QueryCollectionResponse{ + Collection: collection, + Pagination: result.Pagination, + }, nil +} + +func (k Keeper) Denom(c context.Context, request *types.QueryDenomRequest) (*types.QueryDenomResponse, error) { + denom := strings.ToLower(strings.TrimSpace(request.DenomId)) + ctx := sdk.UnwrapSDKContext(c) + + denomObject, err := k.GetDenomInfo(ctx, denom) + if err != nil { + return nil, err + } + + return &types.QueryDenomResponse{ + Denom: denomObject, + }, nil +} + +func (k Keeper) IBCDenom(c context.Context, request *types.QueryIBCDenomRequest) (*types.QueryDenomResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + + denomObject, err := k.GetDenomInfo(ctx, "ibc/"+request.Hash) + if err != nil { + return nil, err + } + + return &types.QueryDenomResponse{ + Denom: denomObject, + }, nil +} + +func (k Keeper) Denoms(c context.Context, request *types.QueryDenomsRequest) (*types.QueryDenomsResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + result, err := k.nk.Classes(c, &nft.QueryClassesRequest{ + Pagination: shapePageRequest(request.Pagination), + }) + if err != nil { + return nil, err + } + var denoms []types.Denom + if request.Owner != "" { + owner, err := sdk.AccAddressFromBech32(request.Owner) + if err != nil { + return nil, err + } + for _, class := range result.Classes { + denom, err := k.GetDenomInfo(ctx, class.Id) + if err != nil { + return nil, err + } + if denom.Creator == owner.String() { + denoms = append(denoms, *denom) + } + } + } else { + for _, class := range result.Classes { + denom, err := k.GetDenomInfo(ctx, class.Id) + if err != nil { + return nil, err + } + denoms = append(denoms, *denom) + } + } + return &types.QueryDenomsResponse{ + Denoms: denoms, + Pagination: result.Pagination, + }, nil +} + +func (k Keeper) ONFT(c context.Context, request *types.QueryONFTRequest) (*types.QueryONFTResponse, error) { + denom := strings.ToLower(strings.TrimSpace(request.DenomId)) + onftID := strings.ToLower(strings.TrimSpace(request.Id)) + ctx := sdk.UnwrapSDKContext(c) + + onft, err := k.GetONFT(ctx, denom, onftID) + if err != nil { + return nil, errorsmod.Wrapf(types.ErrUnknownONFT, "invalid ONFT %s from collection %s", request.Id, request.DenomId) + } + + oNFT, ok := onft.(types.ONFT) + if !ok { + return nil, errorsmod.Wrapf(types.ErrUnknownONFT, "invalid type ONFT %s from collection %s", request.Id, request.DenomId) + } + + return &types.QueryONFTResponse{ + ONFT: &oNFT, + }, nil +} + +func (k Keeper) OwnerONFTs(c context.Context, request *types.QueryOwnerONFTsRequest) (*types.QueryOwnerONFTsResponse, error) { + r := &nft.QueryNFTsRequest{ + ClassId: request.DenomId, + Owner: request.Owner, + Pagination: shapePageRequest(request.Pagination), + } + + result, err := k.nk.NFTs(c, r) + if err != nil { + return nil, err + } + + denomMap := make(map[string][]string) + var denoms []string + for _, _nft := range result.Nfts { + if denomMap[_nft.ClassId] == nil { + denomMap[_nft.ClassId] = []string{} + denoms = append(denoms, _nft.ClassId) + } + denomMap[_nft.ClassId] = append(denomMap[_nft.ClassId], _nft.Id) + } + + var idc []types.IDCollection + for _, denomID := range denoms { + idc = append(idc, types.IDCollection{ + DenomId: denomID, + OnftIds: denomMap[denomID], + }) + } + + response := &types.QueryOwnerONFTsResponse{ + Owner: &types.Owner{ + Address: request.Owner, + IDCollections: idc, + }, + Pagination: result.Pagination, + } + + return response, nil +} + +// Params queries params of oNFT module +func (k Keeper) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + params := k.GetParams(ctx) + return &types.QueryParamsResponse{Params: params}, nil +} diff --git a/x/onft/keeper/keeper.go b/x/onft/keeper/keeper.go new file mode 100644 index 00000000..917039eb --- /dev/null +++ b/x/onft/keeper/keeper.go @@ -0,0 +1,63 @@ +package keeper + +import ( + "fmt" + + "github.com/cometbft/cometbft/libs/log" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + nftkeeper "github.com/cosmos/cosmos-sdk/x/nft/keeper" + + "github.com/OmniFlix/omniflixhub/v2/x/onft/types" +) + +type Keeper struct { + storeKey storetypes.StoreKey + cdc codec.BinaryCodec + + accountKeeper types.AccountKeeper + bankKeeper types.BankKeeper + distributionKeeper types.DistributionKeeper + nk nftkeeper.Keeper + authority string +} + +func NewKeeper( + cdc codec.BinaryCodec, + storeKey storetypes.StoreKey, + accountKeeper types.AccountKeeper, + bankKeeper types.BankKeeper, + distrKeeper types.DistributionKeeper, + authority string, +) Keeper { + // ensure oNFT module account is set + if addr := accountKeeper.GetModuleAddress(types.ModuleName); addr == nil { + panic(fmt.Sprintf("%s module account has not been set", types.ModuleName)) + } + + return Keeper{ + storeKey: storeKey, + cdc: cdc, + accountKeeper: accountKeeper, + bankKeeper: bankKeeper, + distributionKeeper: distrKeeper, + nk: nftkeeper.NewKeeper(storeKey, cdc, accountKeeper, bankKeeper), + authority: authority, + } +} + +// GetAuthority returns the onft module's authority. +func (k Keeper) GetAuthority() string { + return k.authority +} + +func (k Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", fmt.Sprintf("OmniFlix/%s", types.ModuleName)) +} + +// NFTkeeper returns a cosmos-sdk nftkeeper.Keeper. +func (k Keeper) NFTkeeper() nftkeeper.Keeper { + return k.nk +} diff --git a/x/onft/keeper/migrator.go b/x/onft/keeper/migrator.go new file mode 100644 index 00000000..7697ae11 --- /dev/null +++ b/x/onft/keeper/migrator.go @@ -0,0 +1,28 @@ +package keeper + +import ( + "github.com/OmniFlix/omniflixhub/v2/x/onft/exported" + v2 "github.com/OmniFlix/omniflixhub/v2/x/onft/migrations/v2" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// Migrator is a struct for handling in-place state migrations. +type Migrator struct { + keeper Keeper + legacySubspace exported.Subspace +} + +func NewMigrator(k Keeper, ss exported.Subspace) Migrator { + return Migrator{ + keeper: k, + legacySubspace: ss, + } +} + +// Migrate1to2 migrates the onft module state from the consensus version 1 to +// version 2. Specifically, it takes the parameters that are currently stored +// and managed by the x/params modules and stores them directly into the onft +// module state. +func (m Migrator) Migrate1to2(ctx sdk.Context) error { + return v2.Migrate(ctx, m.keeper.storeKey, m.legacySubspace, m.keeper.cdc, m.keeper) +} diff --git a/x/onft/keeper/msg_server.go b/x/onft/keeper/msg_server.go new file mode 100644 index 00000000..93c9cfe5 --- /dev/null +++ b/x/onft/keeper/msg_server.go @@ -0,0 +1,207 @@ +package keeper + +import ( + "context" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + + errorsmod "cosmossdk.io/errors" + "github.com/OmniFlix/omniflixhub/v2/x/onft/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +type msgServer struct { + Keeper +} + +var _ types.MsgServer = msgServer{} + +// NewMsgServerImpl returns an implementation of the NFT MsgServer interface +// for the provided Keeper. +func NewMsgServerImpl(keeper Keeper) types.MsgServer { + return &msgServer{Keeper: keeper} +} + +func (m msgServer) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { + if m.authority != req.Authority { + return nil, errorsmod.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", m.authority, req.Authority) + } + + ctx := sdk.UnwrapSDKContext(goCtx) + if err := m.SetParams(ctx, req.Params); err != nil { + return nil, err + } + + return &types.MsgUpdateParamsResponse{}, nil +} + +func (m msgServer) CreateDenom(goCtx context.Context, msg *types.MsgCreateDenom) (*types.MsgCreateDenomResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + sender, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + return nil, err + } + if m.Keeper.HasDenom(ctx, msg.Id) { + return nil, errorsmod.Wrapf(types.ErrDenomIdExists, "denom id already exists %s", msg.Id) + } + denomCreationFee := m.Keeper.GetDenomCreationFee(ctx) + if !msg.CreationFee.Equal(denomCreationFee) { + if msg.CreationFee.Denom != denomCreationFee.Denom { + return nil, errorsmod.Wrapf(types.ErrInvalidFeeDenom, "invalid creation fee denom %s", + msg.CreationFee.Denom) + } + if msg.CreationFee.Amount.LT(denomCreationFee.Amount) { + return nil, errorsmod.Wrapf( + types.ErrNotEnoughFeeAmount, + "%s fee is not enough, to create %s fee is required", + msg.CreationFee.String(), + denomCreationFee.String(), + ) + } + return nil, errorsmod.Wrapf( + types.ErrInvalidDenomCreationFee, + "given fee (%s) not matched with denom creation fee. %s required to create onft denom", + msg.CreationFee.String(), + denomCreationFee.String(), + ) + } + if err := m.Keeper.SaveDenom(ctx, + msg.Id, + msg.Symbol, + msg.Name, + msg.Schema, + sender, + msg.Description, + msg.PreviewURI, + msg.Uri, + msg.UriHash, + msg.Data, + ); err != nil { + return nil, err + } + + return &types.MsgCreateDenomResponse{}, nil +} + +func (m msgServer) UpdateDenom(goCtx context.Context, msg *types.MsgUpdateDenom) (*types.MsgUpdateDenomResponse, error) { + _, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + return nil, err + } + + ctx := sdk.UnwrapSDKContext(goCtx) + err = m.Keeper.UpdateDenom(ctx, msg) + if err != nil { + return nil, err + } + return &types.MsgUpdateDenomResponse{}, nil +} + +func (m msgServer) TransferDenom(goCtx context.Context, msg *types.MsgTransferDenom) (*types.MsgTransferDenomResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + sender, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + return nil, err + } + recipient, err := sdk.AccAddressFromBech32(msg.Recipient) + if err != nil { + return nil, err + } + + err = m.Keeper.TransferDenomOwner(ctx, msg.Id, sender, recipient) + if err != nil { + return nil, err + } + + return &types.MsgTransferDenomResponse{}, nil +} + +func (m msgServer) MintONFT(goCtx context.Context, msg *types.MsgMintONFT) (*types.MsgMintONFTResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + sender, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + return nil, err + } + recipient, err := sdk.AccAddressFromBech32(msg.Recipient) + if err != nil { + return nil, err + } + if !m.Keeper.HasPermissionToMint(ctx, msg.DenomId, sender) { + return nil, errorsmod.Wrapf( + sdkerrors.ErrUnauthorized, + "%s is not allowed to mint nft under denom %s", + sender.String(), + msg.DenomId, + ) + } + + if m.Keeper.HasONFT(ctx, msg.DenomId, msg.Id) { + return nil, errorsmod.Wrapf( + types.ErrONFTAlreadyExists, + "ONFT with id %s already exists in collection %s", msg.Id, msg.DenomId) + } + if err := m.Keeper.MintONFT(ctx, + msg.DenomId, + msg.Id, + msg.Metadata.Name, + msg.Metadata.Description, + msg.Metadata.MediaURI, + msg.Metadata.UriHash, + msg.Metadata.PreviewURI, + msg.Data, + ctx.BlockTime(), + msg.Transferable, + msg.Extensible, + msg.Nsfw, + msg.RoyaltyShare, + recipient, + ); err != nil { + return nil, err + } + + return &types.MsgMintONFTResponse{}, nil +} + +func (m msgServer) TransferONFT(goCtx context.Context, + msg *types.MsgTransferONFT, +) (*types.MsgTransferONFTResponse, error) { + sender, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + return nil, err + } + + recipient, err := sdk.AccAddressFromBech32(msg.Recipient) + if err != nil { + return nil, err + } + + ctx := sdk.UnwrapSDKContext(goCtx) + if err := m.Keeper.TransferOwnership(ctx, msg.DenomId, msg.Id, + sender, + recipient, + ); err != nil { + return nil, err + } + + return &types.MsgTransferONFTResponse{}, nil +} + +func (m msgServer) BurnONFT(goCtx context.Context, + msg *types.MsgBurnONFT, +) (*types.MsgBurnONFTResponse, error) { + sender, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + return nil, err + } + + ctx := sdk.UnwrapSDKContext(goCtx) + if err := m.Keeper.BurnONFT(ctx, msg.DenomId, msg.Id, sender); err != nil { + return nil, err + } + + return &types.MsgBurnONFTResponse{}, nil +} diff --git a/x/onft/keeper/onft.go b/x/onft/keeper/onft.go new file mode 100644 index 00000000..776701e3 --- /dev/null +++ b/x/onft/keeper/onft.go @@ -0,0 +1,226 @@ +package keeper + +import ( + "time" + + errorsmod "cosmossdk.io/errors" + "github.com/OmniFlix/omniflixhub/v2/x/onft/exported" + "github.com/OmniFlix/omniflixhub/v2/x/onft/types" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/nft" +) + +func (k Keeper) MintONFT( + ctx sdk.Context, + denomID, + nftID, + name, + description, + mediaURI, + uriHash, + previewURI, + nftData string, + createdAt time.Time, + transferable, + extensible, + nsfw bool, + royaltyShare sdk.Dec, + receiver sdk.AccAddress, +) error { + nftMetadata := &types.ONFTMetadata{ + Name: name, + Description: description, + PreviewURI: previewURI, + Data: nftData, + Transferable: transferable, + Extensible: extensible, + Nsfw: nsfw, + CreatedAt: createdAt, + RoyaltyShare: royaltyShare, + } + data, err := codectypes.NewAnyWithValue(nftMetadata) + if err != nil { + return err + } + err = k.nk.Mint(ctx, nft.NFT{ + ClassId: denomID, + Id: nftID, + Uri: mediaURI, + UriHash: uriHash, + Data: data, + }, receiver) + if err != nil { + return err + } + k.emitMintONFTEvent(ctx, nftID, denomID, mediaURI, receiver.String()) + return nil +} + +func (k Keeper) TransferOwnership(ctx sdk.Context, denomID, onftID string, srcOwner, dstOwner sdk.AccAddress) error { + if !k.nk.HasClass(ctx, denomID) { + return errorsmod.Wrapf(types.ErrInvalidDenom, "denomID %s not exists", denomID) + } + onft, exist := k.nk.GetNFT(ctx, denomID, onftID) + if !exist { + return errorsmod.Wrapf(types.ErrInvalidONFT, "nft ID %s not exists", onftID) + } + + err := k.Authorize(ctx, denomID, onftID, srcOwner) + if err != nil { + return err + } + onftMetadata, err := types.UnmarshalNFTMetadata(k.cdc, onft.Data.GetValue()) + if err != nil { + return errorsmod.Wrapf(types.ErrInvalidONFTMetadata, "unable to parse nft metadata") + } + + if !onftMetadata.Transferable { + return errorsmod.Wrap(types.ErrNotTransferable, onft.GetId()) + } + err = k.nk.Transfer(ctx, denomID, onftID, dstOwner) + if err != nil { + return err + } + k.emitTransferONFTEvent(ctx, onftID, denomID, srcOwner.String(), dstOwner.String()) + return nil +} + +func (k Keeper) BurnONFT( + ctx sdk.Context, + denomID, + onftID string, + owner sdk.AccAddress, +) error { + if !k.nk.HasClass(ctx, denomID) { + return errorsmod.Wrapf(types.ErrInvalidDenom, "denomID %s not exists", denomID) + } + _, exist := k.nk.GetNFT(ctx, denomID, onftID) + if !exist { + return errorsmod.Wrapf(types.ErrInvalidONFT, "nft ID %s not exists", onftID) + } + + err := k.Authorize(ctx, denomID, onftID, owner) + if err != nil { + return err + } + + err = k.nk.Burn(ctx, denomID, onftID) + if err != nil { + return err + } + k.emitBurnONFTEvent(ctx, onftID, denomID, owner.String()) + return nil +} + +func (k Keeper) GetONFT(ctx sdk.Context, denomID, onftID string) (nft exported.ONFTI, err error) { + if !k.nk.HasClass(ctx, denomID) { + return nil, errorsmod.Wrapf(types.ErrInvalidDenom, "denomID %s not exists", denomID) + } + onft, exist := k.nk.GetNFT(ctx, denomID, onftID) + if !exist { + return nil, errorsmod.Wrapf(types.ErrInvalidONFT, "not found NFT: %s", onftID) + } + + nftMetadata, err := types.UnmarshalNFTMetadata(k.cdc, onft.Data.GetValue()) + if err != nil { + return nil, err + } + + owner := k.nk.GetOwner(ctx, denomID, onftID) + metadata := types.Metadata{ + Name: nftMetadata.Name, + Description: nftMetadata.Description, + MediaURI: onft.Uri, + PreviewURI: nftMetadata.PreviewURI, + } + return types.ONFT{ + Id: onft.Id, + Metadata: metadata, + Data: nftMetadata.Data, + Owner: owner.String(), + Transferable: nftMetadata.Transferable, + Extensible: nftMetadata.Extensible, + Nsfw: nftMetadata.Extensible, + CreatedAt: nftMetadata.CreatedAt, + RoyaltyShare: nftMetadata.RoyaltyShare, + }, nil +} + +func (k Keeper) GetONFTs(ctx sdk.Context, denomID string) (onfts []exported.ONFTI, err error) { + nfts := k.nk.GetNFTsOfClass(ctx, denomID) + for _, _nft := range nfts { + + nftMetadata, err := types.UnmarshalNFTMetadata(k.cdc, _nft.Data.GetValue()) + if err != nil { + return nil, err + } + + owner := k.nk.GetOwner(ctx, denomID, _nft.GetId()) + metadata := types.Metadata{ + Name: nftMetadata.Name, + Description: nftMetadata.Description, + MediaURI: _nft.Uri, + PreviewURI: nftMetadata.PreviewURI, + } + onfts = append(onfts, types.ONFT{ + Id: _nft.GetId(), + Metadata: metadata, + Data: nftMetadata.Data, + Owner: owner.String(), + Transferable: nftMetadata.Transferable, + Extensible: nftMetadata.Extensible, + Nsfw: nftMetadata.Extensible, + CreatedAt: nftMetadata.CreatedAt, + RoyaltyShare: nftMetadata.RoyaltyShare, + }) + } + return onfts, nil +} + +func (k Keeper) GetOwnerONFTs(ctx sdk.Context, denomID string, owner sdk.AccAddress) (onfts []exported.ONFTI, err error) { + nfts := k.nk.GetNFTsOfClassByOwner(ctx, denomID, owner) + for _, _nft := range nfts { + + nftMetadata, err := types.UnmarshalNFTMetadata(k.cdc, _nft.Data.GetValue()) + if err != nil { + return nil, err + } + + owner := k.nk.GetOwner(ctx, denomID, _nft.GetId()) + metadata := types.Metadata{ + Name: nftMetadata.Name, + Description: nftMetadata.Description, + MediaURI: _nft.Uri, + PreviewURI: nftMetadata.PreviewURI, + } + onfts = append(onfts, types.ONFT{ + Id: _nft.GetId(), + Metadata: metadata, + Data: nftMetadata.Data, + Owner: owner.String(), + Transferable: nftMetadata.Transferable, + Extensible: nftMetadata.Extensible, + Nsfw: nftMetadata.Extensible, + CreatedAt: nftMetadata.CreatedAt, + RoyaltyShare: nftMetadata.RoyaltyShare, + }) + } + return onfts, nil +} + +func (k Keeper) Authorize( + ctx sdk.Context, + denomID, + onftID string, + owner sdk.AccAddress, +) error { + if !owner.Equals(k.nk.GetOwner(ctx, denomID, onftID)) { + return errorsmod.Wrapf(types.ErrUnauthorized, "%s is not authorized", owner.String()) + } + return nil +} + +func (k Keeper) HasONFT(ctx sdk.Context, denomID, onftID string) bool { + return k.nk.HasNFT(ctx, denomID, onftID) +} diff --git a/x/onft/keeper/pagination.go b/x/onft/keeper/pagination.go new file mode 100644 index 00000000..f49f4443 --- /dev/null +++ b/x/onft/keeper/pagination.go @@ -0,0 +1,39 @@ +package keeper + +import "github.com/cosmos/cosmos-sdk/types/query" + +var ( + paginationDefaultLimit uint64 = 100 + paginationMaxLimit uint64 = 100 +) + +// shapePageRequest shapes the PageRequest params to avoid querying all items. +// PageRequest.offset is forbidden and PageRequest.count_total must be zero. +// PageRequest.limit mustn't exceed paginationMaxLimit and is set to +// paginationDefaultLimit when unset. +func shapePageRequest(req *query.PageRequest) *query.PageRequest { + res := newDefaultPageRequest() + + if req == nil { + return res + } + + res.Key = req.Key + res.Reverse = req.Reverse + if req.Limit > 0 && req.Limit <= paginationMaxLimit { + res.Limit = req.Limit + } + + return res +} + +// newDefaultPageRequest returns a default PageRequest. +func newDefaultPageRequest() *query.PageRequest { + return &query.PageRequest{ + Key: nil, + Offset: 0, + Limit: paginationDefaultLimit, + CountTotal: false, + Reverse: false, + } +} diff --git a/x/onft/keeper/params.go b/x/onft/keeper/params.go new file mode 100644 index 00000000..80f571aa --- /dev/null +++ b/x/onft/keeper/params.go @@ -0,0 +1,35 @@ +package keeper + +import ( + "github.com/OmniFlix/omniflixhub/v2/x/onft/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// GetParams gets the parameters for the onft module. +func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.ParamsKey) + if bz == nil { + return params + } + k.cdc.MustUnmarshal(bz, ¶ms) + return params +} + +// SetParams sets the parameters for the onft module. +func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error { + if err := params.ValidateBasic(); err != nil { + return err + } + + store := ctx.KVStore(k.storeKey) + bz := k.cdc.MustMarshal(¶ms) + store.Set(types.ParamsKey, bz) + return nil +} + +// GetDenomCreationFee returns the current denom creation fee coins list and amounts. +func (k Keeper) GetDenomCreationFee(ctx sdk.Context) sdk.Coin { + params := k.GetParams(ctx) + return params.DenomCreationFee +} diff --git a/x/onft/migrations/v2/expected_keepers.go b/x/onft/migrations/v2/expected_keepers.go new file mode 100644 index 00000000..68ea37c2 --- /dev/null +++ b/x/onft/migrations/v2/expected_keepers.go @@ -0,0 +1,22 @@ +package v2 + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// NFTKeeper save the denom of class +type NFTKeeper interface { + SaveDenom( + ctx sdk.Context, + id, + symbol, + name, + schema string, + creator sdk.AccAddress, + description, + previewUri string, + uri, + uriHash, + data string, + ) error +} diff --git a/x/onft/migrations/v2/keeper.go b/x/onft/migrations/v2/keeper.go new file mode 100644 index 00000000..03ea3e76 --- /dev/null +++ b/x/onft/migrations/v2/keeper.go @@ -0,0 +1,184 @@ +package v2 + +import ( + "reflect" + "time" + "unsafe" + + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/address" + "github.com/cosmos/cosmos-sdk/x/nft" + nftkeeper "github.com/cosmos/cosmos-sdk/x/nft/keeper" + + "github.com/OmniFlix/omniflixhub/v2/x/onft/types" +) + +type keeper struct { + storeKey storetypes.StoreKey + cdc codec.BinaryCodec + + nftKeeper NFTKeeper +} + +func (k keeper) saveNFT( + ctx sdk.Context, + denomID, + nftID, + nftName, + nftDescription, + nftMediaURI, + nftPreviewURI, + nftURIHash, + nftData string, + extensible, + transferable, + nsfw bool, + nftCreatedAt time.Time, + nftRoyaltyShare sdk.Dec, + recipient sdk.AccAddress, +) error { + nftMetadata := &types.ONFTMetadata{ + Name: nftName, + Description: nftDescription, + PreviewURI: nftPreviewURI, + Extensible: extensible, + Transferable: transferable, + Nsfw: nsfw, + Data: nftData, + CreatedAt: nftCreatedAt, + RoyaltyShare: nftRoyaltyShare, + UriHash: nftURIHash, + } + data, err := codectypes.NewAnyWithValue(nftMetadata) + if err != nil { + return err + } + + nftObj := nft.NFT{ + ClassId: denomID, + Id: nftID, + Uri: nftMediaURI, + UriHash: nftURIHash, + Data: data, + } + k.setNFT(ctx, nftObj) + k.setOwner(ctx, nftObj.ClassId, nftObj.Id, recipient) + k.incrTotalSupply(ctx, nftObj.ClassId) + return nil +} + +func (k keeper) setNFT(ctx sdk.Context, token nft.NFT) { + nftStore := k.getNFTStore(ctx, token.ClassId) + bz := k.cdc.MustMarshal(&token) + nftStore.Set([]byte(token.Id), bz) +} + +func (k keeper) setOwner(ctx sdk.Context, classID, nftID string, owner sdk.AccAddress) { + store := ctx.KVStore(k.storeKey) + store.Set(ownerStoreKey(classID, nftID), owner.Bytes()) + + ownerStore := k.getClassStoreByOwner(ctx, owner, classID) + ownerStore.Set([]byte(nftID), nftkeeper.Placeholder) +} + +func (k keeper) incrTotalSupply(ctx sdk.Context, classID string) { + supply := k.GetTotalSupply(ctx, classID) + 1 + k.updateTotalSupply(ctx, classID, supply) +} + +// GetTotalSupply returns the number of all nfts under the specified classID +func (k keeper) GetTotalSupply(ctx sdk.Context, classID string) uint64 { + store := ctx.KVStore(k.storeKey) + bz := store.Get(classTotalSupply(classID)) + return sdk.BigEndianToUint64(bz) +} + +func (k keeper) updateTotalSupply(ctx sdk.Context, classID string, supply uint64) { + store := ctx.KVStore(k.storeKey) + supplyKey := classTotalSupply(classID) + store.Set(supplyKey, sdk.Uint64ToBigEndian(supply)) +} + +func (k keeper) getClassStoreByOwner(ctx sdk.Context, owner sdk.AccAddress, classID string) prefix.Store { + store := ctx.KVStore(k.storeKey) + key := nftOfClassByOwnerStoreKey(owner, classID) + return prefix.NewStore(store, key) +} + +func (k keeper) getNFTStore(ctx sdk.Context, classID string) prefix.Store { + store := ctx.KVStore(k.storeKey) + return prefix.NewStore(store, nftStoreKey(classID)) +} + +// classTotalSupply returns the byte representation of the ClassTotalSupply +func classTotalSupply(classID string) []byte { + key := make([]byte, len(nftkeeper.ClassTotalSupply)+len(classID)) + copy(key, nftkeeper.ClassTotalSupply) + copy(key[len(nftkeeper.ClassTotalSupply):], classID) + return key +} + +// nftStoreKey returns the byte representation of the nft +func nftStoreKey(classID string) []byte { + key := make([]byte, len(nftkeeper.NFTKey)+len(classID)+len(nftkeeper.Delimiter)) + copy(key, nftkeeper.NFTKey) + copy(key[len(nftkeeper.NFTKey):], classID) + copy(key[len(nftkeeper.NFTKey)+len(classID):], nftkeeper.Delimiter) + return key +} + +// ownerStoreKey returns the byte representation of the nft owner +// Items are stored with the following key: values +// 0x04 +func ownerStoreKey(classID, nftID string) []byte { + // key is of format: + classIDBz := UnsafeStrToBytes(classID) + nftIDBz := UnsafeStrToBytes(nftID) + + key := make([]byte, len(nftkeeper.OwnerKey)+len(classIDBz)+len(nftkeeper.Delimiter)+len(nftIDBz)) + copy(key, nftkeeper.OwnerKey) + copy(key[len(nftkeeper.OwnerKey):], classIDBz) + copy(key[len(nftkeeper.OwnerKey)+len(classIDBz):], nftkeeper.Delimiter) + copy(key[len(nftkeeper.OwnerKey)+len(classIDBz)+len(nftkeeper.Delimiter):], nftIDBz) + return key +} + +// nftOfClassByOwnerStoreKey returns the byte representation of the nft owner +// Items are stored with the following key: values +// 0x03 +func nftOfClassByOwnerStoreKey(owner sdk.AccAddress, classID string) []byte { + owner = address.MustLengthPrefix(owner) + classIDBz := UnsafeStrToBytes(classID) + + key := make([]byte, len(nftkeeper.NFTOfClassByOwnerKey)+len(owner)+len(nftkeeper.Delimiter)+len(classIDBz)+len(nftkeeper.Delimiter)) + copy(key, nftkeeper.NFTOfClassByOwnerKey) + copy(key[len(nftkeeper.NFTOfClassByOwnerKey):], owner) + copy(key[len(nftkeeper.NFTOfClassByOwnerKey)+len(owner):], nftkeeper.Delimiter) + copy(key[len(nftkeeper.NFTOfClassByOwnerKey)+len(owner)+len(nftkeeper.Delimiter):], classIDBz) + copy(key[len(nftkeeper.NFTOfClassByOwnerKey)+len(owner)+len(nftkeeper.Delimiter)+len(classIDBz):], nftkeeper.Delimiter) + return key +} + +// UnsafeStrToBytes uses unsafe to convert string into byte array. Returned bytes +// must not be altered after this function is called as it will cause a segmentation fault. +func UnsafeStrToBytes(s string) []byte { + var buf []byte + sHdr := (*reflect.StringHeader)(unsafe.Pointer(&s)) + bufHdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) + bufHdr.Data = sHdr.Data + bufHdr.Cap = sHdr.Len + bufHdr.Len = sHdr.Len + return buf +} + +// UnsafeBytesToStr is meant to make a zero allocation conversion +// from []byte -> string to speed up operations, it is not meant +// to be used generally, but for a specific pattern to delete keys +// from a map. +func UnsafeBytesToStr(b []byte) string { + return *(*string)(unsafe.Pointer(&b)) +} diff --git a/x/onft/migrations/v2/keys.go b/x/onft/migrations/v2/keys.go new file mode 100644 index 00000000..98e52b1a --- /dev/null +++ b/x/onft/migrations/v2/keys.go @@ -0,0 +1,102 @@ +package v2 + +import ( + "bytes" + "errors" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var ( + PrefixONFT = []byte{0x01} + PrefixOwners = []byte{0x02} + PrefixCollection = []byte{0x03} + PrefixDenom = []byte{0x04} + PrefixDenomSymbol = []byte{0x05} + PrefixCreator = []byte{0x06} + + delimiter = []byte("/") +) + +func SplitKeyOwner(key []byte) (address sdk.AccAddress, denom, id string, err error) { + key = key[len(PrefixOwners)+len(delimiter):] + keys := bytes.Split(key, delimiter) + if len(keys) != 3 { + return address, denom, id, errors.New("wrong KeyOwner") + } + + address, _ = sdk.AccAddressFromBech32(string(keys[0])) + denom = string(keys[1]) + id = string(keys[2]) + return +} + +func SplitKeyDenom(key []byte) (denomID, nftID string, err error) { + keys := bytes.Split(key, delimiter) + if len(keys) != 2 { + return denomID, nftID, errors.New("wrong KeyOwner") + } + + denomID = string(keys[0]) + nftID = string(keys[1]) + return +} + +func KeyOwner(address sdk.AccAddress, denomID, onftID string) []byte { + key := append(PrefixOwners, delimiter...) + if address != nil { + key = append(key, []byte(address.String())...) + key = append(key, delimiter...) + } + + if address != nil && len(denomID) > 0 { + key = append(key, []byte(denomID)...) + key = append(key, delimiter...) + } + + if address != nil && len(denomID) > 0 && len(onftID) > 0 { + key = append(key, []byte(onftID)...) + } + return key +} + +func KeyONFT(denomID, onftID string) []byte { + key := append(PrefixONFT, delimiter...) + if len(denomID) > 0 { + key = append(key, []byte(denomID)...) + key = append(key, delimiter...) + } + + if len(denomID) > 0 && len(onftID) > 0 { + key = append(key, []byte(onftID)...) + } + return key +} + +func KeyCollection(denomID string) []byte { + key := append(PrefixCollection, delimiter...) + return append(key, []byte(denomID)...) +} + +func KeyDenomID(id string) []byte { + key := append(PrefixDenom, delimiter...) + return append(key, []byte(id)...) +} + +func KeyDenomCreator(address sdk.AccAddress, denomId string) []byte { + key := append(PrefixCreator, delimiter...) + if address != nil { + key = append(key, []byte(address)...) + key = append(key, delimiter...) + } + if address != nil && len(denomId) > 0 { + key = append(key, []byte(denomId)...) + key = append(key, delimiter...) + } + return key +} + +func KeyDenomSymbol(symbol string) []byte { + key := append(PrefixDenomSymbol, delimiter...) + return append(key, []byte(symbol)...) +} diff --git a/x/onft/migrations/v2/migrate.go b/x/onft/migrations/v2/migrate.go new file mode 100644 index 00000000..cbc678d9 --- /dev/null +++ b/x/onft/migrations/v2/migrate.go @@ -0,0 +1,46 @@ +package v2 + +import ( + "github.com/OmniFlix/omniflixhub/v2/x/onft/exported" + "github.com/OmniFlix/omniflixhub/v2/x/onft/types" + "github.com/cosmos/cosmos-sdk/codec" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +const ( + ModuleName = "onft" +) + +var ParamsKey = []byte{0x07} + +// Migrate migrates the onft module state from the consensus version 1 to +// version 2. Specifically, it takes the parameters that are currently stored +// and managed by the x/params modules and stores them directly into the onft +// module state. +func Migrate( + ctx sdk.Context, + storeKey storetypes.StoreKey, + legacySubspace exported.Subspace, + cdc codec.BinaryCodec, + nftKeeper NFTKeeper, +) error { + var currParams types.Params + legacySubspace.GetParamSet(ctx, &currParams) + + k := keeper{ + storeKey: storeKey, + cdc: cdc, + nftKeeper: nftKeeper, + } + + if err := currParams.ValidateBasic(); err != nil { + return err + } + store := ctx.KVStore(k.storeKey) + + bz := cdc.MustMarshal(&currParams) + store.Set(ParamsKey, bz) + + return MigrateCollections(ctx, storeKey, cdc, ctx.Logger(), k) +} diff --git a/x/onft/migrations/v2/migrator_test.go b/x/onft/migrations/v2/migrator_test.go new file mode 100644 index 00000000..e1cd94de --- /dev/null +++ b/x/onft/migrations/v2/migrator_test.go @@ -0,0 +1,45 @@ +package v2_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "github.com/OmniFlix/omniflixhub/v2/x/onft" + "github.com/OmniFlix/omniflixhub/v2/x/onft/exported" + v2 "github.com/OmniFlix/omniflixhub/v2/x/onft/migrations/v2" + "github.com/OmniFlix/omniflixhub/v2/x/onft/types" + "github.com/cosmos/cosmos-sdk/testutil" + sdk "github.com/cosmos/cosmos-sdk/types" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" +) + +type mockSubspace struct { + ps types.Params +} + +func newMockSubspace(ps types.Params) mockSubspace { + return mockSubspace{ps: ps} +} + +func (ms mockSubspace) GetParamSet(ctx sdk.Context, ps exported.ParamSet) { + *ps.(*types.Params) = ms.ps +} + +func TestMigrate(t *testing.T) { + encCfg := moduletestutil.MakeTestEncodingConfig(onft.AppModuleBasic{}) + cdc := encCfg.Codec + + storeKey := sdk.NewKVStoreKey(v2.ModuleName) + tKey := sdk.NewTransientStoreKey("transient_test") + ctx := testutil.DefaultContext(storeKey, tKey) + store := ctx.KVStore(storeKey) + + legacySubspace := newMockSubspace(types.DefaultParams()) + require.NoError(t, v2.Migrate(ctx, storeKey, legacySubspace, cdc, nil)) + + var res types.Params + bz := store.Get(v2.ParamsKey) + require.NoError(t, cdc.Unmarshal(bz, &res)) + require.Equal(t, legacySubspace.ps, res) +} diff --git a/x/onft/migrations/v2/store.go b/x/onft/migrations/v2/store.go new file mode 100644 index 00000000..b2b13613 --- /dev/null +++ b/x/onft/migrations/v2/store.go @@ -0,0 +1,132 @@ +package v2 + +import ( + "time" + + "github.com/cometbft/cometbft/libs/log" + + "github.com/cosmos/cosmos-sdk/codec" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/OmniFlix/omniflixhub/v2/x/onft/types" +) + +// MigrateCollections is used to migrate nft data from onft to x/nft +func MigrateCollections(ctx sdk.Context, + storeKey storetypes.StoreKey, + cdc codec.BinaryCodec, + logger log.Logger, + k keeper, +) error { + logger.Info("migrate store data from version 1 to 2") + startTime := time.Now() + + store := ctx.KVStore(storeKey) + iterator := sdk.KVStorePrefixIterator(store, KeyDenomID("")) + defer iterator.Close() + + var ( + totkalDenoms int64 + totalNFTs int64 + ) + for ; iterator.Valid(); iterator.Next() { + var denom types.Denom + cdc.MustUnmarshal(iterator.Value(), &denom) + + // delete unused key + store.Delete(KeyDenomID(denom.Id)) + store.Delete(KeyDenomSymbol(denom.Name)) + store.Delete(KeyCollection(denom.Id)) + + creator, err := sdk.AccAddressFromBech32(denom.Creator) + if err != nil { + return err + } + + if err := k.nftKeeper.SaveDenom( + ctx, + denom.Id, + denom.Symbol, + denom.Name, + denom.Schema, + creator, + denom.Description, + denom.PreviewURI, + denom.Uri, + denom.UriHash, + denom.Data, + ); err != nil { + return err + } + + totalNFTsInDenom, err := migrateONFT(ctx, k, logger, denom.Id) + if err != nil { + return err + } + totkalDenoms++ + totalNFTs += totalNFTsInDenom + + } + logger.Info("migrate store data success", + "Total Denoms", totkalDenoms, + "total NFTs", totalNFTs, + "time taken", time.Since(startTime).String(), + ) + return nil +} + +func migrateONFT( + ctx sdk.Context, + k keeper, + logger log.Logger, + denomID string, +) (int64, error) { + var iterator sdk.Iterator + defer func() { + if iterator != nil { + _ = iterator.Close() + } + }() + + store := ctx.KVStore(k.storeKey) + + total := int64(0) + iterator = sdk.KVStorePrefixIterator(store, KeyONFT(denomID, "")) + for ; iterator.Valid(); iterator.Next() { + var oNFT types.ONFT + k.cdc.MustUnmarshal(iterator.Value(), &oNFT) + + owner, err := sdk.AccAddressFromBech32(oNFT.Owner) + if err != nil { + return 0, err + } + + // delete unused key + store.Delete(KeyONFT(denomID, oNFT.Id)) + store.Delete(KeyOwner(owner, denomID, oNFT.Id)) + + if err := k.saveNFT( + ctx, + denomID, + oNFT.Id, + oNFT.Metadata.Name, + oNFT.Metadata.Description, + oNFT.Metadata.MediaURI, + oNFT.Metadata.PreviewURI, + oNFT.Metadata.UriHash, + oNFT.Data, + oNFT.Extensible, + oNFT.Transferable, + oNFT.Nsfw, + oNFT.CreatedAt, + oNFT.RoyaltyShare, + owner, + ); err != nil { + return 0, err + } + total++ + } + logger.Info("migrate onft collection success", "DenomID", denomID, "TotalNFTs", total) + return total, nil +} diff --git a/x/onft/module.go b/x/onft/module.go new file mode 100644 index 00000000..6c7f0d14 --- /dev/null +++ b/x/onft/module.go @@ -0,0 +1,166 @@ +package onft + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/OmniFlix/omniflixhub/v2/x/onft/exported" + + "github.com/OmniFlix/omniflixhub/v2/x/onft/simulation" + abci "github.com/cometbft/cometbft/abci/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/gogoproto/grpc" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + + "github.com/OmniFlix/omniflixhub/v2/x/onft/client/cli" + "github.com/OmniFlix/omniflixhub/v2/x/onft/keeper" + "github.com/OmniFlix/omniflixhub/v2/x/onft/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" +) + +var ( + _ module.AppModule = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleSimulation = AppModule{} +) + +// ConsensusVersion defines the current onft module consensus version. +const ConsensusVersion = 2 + +type AppModuleBasic struct { + cdc codec.Codec +} + +func (AppModuleBasic) Name() string { return types.ModuleName } + +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + types.RegisterLegacyAminoCodec(cdc) +} + +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(DefaultGenesisState()) +} + +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error { + var data types.GenesisState + if err := cdc.UnmarshalJSON(bz, &data); err != nil { + return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) + } + + return types.ValidateGenesis(data) +} + +func (AppModuleBasic) GetTxCmd() *cobra.Command { + return cli.NewTxCmd() +} + +func (AppModuleBasic) GetQueryCmd() *cobra.Command { + return cli.GetQueryCmd() +} + +func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { + types.RegisterInterfaces(registry) +} + +type AppModule struct { + AppModuleBasic + keeper keeper.Keeper + accountKeeper types.AccountKeeper + bankKeeper types.BankKeeper + distributionKeeper types.DistributionKeeper + legacySubspace exported.Subspace +} + +func (am AppModule) RegisterQueryService(server grpc.Server) { + types.RegisterQueryServer(server, am.keeper) +} + +func NewAppModule(cdc codec.Codec, keeper keeper.Keeper, accountKeeper types.AccountKeeper, + bankKeeper types.BankKeeper, distrKeeper types.DistributionKeeper, ss exported.Subspace, +) AppModule { + return AppModule{ + AppModuleBasic: AppModuleBasic{cdc: cdc}, + keeper: keeper, + accountKeeper: accountKeeper, + bankKeeper: bankKeeper, + distributionKeeper: distrKeeper, + legacySubspace: ss, + } +} + +func (AppModule) Name() string { return types.ModuleName } + +func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) { +} + +func (AppModule) QuerierRoute() string { return types.RouterKey } + +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { + panic(err) + } +} + +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) + // x/params migration + m := keeper.NewMigrator(am.keeper, am.legacySubspace) + + if err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2); err != nil { + panic(fmt.Sprintf("failed to migrate %s from version 1 to 2: %v", types.ModuleName, err)) + } +} + +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { + var genesisState types.GenesisState + + cdc.MustUnmarshalJSON(data, &genesisState) + + InitGenesis(ctx, am.keeper, genesisState) + return []abci.ValidatorUpdate{} +} + +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { + gs := ExportGenesis(ctx, am.keeper) + return cdc.MustMarshalJSON(gs) +} + +func (AppModule) ConsensusVersion() uint64 { + return ConsensusVersion +} + +func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} + +func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { + return []abci.ValidatorUpdate{} +} + +// AppModuleSimulation functions + +// GenerateGenesisState creates a randomized GenState of the onft module. +func (AppModule) GenerateGenesisState(simState *module.SimulationState) { + simulation.RandomizedGenState(simState) +} + +// RegisterStoreDecoder registers a decoder for onft module's types +func (am AppModule) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) { + sdr[types.StoreKey] = simulation.NewDecodeStore(am.cdc) +} + +func (am AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalMsg { + return nil +} + +// WeightedOperations returns the all the onft module operations with their respective weights. +func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { + return simulation.WeightedOperations( + simState.AppParams, simState.Cdc, am.keeper, am.accountKeeper, am.bankKeeper, + ) +} diff --git a/x/onft/simulation/decoder.go b/x/onft/simulation/decoder.go new file mode 100644 index 00000000..7509e630 --- /dev/null +++ b/x/onft/simulation/decoder.go @@ -0,0 +1,38 @@ +package simulation + +import ( + "bytes" + "fmt" + + "github.com/OmniFlix/omniflixhub/v2/x/onft/types" + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/types/kv" +) + +func NewDecodeStore(cdc codec.Codec) func(kvA, kvB kv.Pair) string { + return func(kvA, kvB kv.Pair) string { + switch { + case bytes.Equal(kvA.Key[:1], types.PrefixONFT): + var nftA, nftB types.ONFT + cdc.MustUnmarshal(kvA.Value, &nftA) + cdc.MustUnmarshal(kvB.Value, &nftB) + return fmt.Sprintf("%v\n%v", nftA, nftB) + case bytes.Equal(kvA.Key[:1], types.PrefixOwners): + idA := types.MustUnMarshalONFTID(cdc, kvA.Value) + idB := types.MustUnMarshalDenomID(cdc, kvB.Value) + return fmt.Sprintf("%v\n%v", idA, idB) + case bytes.Equal(kvA.Key[:1], types.PrefixCollection): + supplyA := types.MustUnMarshalSupply(cdc, kvA.Value) + supplyB := types.MustUnMarshalSupply(cdc, kvB.Value) + return fmt.Sprintf("%d\n%d", supplyA, supplyB) + case bytes.Equal(kvA.Key[:1], types.PrefixDenom): + var denomA, denomB types.Denom + cdc.MustUnmarshal(kvA.Value, &denomA) + cdc.MustUnmarshal(kvB.Value, &denomB) + return fmt.Sprintf("%v\n%v", denomA, denomB) + + default: + panic(fmt.Sprintf("invalid %s key prefix %X", types.ModuleName, kvA.Key[:1])) + } + } +} diff --git a/x/onft/simulation/genesis.go b/x/onft/simulation/genesis.go new file mode 100644 index 00000000..5f2e0acb --- /dev/null +++ b/x/onft/simulation/genesis.go @@ -0,0 +1,103 @@ +package simulation + +import ( + "encoding/json" + "fmt" + "math/rand" + "strings" + "time" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/cosmos/cosmos-sdk/types/module" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + + "github.com/OmniFlix/omniflixhub/v2/x/onft/types" +) + +const ( + denomName1 = "denom1" + denomName2 = "denom2" + denomId1 = "onftdenom1" + denomId2 = "onftdenom2" +) + +// RandomizedGenState generates a random GenesisState for nft +func RandomizedGenState(simState *module.SimulationState) { + collections := types.NewCollections( + types.NewCollection( + types.Denom{ + Id: denomId1, + Name: denomName1, + Schema: "{}", + Creator: "", + Symbol: "denom1", + Description: simtypes.RandStringOfLength(simState.Rand, 45), + PreviewURI: simtypes.RandStringOfLength(simState.Rand, 45), + }, + types.ONFTs{}, + ), + types.NewCollection( + types.Denom{ + Id: denomId2, + Name: denomName2, + Schema: "{}", + Creator: "", + Symbol: "denom2", + Description: simtypes.RandStringOfLength(simState.Rand, 45), + PreviewURI: simtypes.RandStringOfLength(simState.Rand, 45), + }, + types.ONFTs{}), + ) + for i, acc := range simState.Accounts { + if simState.Rand.Intn(100) < 10 { + oNFT := types.NewONFT( + RandID(simState.Rand, "onft", 10), + RandMetadata(simState.Rand), + "{}", + genRandomBool(simState.Rand), + genRandomBool(simState.Rand), + acc.Address, + time.Time{}, + genRandomBool(simState.Rand), + RandRoyaltyShare(simState.Rand), + ) + + if i < 50 { + collections[0].Denom.Creator = oNFT.Owner + collections[0] = collections[0].AddONFT(oNFT) + } else { + collections[1].Denom.Creator = oNFT.Owner + collections[1] = collections[1].AddONFT(oNFT) + } + } + } + + nftGenesis := types.NewGenesisState(collections, types.DefaultParams()) + + bz, err := json.MarshalIndent(nftGenesis, "", " ") + if err != nil { + panic(err) + } + fmt.Printf("Selected randomly generated %s parameters:\n%s\n", types.ModuleName, bz) + + simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(nftGenesis) +} + +func RandID(r *rand.Rand, prefix string, n int) string { + id := simtypes.RandStringOfLength(r, n) + return strings.ToLower(prefix + id) +} + +func RandMetadata(r *rand.Rand) types.Metadata { + return types.Metadata{ + Name: simtypes.RandStringOfLength(r, 10), + Description: simtypes.RandStringOfLength(r, 45), + PreviewURI: simtypes.RandStringOfLength(r, 45), + MediaURI: simtypes.RandStringOfLength(r, 45), + } +} + +func RandRoyaltyShare(r *rand.Rand) sdk.Dec { + return simtypes.RandomDecAmount(r, sdk.NewDecWithPrec(999999999999999999, 18)) +} diff --git a/x/onft/simulation/operations.go b/x/onft/simulation/operations.go new file mode 100644 index 00000000..2190a4bc --- /dev/null +++ b/x/onft/simulation/operations.go @@ -0,0 +1,466 @@ +package simulation + +import ( + "fmt" + "math/rand" + "strings" + + appparams "github.com/OmniFlix/omniflixhub/v2/app/params" + "github.com/OmniFlix/omniflixhub/v2/x/onft/keeper" + "github.com/OmniFlix/omniflixhub/v2/x/onft/types" + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/simulation" +) + +// Simulation operation weights constants +const ( + OpWeightMsgCreateDenom = "op_weight_msg_create_denom" + OpWeightMsgMintONFT = "op_weight_msg_mint_onft" + OpWeightMsgEditONFT = "op_weight_msg_edit_onft" + OpWeightMsgTransferONFT = "op_weight_msg_transfer_onft" + OpWeightMsgBurnONFT = "op_weight_msg_burn_onft" + OpWeightMsgTransferDenom = "op_weight_msg_transfer_denom" + OpWeightMsgUpdateDenom = "op_weight_msg_update_denom" +) + +// WeightedOperations returns all the operations from the module with their respective weights +func WeightedOperations( + appParams simtypes.AppParams, + cdc codec.JSONCodec, + k keeper.Keeper, + ak types.AccountKeeper, + bk types.BankKeeper, +) simulation.WeightedOperations { + var weightCreateDenom, weightMint, weightEdit, weightTransfer, weightBurn, weightUpdateDenom, weightTransferDenom int + + appParams.GetOrGenerate( + cdc, OpWeightMsgCreateDenom, &weightCreateDenom, nil, + func(_ *rand.Rand) { + weightCreateDenom = 50 + }, + ) + + appParams.GetOrGenerate( + cdc, OpWeightMsgMintONFT, &weightMint, nil, + func(_ *rand.Rand) { + weightMint = 100 + }, + ) + + appParams.GetOrGenerate( + cdc, OpWeightMsgEditONFT, &weightEdit, nil, + func(_ *rand.Rand) { + weightEdit = 50 + }, + ) + + appParams.GetOrGenerate( + cdc, OpWeightMsgTransferONFT, &weightTransfer, nil, + func(_ *rand.Rand) { + weightTransfer = 50 + }, + ) + appParams.GetOrGenerate( + cdc, OpWeightMsgBurnONFT, &weightBurn, nil, + func(_ *rand.Rand) { + weightBurn = 10 + }, + ) + appParams.GetOrGenerate( + cdc, OpWeightMsgTransferDenom, &weightTransferDenom, nil, + func(_ *rand.Rand) { + weightTransferDenom = 10 + }, + ) + appParams.GetOrGenerate( + cdc, OpWeightMsgUpdateDenom, &weightUpdateDenom, nil, + func(_ *rand.Rand) { + weightUpdateDenom = 10 + }, + ) + + return simulation.WeightedOperations{ + simulation.NewWeightedOperation( + weightCreateDenom, + SimulateMsgCreateDenom(k, ak, bk), + ), + simulation.NewWeightedOperation( + weightMint, + SimulateMsgMintONFT(k, ak, bk), + ), + simulation.NewWeightedOperation( + weightTransfer, + SimulateMsgTransferONFT(k, ak, bk), + ), + simulation.NewWeightedOperation( + weightBurn, + SimulateMsgBurnONFT(k, ak, bk), + ), + simulation.NewWeightedOperation( + weightTransferDenom, + SimulateMsgTransferDenom(k, ak, bk), + ), + simulation.NewWeightedOperation( + weightUpdateDenom, + SimulateMsgUpdateDenom(k, ak, bk), + ), + } +} + +// SimulateMsgCreateDenom simulates create denom msg +func SimulateMsgCreateDenom(k keeper.Keeper, ak types.AccountKeeper, bk types.BankKeeper) simtypes.Operation { + return func( + r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) ( + opMsg simtypes.OperationMsg, fOps []simtypes.FutureOperation, err error, + ) { + denomId := RandID(r, "onftdenom", 10) + denomName := strings.ToLower(simtypes.RandStringOfLength(r, 10)) + symbol := simtypes.RandStringOfLength(r, 5) + description := strings.ToLower(simtypes.RandStringOfLength(r, 10)) + previewURI := strings.ToLower(simtypes.RandStringOfLength(r, 10)) + URI := strings.ToLower(simtypes.RandStringOfLength(r, 10)) + URIHash := strings.ToLower(simtypes.RandStringOfLength(r, 10)) + sender, _ := simtypes.RandomAcc(r, accs) + creationFee := sdk.Coin{Denom: "uflix", Amount: sdk.NewInt(100_000_000)} + + msg := types.NewMsgCreateDenom( + symbol, + denomName, + "{}", + description, + URI, + URIHash, + previewURI, + "{}", + sender.Address.String(), + creationFee, + ) + msg.Id = denomId + denom, _ := k.GetDenomInfo(ctx, msg.Id) + if denom.Size() != 0 { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgCreateDenom, "denom exist"), nil, nil + } + account := ak.GetAccount(ctx, sender.Address) + spendableCoins := bk.SpendableCoins(ctx, account.GetAddress()) + if spendableCoins.Empty() { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgCreateDenom, "unable to create denom"), nil, nil + } + + txCtx := simulation.OperationInput{ + R: r, + App: app, + TxGen: appparams.MakeEncodingConfig().TxConfig, + Cdc: nil, + Msg: msg, + MsgType: types.TypeMsgCreateDenom, + Context: ctx, + SimAccount: sender, + AccountKeeper: ak, + Bankkeeper: bk, + ModuleName: types.ModuleName, + CoinsSpentInMsg: spendableCoins, + } + + return simulation.GenAndDeliverTxWithRandFees(txCtx) + } +} + +// SimulateMsgMintONFT simulates a mint onft transaction +func SimulateMsgMintONFT(k keeper.Keeper, ak types.AccountKeeper, bk types.BankKeeper) simtypes.Operation { + return func( + r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) ( + opMsg simtypes.OperationMsg, fOps []simtypes.FutureOperation, err error, + ) { + denom, err := getRandomDenom(ctx, k, r) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgMintONFT, err.Error()), nil, err + } + randomRecipient, _ := simtypes.RandomAcc(r, accs) + + msg := types.NewMsgMintONFT( + denom.Id, + denom.Creator, + randomRecipient.Address.String(), + RandMetadata(r), + "{}", + genRandomBool(r), + genRandomBool(r), + genRandomBool(r), + RandRoyaltyShare(r), + ) + onftId := RandID(r, "onft", 10) + msg.Id = onftId + minter, _ := sdk.AccAddressFromBech32(denom.Creator) + account := ak.GetAccount(ctx, minter) + spendableCoins := bk.SpendableCoins(ctx, account.GetAddress()) + + sender, found := simtypes.FindAccount(accs, minter) + if !found { + err = fmt.Errorf("account %s not found", msg.Sender) + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgMintONFT, err.Error()), nil, err + } + + txCtx := simulation.OperationInput{ + R: r, + App: app, + TxGen: appparams.MakeEncodingConfig().TxConfig, + Cdc: nil, + Msg: msg, + MsgType: types.TypeMsgMintONFT, + Context: ctx, + SimAccount: sender, + AccountKeeper: ak, + Bankkeeper: bk, + ModuleName: types.ModuleName, + CoinsSpentInMsg: spendableCoins, + } + + return simulation.GenAndDeliverTxWithRandFees(txCtx) + } +} + +// SimulateMsgTransferONFT simulates the transfer of an nft +func SimulateMsgTransferONFT(k keeper.Keeper, ak types.AccountKeeper, bk types.BankKeeper) simtypes.Operation { + return func( + r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) ( + opMsg simtypes.OperationMsg, fOps []simtypes.FutureOperation, err error, + ) { + ownerAddr, denom, nftID := getRandomNFTFromOwner(ctx, k, r) + if ownerAddr.Empty() { + err = fmt.Errorf("invalid account") + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTransferONFT, err.Error()), nil, err + } + if ownerAddr.Empty() { + err = fmt.Errorf("invalid account") + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTransferONFT, err.Error()), nil, err + } + + recipientAccount, _ := simtypes.RandomAcc(r, accs) + msg := types.NewMsgTransferONFT( + nftID, + denom, + ownerAddr.String(), // sender + recipientAccount.Address.String(), // recipient + ) + account := ak.GetAccount(ctx, ownerAddr) + + ownerAccount, found := simtypes.FindAccount(accs, ownerAddr) + if !found { + err = fmt.Errorf("account %s not found", msg.Sender) + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTransferONFT, err.Error()), nil, err + } + + spendableCoins := bk.SpendableCoins(ctx, account.GetAddress()) + + txCtx := simulation.OperationInput{ + R: r, + App: app, + TxGen: appparams.MakeEncodingConfig().TxConfig, + Cdc: nil, + Msg: msg, + MsgType: types.TypeMsgTransferONFT, + Context: ctx, + SimAccount: ownerAccount, + AccountKeeper: ak, + Bankkeeper: bk, + ModuleName: types.ModuleName, + CoinsSpentInMsg: spendableCoins, + } + + simOpMsg, fOps, err := simulation.GenAndDeliverTxWithRandFees(txCtx) + if err != nil { + nft, err := k.GetONFT(ctx, denom, nftID) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTransferONFT, err.Error()), nil, err + } + if !nft.IsTransferable() { + return simtypes.NewOperationMsg(msg, false, "non transferable nft", nil), nil, nil + } + } + return simOpMsg, fOps, err + } +} + +// SimulateMsgBurnONFT simulates a burn onft transaction +func SimulateMsgBurnONFT(k keeper.Keeper, ak types.AccountKeeper, bk types.BankKeeper) simtypes.Operation { + return func( + r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) ( + opMsg simtypes.OperationMsg, fOps []simtypes.FutureOperation, err error, + ) { + ownerAddr, denom, nftID := getRandomNFTFromOwner(ctx, k, r) + if ownerAddr.Empty() { + err = fmt.Errorf("invalid account") + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgBurnONFT, err.Error()), nil, err + } + + msg := types.NewMsgBurnONFT(denom, nftID, ownerAddr.String()) + + account := ak.GetAccount(ctx, ownerAddr) + spendableCoins := bk.SpendableCoins(ctx, account.GetAddress()) + + ownerAccount, found := simtypes.FindAccount(accs, ownerAddr) + if !found { + err = fmt.Errorf("account %s not found", msg.Sender) + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgBurnONFT, err.Error()), nil, err + } + + txCtx := simulation.OperationInput{ + R: r, + App: app, + TxGen: appparams.MakeEncodingConfig().TxConfig, + Cdc: nil, + Msg: msg, + MsgType: types.TypeMsgBurnONFT, + Context: ctx, + SimAccount: ownerAccount, + AccountKeeper: ak, + Bankkeeper: bk, + ModuleName: types.ModuleName, + CoinsSpentInMsg: spendableCoins, + } + + return simulation.GenAndDeliverTxWithRandFees(txCtx) + } +} + +// SimulateMsgTransferDenom simulates a transfer denom transaction +func SimulateMsgTransferDenom(k keeper.Keeper, ak types.AccountKeeper, bk types.BankKeeper) simtypes.Operation { + return func( + r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) ( + opMsg simtypes.OperationMsg, fOps []simtypes.FutureOperation, err error, + ) { + denom, err := getRandomDenom(ctx, k, r) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTransferDenom, err.Error()), nil, err + } + + creator, err := sdk.AccAddressFromBech32(denom.Creator) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTransferDenom, err.Error()), nil, err + } + account := ak.GetAccount(ctx, creator) + ownerAccount, found := simtypes.FindAccount(accs, account.GetAddress()) + if !found { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTransferDenom, "creator not found"), nil, nil + } + + recipient, _ := simtypes.RandomAcc(r, accs) + msg := types.NewMsgTransferDenom( + denom.Id, + denom.Creator, + recipient.Address.String(), + ) + + spendableCoins := bk.SpendableCoins(ctx, ownerAccount.Address) + + txCtx := simulation.OperationInput{ + R: r, + App: app, + TxGen: appparams.MakeEncodingConfig().TxConfig, + Cdc: nil, + Msg: msg, + MsgType: types.TypeMsgTransferDenom, + Context: ctx, + SimAccount: ownerAccount, + AccountKeeper: ak, + Bankkeeper: bk, + ModuleName: types.ModuleName, + CoinsSpentInMsg: spendableCoins, + } + + return simulation.GenAndDeliverTxWithRandFees(txCtx) + } +} + +// SimulateMsgUpdateDenom simulates a update denom transaction +func SimulateMsgUpdateDenom(k keeper.Keeper, ak types.AccountKeeper, bk types.BankKeeper) simtypes.Operation { + return func( + r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) ( + opMsg simtypes.OperationMsg, fOps []simtypes.FutureOperation, err error, + ) { + denom, err := getRandomDenom(ctx, k, r) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgUpdateDenom, err.Error()), nil, err + } + + creator, err := sdk.AccAddressFromBech32(denom.Creator) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgUpdateDenom, err.Error()), nil, err + } + account := ak.GetAccount(ctx, creator) + ownerAccount, found := simtypes.FindAccount(accs, account.GetAddress()) + if !found { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgUpdateDenom, "creator not found"), nil, nil + } + msg := types.NewMsgUpdateDenom( + denom.Id, + simtypes.RandStringOfLength(r, 10), + simtypes.RandStringOfLength(r, 45), + simtypes.RandStringOfLength(r, 45), + ownerAccount.Address.String(), + ) + + spendableCoins := bk.SpendableCoins(ctx, ownerAccount.Address) + + txCtx := simulation.OperationInput{ + R: r, + App: app, + TxGen: appparams.MakeEncodingConfig().TxConfig, + Cdc: nil, + Msg: msg, + MsgType: types.TypeMsgUpdateDenom, + Context: ctx, + SimAccount: ownerAccount, + AccountKeeper: ak, + Bankkeeper: bk, + ModuleName: types.ModuleName, + CoinsSpentInMsg: spendableCoins, + } + + return simulation.GenAndDeliverTxWithRandFees(txCtx) + } +} + +func getRandomNFTFromOwner(ctx sdk.Context, k keeper.Keeper, r *rand.Rand) (address sdk.AccAddress, denomID, nftID string) { + denom, err := getRandomDenom(ctx, k, r) + if err != nil { + return nil, "", "" + } + onfts, err := k.GetONFTs(ctx, denom.Id) + if err != nil { + return nil, "", "" + } + nftsLen := len(onfts) + if nftsLen == 0 { + return nil, "", "" + } + + // get random nft + i := r.Intn(nftsLen) + _nft := onfts[i] + + return _nft.GetOwner(), denomID, nftID +} + +func getRandomDenom(ctx sdk.Context, k keeper.Keeper, r *rand.Rand) (types.Denom, error) { + denoms := []string{denomId1, denomId2} + i := r.Intn(len(denoms)) + denom, _ := k.GetDenomInfo(ctx, denoms[i]) + if denom.Size() == 0 { + return types.Denom{}, fmt.Errorf("no denoms created") + } + return *denom, nil +} + +func genRandomBool(r *rand.Rand) bool { + return r.Int()%2 == 0 +} diff --git a/x/onft/types/builder.go b/x/onft/types/builder.go new file mode 100644 index 00000000..11020a70 --- /dev/null +++ b/x/onft/types/builder.go @@ -0,0 +1,347 @@ +package types + +import ( + "encoding/base64" + "encoding/hex" + "encoding/json" + "errors" + "fmt" + + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/nft" + proto "github.com/cosmos/gogoproto/proto" +) + +const ( + Namespace = "omniflix:" + KeyMediaFieldValue = "value" +) + +var ( + ClassKeyName = fmt.Sprintf("%s%s", Namespace, "name") + ClassKeySymbol = fmt.Sprintf("%s%s", Namespace, "symbol") + ClassKeyDescription = fmt.Sprintf("%s%s", Namespace, "description") + ClassKeyURIHash = fmt.Sprintf("%s%s", Namespace, "uri_hash") + ClassKeyCreator = fmt.Sprintf("%s%s", Namespace, "creator") + ClassKeySchema = fmt.Sprintf("%s%s", Namespace, "schema") + ClassKeyPreviewURI = fmt.Sprintf("%s%s", Namespace, "preview_uri") + nftKeyName = fmt.Sprintf("%s%s", Namespace, "name") + nftKeyURIHash = fmt.Sprintf("%s%s", Namespace, "uri_hash") + nftKeyPreviewURI = fmt.Sprintf("%s%s", Namespace, "preview_uri") + nftKeyDescription = fmt.Sprintf("%s%s", Namespace, "description") +) + +type ClassBuilder struct { + cdc codec.Codec + getModuleAddress func(string) sdk.AccAddress +} +type NFTBuilder struct { + cdc codec.Codec +} +type MediaField struct { + Value interface{} `json:"value"` + Mime string `json:"mime,omitempty"` +} + +func NewClassBuilder( + cdc codec.Codec, + getModuleAddress func(string) sdk.AccAddress, +) ClassBuilder { + return ClassBuilder{ + cdc: cdc, + getModuleAddress: getModuleAddress, + } +} + +// BuildMetadata encode class into the metadata format defined by ics721 +func (cb ClassBuilder) BuildMetadata(class nft.Class) (string, error) { + var message proto.Message + if err := cb.cdc.UnpackAny(class.Data, &message); err != nil { + return "", err + } + + metadata, ok := message.(*DenomMetadata) + if !ok { + return "", errors.New("unsupported classMetadata") + } + + kvals := make(map[string]interface{}) + if len(metadata.Data) > 0 { + err := json.Unmarshal([]byte(metadata.Data), &kvals) + if err != nil && IsIBCDenom(class.Id) { + // when classData is not a legal json, there is no need to parse the data + return base64.RawStdEncoding.EncodeToString([]byte(metadata.Data)), nil + } + // note: if metadata.Data is null, it may cause map to be redefined as nil + if kvals == nil { + kvals = make(map[string]interface{}) + } + } + creator, err := sdk.AccAddressFromBech32(metadata.Creator) + if err != nil { + return "", err + } + + hexCreator := hex.EncodeToString(creator) + kvals[ClassKeyName] = MediaField{Value: class.Name} + kvals[ClassKeySymbol] = MediaField{Value: class.Symbol} + kvals[ClassKeyDescription] = MediaField{Value: class.Description} + kvals[ClassKeyURIHash] = MediaField{Value: class.UriHash} + kvals[ClassKeyCreator] = MediaField{Value: hexCreator} + kvals[ClassKeySchema] = MediaField{Value: metadata.Schema} + kvals[ClassKeyPreviewURI] = MediaField{Value: metadata.PreviewUri} + data, err := json.Marshal(kvals) + if err != nil { + return "", err + } + return base64.RawStdEncoding.EncodeToString(data), nil +} + +// Build create a class from ics721 packetData +func (cb ClassBuilder) Build(classID, classURI, classData string) (nft.Class, error) { + classDataBz, err := base64.RawStdEncoding.DecodeString(classData) + if err != nil { + return nft.Class{}, err + } + + var ( + name = "" + symbol = "" + description = "" + uriHash = "" + schema = "" + previewURI = "" + creator = cb.getModuleAddress(ModuleName).String() + ) + + dataMap := make(map[string]interface{}) + if err := json.Unmarshal(classDataBz, &dataMap); err != nil { + denomMeta, err := codectypes.NewAnyWithValue(&DenomMetadata{ + Creator: creator, + Schema: schema, + Description: description, + PreviewUri: previewURI, + Data: string(classDataBz), + }) + if err != nil { + return nft.Class{}, err + } + return nft.Class{ + Id: classID, + Uri: classURI, + Name: name, + Symbol: symbol, + Description: description, + UriHash: uriHash, + Data: denomMeta, + }, nil + } + if v, ok := dataMap[ClassKeyName]; ok { + if vMap, ok := v.(map[string]interface{}); ok { + if vStr, ok := vMap[KeyMediaFieldValue].(string); ok { + name = vStr + delete(dataMap, ClassKeyName) + } + } + } + + if v, ok := dataMap[ClassKeySymbol]; ok { + if vMap, ok := v.(map[string]interface{}); ok { + if vStr, ok := vMap[KeyMediaFieldValue].(string); ok { + symbol = vStr + delete(dataMap, ClassKeySymbol) + } + } + } + + if v, ok := dataMap[ClassKeyDescription]; ok { + if vMap, ok := v.(map[string]interface{}); ok { + if vStr, ok := vMap[KeyMediaFieldValue].(string); ok { + description = vStr + delete(dataMap, ClassKeyDescription) + } + } + } + + if v, ok := dataMap[ClassKeyURIHash]; ok { + if vMap, ok := v.(map[string]interface{}); ok { + if vStr, ok := vMap[KeyMediaFieldValue].(string); ok { + uriHash = vStr + delete(dataMap, ClassKeyURIHash) + } + } + } + + if v, ok := dataMap[ClassKeyCreator]; ok { + if vMap, ok := v.(map[string]interface{}); ok { + if vStr, ok := vMap[KeyMediaFieldValue].(string); ok { + creatorAcc, err := sdk.AccAddressFromHexUnsafe(vStr) + if err != nil { + return nft.Class{}, err + } + creator = creatorAcc.String() + delete(dataMap, ClassKeyCreator) + } + } + } + + if v, ok := dataMap[ClassKeySchema]; ok { + if vMap, ok := v.(map[string]interface{}); ok { + if vStr, ok := vMap[KeyMediaFieldValue].(string); ok { + schema = vStr + delete(dataMap, ClassKeySchema) + } + } + } + + if v, ok := dataMap[ClassKeyPreviewURI]; ok { + if vMap, ok := v.(map[string]interface{}); ok { + if vStr, ok := vMap[KeyMediaFieldValue].(string); ok { + schema = vStr + delete(dataMap, ClassKeyPreviewURI) + } + } + } + + data := "" + if len(dataMap) > 0 { + dataBz, err := json.Marshal(dataMap) + if err != nil { + return nft.Class{}, err + } + data = string(dataBz) + } + + denomMeta, err := codectypes.NewAnyWithValue(&DenomMetadata{ + Creator: creator, + Schema: schema, + Data: data, + }) + if err != nil { + return nft.Class{}, err + } + + return nft.Class{ + Id: classID, + Uri: classURI, + Name: name, + Symbol: symbol, + Description: description, + UriHash: uriHash, + Data: denomMeta, + }, nil +} + +func NewNFTBuilder(cdc codec.Codec) NFTBuilder { + return NFTBuilder{ + cdc: cdc, + } +} + +// BuildMetadata encode nft into the metadata format defined by ics721 +func (nb NFTBuilder) BuildMetadata(_nft nft.NFT) (string, error) { + var message proto.Message + if err := nb.cdc.UnpackAny(_nft.Data, &message); err != nil { + return "", err + } + + nftMetadata, ok := message.(*ONFTMetadata) + if !ok { + return "", errors.New("unsupported classMetadata") + } + kvals := make(map[string]interface{}) + if len(nftMetadata.Data) > 0 { + err := json.Unmarshal([]byte(nftMetadata.Data), &kvals) + if err != nil && IsIBCDenom(_nft.ClassId) { + // when nftMetadata is not a legal json, there is no need to parse the data + return base64.RawStdEncoding.EncodeToString([]byte(nftMetadata.Data)), nil + } + // note: if nftMetadata.Data is null, it may cause map to be redefined as nil + if kvals == nil { + kvals = make(map[string]interface{}) + } + } + kvals[nftKeyName] = MediaField{Value: nftMetadata.Name} + kvals[nftKeyURIHash] = MediaField{Value: _nft.UriHash} + kvals[nftKeyPreviewURI] = MediaField{Value: nftMetadata.PreviewURI} + kvals[nftKeyDescription] = MediaField{Value: nftMetadata.Description} + data, err := json.Marshal(kvals) + if err != nil { + return "", err + } + return base64.RawStdEncoding.EncodeToString(data), nil +} + +// Build create a nft from ics721 packet data +func (nb NFTBuilder) Build(classId, nftID, nftURI, nftData string) (nft.NFT, error) { + nftDataBz, err := base64.RawStdEncoding.DecodeString(nftData) + if err != nil { + return nft.NFT{}, err + } + + dataMap := make(map[string]interface{}) + if err := json.Unmarshal(nftDataBz, &dataMap); err != nil { + metadata, err := codectypes.NewAnyWithValue(&ONFTMetadata{ + Data: string(nftDataBz), + }) + if err != nil { + return nft.NFT{}, err + } + + return nft.NFT{ + ClassId: classId, + Id: nftID, + Uri: nftURI, + Data: metadata, + }, nil + } + + var ( + name string + uriHash string + ) + if v, ok := dataMap[nftKeyName]; ok { + if vMap, ok := v.(map[string]interface{}); ok { + if vStr, ok := vMap[KeyMediaFieldValue].(string); ok { + name = vStr + delete(dataMap, nftKeyName) + } + } + } + + if v, ok := dataMap[nftKeyURIHash]; ok { + if vMap, ok := v.(map[string]interface{}); ok { + if vStr, ok := vMap[KeyMediaFieldValue].(string); ok { + uriHash = vStr + delete(dataMap, nftKeyURIHash) + } + } + } + + data := "" + if len(dataMap) > 0 { + dataBz, err := json.Marshal(dataMap) + if err != nil { + return nft.NFT{}, err + } + data = string(dataBz) + } + + metadata, err := codectypes.NewAnyWithValue(&ONFTMetadata{ + Name: name, + Data: data, + }) + if err != nil { + return nft.NFT{}, err + } + + return nft.NFT{ + ClassId: classId, + Id: nftID, + Uri: nftURI, + UriHash: uriHash, + Data: metadata, + }, nil +} diff --git a/x/onft/types/codec.go b/x/onft/types/codec.go new file mode 100644 index 00000000..01b6c601 --- /dev/null +++ b/x/onft/types/codec.go @@ -0,0 +1,65 @@ +package types + +import ( + "github.com/OmniFlix/omniflixhub/v2/x/onft/exported" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" + authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec" + "github.com/cosmos/gogoproto/proto" +) + +func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(&MsgCreateDenom{}, "OmniFlix/onft/MsgCreateDenom", nil) + cdc.RegisterConcrete(&MsgUpdateDenom{}, "OmniFlix/onft/MsgUpdateDenom", nil) + cdc.RegisterConcrete(&MsgTransferDenom{}, "OmniFlix/onft/MsgTransferDenom", nil) + cdc.RegisterConcrete(&MsgTransferONFT{}, "OmniFlix/onft/MsgTransferONFT", nil) + cdc.RegisterConcrete(&MsgMintONFT{}, "OmniFlix/onft/MsgMintONFT", nil) + cdc.RegisterConcrete(&MsgBurnONFT{}, "OmniFlix/onft/MsgBurnONFT", nil) + cdc.RegisterConcrete(&MsgUpdateParams{}, "OmniFlix/onft/MsgUpdateParams", nil) + + cdc.RegisterConcrete(&Params{}, "OmniFlix/onft/Params", nil) + + cdc.RegisterInterface((*exported.ONFTI)(nil), nil) +} + +func RegisterInterfaces(registry codectypes.InterfaceRegistry) { + registry.RegisterImplementations( + (*sdk.Msg)(nil), + &MsgCreateDenom{}, + &MsgUpdateDenom{}, + &MsgTransferDenom{}, + &MsgTransferONFT{}, + &MsgMintONFT{}, + &MsgBurnONFT{}, + &MsgUpdateParams{}, + ) + + registry.RegisterInterface( + "OmniFlix.onft.v1beta1.ONFTI", + (*exported.ONFTI)(nil), + &ONFT{}, + ) + registry.RegisterImplementations( + (*proto.Message)(nil), + &DenomMetadata{}, + &ONFTMetadata{}, + ) + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} + +var ( + amino = codec.NewLegacyAmino() + ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) +) + +func init() { + RegisterLegacyAminoCodec(amino) + + sdk.RegisterLegacyAminoCodec(amino) + // Register all Amino interfaces and concrete types on the authz Amino codec so that this can later be + // used to properly serialize MsgGrant and MsgExec instances + RegisterLegacyAminoCodec(authzcodec.Amino) + amino.Seal() +} diff --git a/x/onft/types/collection.go b/x/onft/types/collection.go new file mode 100644 index 00000000..236d03f1 --- /dev/null +++ b/x/onft/types/collection.go @@ -0,0 +1,26 @@ +package types + +import ( + "github.com/OmniFlix/omniflixhub/v2/x/onft/exported" +) + +func NewCollection(denom Denom, onfts []exported.ONFTI) (c Collection) { + c.Denom = denom + for _, onft := range onfts { + c = c.AddONFT(onft.(ONFT)) + } + return c +} + +func (c Collection) AddONFT(nft ONFT) Collection { + c.ONFTs = append(c.ONFTs, nft) + return c +} + +func (c Collection) Supply() int { + return len(c.ONFTs) +} + +func NewCollections(c ...Collection) []Collection { + return append([]Collection{}, c...) +} diff --git a/x/onft/types/constants.go b/x/onft/types/constants.go new file mode 100644 index 00000000..847471d7 --- /dev/null +++ b/x/onft/types/constants.go @@ -0,0 +1,14 @@ +package types + +const ( + MinDenomLen = 3 + MaxDenomLen = 64 + MinIDLen = 3 + MaxIDLen = 64 + MaxNameLen = 256 + MaxDescriptionLen = 4096 + MaxURILen = 256 + DoNotModify = "[do-not-modify]" + IDPrefix = "onft" + DenomPrefix = "onftdenom" +) diff --git a/x/onft/types/denom.go b/x/onft/types/denom.go new file mode 100644 index 00000000..a56838a5 --- /dev/null +++ b/x/onft/types/denom.go @@ -0,0 +1,17 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func NewDenom(id, symbol, name, schema string, creator sdk.AccAddress, description, previewURI string) Denom { + return Denom{ + Id: id, + Symbol: symbol, + Name: name, + Schema: schema, + Creator: creator.String(), + Description: description, + PreviewURI: previewURI, + } +} diff --git a/x/onft/types/errors.go b/x/onft/types/errors.go new file mode 100644 index 00000000..3d3e5dcb --- /dev/null +++ b/x/onft/types/errors.go @@ -0,0 +1,34 @@ +package types + +// DONTCOVER + +import ( + errorsmod "cosmossdk.io/errors" +) + +var ( + ErrInvalidCollection = errorsmod.Register(ModuleName, 3, "invalid ONFT collection") + ErrUnknownCollection = errorsmod.Register(ModuleName, 4, "unknown ONFT collection") + ErrInvalidONFT = errorsmod.Register(ModuleName, 5, "invalid ONFT") + ErrONFTAlreadyExists = errorsmod.Register(ModuleName, 6, "ONFT already exists") + ErrUnknownONFT = errorsmod.Register(ModuleName, 7, "unknown ONFT") + ErrEmptyMetaData = errorsmod.Register(ModuleName, 8, "ONFT MetaData can't be empty") + ErrUnauthorized = errorsmod.Register(ModuleName, 9, "unauthorized address") + ErrInvalidDenom = errorsmod.Register(ModuleName, 10, "invalid denom") + ErrInvalidONFTID = errorsmod.Register(ModuleName, 11, "invalid ID") + ErrInvalidONFTMeta = errorsmod.Register(ModuleName, 12, "invalid metadata") + ErrInvalidMediaURI = errorsmod.Register(ModuleName, 13, "invalid media URI") + ErrInvalidPreviewURI = errorsmod.Register(ModuleName, 14, "invalid preview URI") + ErrNotTransferable = errorsmod.Register(ModuleName, 15, "onft is not transferable") + ErrNotEditable = errorsmod.Register(ModuleName, 16, "onft is not editable") + ErrInvalidOption = errorsmod.Register(ModuleName, 17, "invalid option") + ErrInvalidName = errorsmod.Register(ModuleName, 18, "invalid name") + ErrInvalidDescription = errorsmod.Register(ModuleName, 19, "invalid description") + ErrInvalidURI = errorsmod.Register(ModuleName, 20, "invalid URI") + ErrInvalidPercentage = errorsmod.Register(ModuleName, 21, "invalid percentage") + ErrInvalidDenomCreationFee = errorsmod.Register(ModuleName, 22, "invalid denom creation fee") + ErrInvalidFeeDenom = errorsmod.Register(ModuleName, 23, "invalid creation fee denom") + ErrNotEnoughFeeAmount = errorsmod.Register(ModuleName, 24, "invalid creation fee amount") + ErrInvalidONFTMetadata = errorsmod.Register(ModuleName, 25, "invalid nft data") + ErrDenomIdExists = errorsmod.Register(ModuleName, 26, "denom exists") +) diff --git a/x/onft/types/events.go b/x/onft/types/events.go new file mode 100644 index 00000000..7171fd1d --- /dev/null +++ b/x/onft/types/events.go @@ -0,0 +1,24 @@ +package types + +const ( + EventTypeCreateONFTDenom = "create_onft_denom" + EventTypeUpdateONFTDenom = "update_onft_denom" + EventTypeTransferONFTDenom = "transfer_onft_denom" + + EventTypeMintONFT = "mint_onft" + EventTypeTransferONFT = "transfer_onft" + EventTypeBurnONFT = "burn_onft" + + AttributeValueCategory = ModuleName + AttributeKeySender = "sender" + AttributeKeyCreator = "creator" + AttributeKeyOwner = "owner" + AttributeKeyRecipient = "recipient" + AttributeKeyNFTID = "nft-id" + AttributeKeyDenomID = "denom-id" + AttributeKeySymbol = "symbol" + AttributeKeyName = "name" + AttributeKeyDescription = "description" + AttributeKeyMediaURI = "media-uri" + AttributeKeyPreviewURI = "preview-uri" +) diff --git a/x/onft/types/expected_keepers.go b/x/onft/types/expected_keepers.go new file mode 100644 index 00000000..16cdb70c --- /dev/null +++ b/x/onft/types/expected_keepers.go @@ -0,0 +1,26 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" +) + +// AccountKeeper defines the expected account keeper for query account +type AccountKeeper interface { + GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI + GetModuleAccount(ctx sdk.Context, name string) authtypes.ModuleAccountI + GetModuleAddress(module string) sdk.AccAddress +} + +// BankKeeper defines the expected interface needed to retrieve account balances. +type BankKeeper interface { + GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin + LockedCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins +} + +// DistributionKeeper defines the expected distribution keeper +type DistributionKeeper interface { + FundCommunityPool(ctx sdk.Context, amount sdk.Coins, sender sdk.AccAddress) error +} diff --git a/x/onft/types/genesis.go b/x/onft/types/genesis.go new file mode 100644 index 00000000..45f2c6d3 --- /dev/null +++ b/x/onft/types/genesis.go @@ -0,0 +1,68 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + errorsmod "github.com/pkg/errors" +) + +func NewGenesisState(collections []Collection, params Params) *GenesisState { + return &GenesisState{ + Collections: collections, + Params: params, + } +} + +func ValidateGenesis(data GenesisState) error { + for _, c := range data.Collections { + creator, err := sdk.AccAddressFromBech32(c.Denom.Creator) + if err != nil { + return err + } + if creator.Empty() { + return errorsmod.Wrap(sdkerrors.ErrInvalidAddress, "missing denom creator") + } + if err := ValidateDenomID(c.Denom.Id); err != nil { + return err + } + if err := ValidateDenomSymbol(c.Denom.Symbol); err != nil { + return err + } + if err := ValidateName(c.Denom.Name); err != nil { + return err + } + if err := ValidateDescription(c.Denom.Description); err != nil { + return err + } + if err := ValidateURI(c.Denom.PreviewURI); err != nil { + return err + } + + for _, nft := range c.ONFTs { + if nft.GetOwner().Empty() { + return errorsmod.Wrap(sdkerrors.ErrInvalidAddress, "missing onft owner") + } + + if err := ValidateONFTID(nft.GetID()); err != nil { + return err + } + if err := ValidateName(nft.GetName()); err != nil { + return err + } + if err := ValidateDescription(nft.GetDescription()); err != nil { + return err + } + + if err := ValidateURI(nft.GetMediaURI()); err != nil { + return err + } + if err := ValidateURI(nft.GetPreviewURI()); err != nil { + return err + } + } + } + if err := data.Params.ValidateBasic(); err != nil { + return err + } + return nil +} diff --git a/x/onft/types/genesis.pb.go b/x/onft/types/genesis.pb.go new file mode 100644 index 00000000..4fca295c --- /dev/null +++ b/x/onft/types/genesis.pb.go @@ -0,0 +1,388 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: OmniFlix/onft/v1beta1/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState defines the nft module's genesis state. +type GenesisState struct { + Collections []Collection `protobuf:"bytes,1,rep,name=collections,proto3" json:"collections"` + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_95e11c2b95418a25, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetCollections() []Collection { + if m != nil { + return m.Collections + } + return nil +} + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "OmniFlix.onft.v1beta1.GenesisState") +} + +func init() { + proto.RegisterFile("OmniFlix/onft/v1beta1/genesis.proto", fileDescriptor_95e11c2b95418a25) +} + +var fileDescriptor_95e11c2b95418a25 = []byte{ + // 249 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xf6, 0xcf, 0xcd, 0xcb, + 0x74, 0xcb, 0xc9, 0xac, 0xd0, 0xcf, 0xcf, 0x4b, 0x2b, 0xd1, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, + 0x34, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, + 0x12, 0x85, 0x29, 0xd2, 0x03, 0x29, 0xd2, 0x83, 0x2a, 0x92, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, + 0xab, 0xd0, 0x07, 0xb1, 0x20, 0x8a, 0xa5, 0x14, 0xb0, 0x9b, 0x08, 0xd6, 0x09, 0x51, 0xa1, 0x84, + 0x5d, 0x45, 0x41, 0x62, 0x51, 0x62, 0x2e, 0xd4, 0x4a, 0xa5, 0x69, 0x8c, 0x5c, 0x3c, 0xee, 0x10, + 0x47, 0x04, 0x97, 0x24, 0x96, 0xa4, 0x0a, 0x79, 0x72, 0x71, 0x27, 0xe7, 0xe7, 0xe4, 0xa4, 0x26, + 0x97, 0x64, 0xe6, 0xe7, 0x15, 0x4b, 0x30, 0x2a, 0x30, 0x6b, 0x70, 0x1b, 0x29, 0xea, 0x61, 0x75, + 0x99, 0x9e, 0x33, 0x5c, 0xa5, 0x13, 0xcb, 0x89, 0x7b, 0xf2, 0x0c, 0x41, 0xc8, 0x7a, 0x85, 0xac, + 0xb9, 0xd8, 0x20, 0x76, 0x49, 0x30, 0x29, 0x30, 0x6a, 0x70, 0x1b, 0xc9, 0xe2, 0x30, 0x25, 0x00, + 0xac, 0x08, 0x6a, 0x02, 0x54, 0x8b, 0x93, 0xe7, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, + 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, + 0x31, 0x44, 0xe9, 0xa7, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x23, 0x7c, + 0x98, 0x9b, 0x97, 0x99, 0x96, 0x93, 0x59, 0x91, 0x51, 0x9a, 0xa4, 0x5f, 0x66, 0xa4, 0x0f, 0xf5, + 0x72, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, 0xab, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x22, 0x18, 0x6e, 0x7f, 0x84, 0x01, 0x00, 0x00, +} + +func (m *GenesisState) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Collections) > 0 { + for iNdEx := len(m.Collections) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Collections[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Collections) > 0 { + for _, e := range m.Collections { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Collections", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Collections = append(m.Collections, Collection{}) + if err := m.Collections[len(m.Collections)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/onft/types/keys.go b/x/onft/types/keys.go new file mode 100644 index 00000000..46d90006 --- /dev/null +++ b/x/onft/types/keys.go @@ -0,0 +1,146 @@ +package types + +import ( + "bytes" + "errors" + + "github.com/cosmos/cosmos-sdk/codec" + + sdk "github.com/cosmos/cosmos-sdk/types" + gogotypes "github.com/cosmos/gogoproto/types" +) + +const ( + ModuleName = "onft" + StoreKey = ModuleName + RouterKey = ModuleName +) + +var ( + PrefixONFT = []byte{0x01} + PrefixOwners = []byte{0x02} + PrefixCollection = []byte{0x03} + PrefixDenom = []byte{0x04} + PrefixDenomSymbol = []byte{0x05} + PrefixCreator = []byte{0x06} + + ParamsKey = []byte{0x07} + + delimiter = []byte("/") +) + +func SplitKeyOwner(key []byte) (address sdk.AccAddress, denom, id string, err error) { + key = key[len(PrefixOwners)+len(delimiter):] + keys := bytes.Split(key, delimiter) + if len(keys) != 3 { + return address, denom, id, errors.New("wrong KeyOwner") + } + + address, _ = sdk.AccAddressFromBech32(string(keys[0])) + denom = string(keys[1]) + id = string(keys[2]) + return +} + +func SplitKeyDenom(key []byte) (denomID, nftID string, err error) { + keys := bytes.Split(key, delimiter) + if len(keys) != 2 { + return denomID, nftID, errors.New("wrong KeyOwner") + } + + denomID = string(keys[0]) + nftID = string(keys[1]) + return +} + +func KeyOwner(address sdk.AccAddress, denomID, onftID string) []byte { + key := append(PrefixOwners, delimiter...) + if address != nil { + key = append(key, []byte(address.String())...) + key = append(key, delimiter...) + } + + if address != nil && len(denomID) > 0 { + key = append(key, []byte(denomID)...) + key = append(key, delimiter...) + } + + if address != nil && len(denomID) > 0 && len(onftID) > 0 { + key = append(key, []byte(onftID)...) + } + return key +} + +func KeyONFT(denomID, onftID string) []byte { + key := append(PrefixONFT, delimiter...) + if len(denomID) > 0 { + key = append(key, []byte(denomID)...) + key = append(key, delimiter...) + } + + if len(denomID) > 0 && len(onftID) > 0 { + key = append(key, []byte(onftID)...) + } + return key +} + +func KeyCollection(denomID string) []byte { + key := append(PrefixCollection, delimiter...) + return append(key, []byte(denomID)...) +} + +func KeyDenomID(id string) []byte { + key := append(PrefixDenom, delimiter...) + return append(key, []byte(id)...) +} + +func KeyDenomCreator(address sdk.AccAddress, denomId string) []byte { + key := append(PrefixCreator, delimiter...) + if address != nil { + key = append(key, []byte(address)...) + key = append(key, delimiter...) + } + if address != nil && len(denomId) > 0 { + key = append(key, []byte(denomId)...) + key = append(key, delimiter...) + } + return key +} + +func KeyDenomSymbol(symbol string) []byte { + key := append(PrefixDenomSymbol, delimiter...) + return append(key, []byte(symbol)...) +} + +func MustMarshalSupply(cdc codec.BinaryCodec, supply uint64) []byte { + supplyWrap := gogotypes.UInt64Value{Value: supply} + return cdc.MustMarshal(&supplyWrap) +} + +func MustUnMarshalSupply(cdc codec.BinaryCodec, value []byte) uint64 { + var supplyWrap gogotypes.UInt64Value + cdc.MustUnmarshal(value, &supplyWrap) + return supplyWrap.Value +} + +func MustMarshalONFTID(cdc codec.BinaryCodec, onftID string) []byte { + onftIDWrap := gogotypes.StringValue{Value: onftID} + return cdc.MustMarshal(&onftIDWrap) +} + +func MustUnMarshalONFTID(cdc codec.BinaryCodec, value []byte) string { + var onftIDWrap gogotypes.StringValue + cdc.MustUnmarshal(value, &onftIDWrap) + return onftIDWrap.Value +} + +func MustMarshalDenomID(cdc codec.BinaryCodec, denomID string) []byte { + denomIDWrap := gogotypes.StringValue{Value: denomID} + return cdc.MustMarshal(&denomIDWrap) +} + +func MustUnMarshalDenomID(cdc codec.BinaryCodec, value []byte) string { + var denomIDWrap gogotypes.StringValue + cdc.MustUnmarshal(value, &denomIDWrap) + return denomIDWrap.Value +} diff --git a/x/onft/types/msgs.go b/x/onft/types/msgs.go new file mode 100644 index 00000000..3bdafaec --- /dev/null +++ b/x/onft/types/msgs.go @@ -0,0 +1,353 @@ +package types + +import ( + "strings" + "unicode/utf8" + + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const ( + TypeMsgCreateDenom = "create_denom" + TypeMsgUpdateDenom = "update_denom" + TypeMsgTransferDenom = "transfer_denom" + + TypeMsgMintONFT = "mint_onft" + TypeMsgTransferONFT = "transfer_onft" + TypeMsgBurnONFT = "burn_onft" +) + +var ( + _ sdk.Msg = &MsgUpdateParams{} + + _ sdk.Msg = &MsgCreateDenom{} + _ sdk.Msg = &MsgUpdateDenom{} + _ sdk.Msg = &MsgTransferDenom{} + + _ sdk.Msg = &MsgMintONFT{} + _ sdk.Msg = &MsgTransferONFT{} + _ sdk.Msg = &MsgBurnONFT{} +) + +func NewMsgCreateDenom( + symbol, + name, schema, description, uri, uriHash, previewUri, data, sender string, + creationFee sdk.Coin, +) *MsgCreateDenom { + return &MsgCreateDenom{ + Sender: sender, + Id: GenUniqueID(DenomPrefix), + Symbol: symbol, + Name: name, + Schema: schema, + Description: description, + PreviewURI: previewUri, + Uri: uri, + UriHash: uriHash, + Data: data, + CreationFee: creationFee, + } +} + +func (msg MsgCreateDenom) Route() string { return RouterKey } + +func (msg MsgCreateDenom) Type() string { return TypeMsgCreateDenom } + +func (msg MsgCreateDenom) ValidateBasic() error { + if err := ValidateDenomID(msg.Id); err != nil { + return err + } + if err := ValidateDenomSymbol(msg.Symbol); err != nil { + return err + } + name := strings.TrimSpace(msg.Name) + if len(name) > 0 && !utf8.ValidString(name) { + return errorsmod.Wrap(ErrInvalidName, "denom name is invalid") + } + if err := ValidateName(name); err != nil { + return err + } + description := strings.TrimSpace(msg.Description) + if len(description) > 0 && !utf8.ValidString(description) { + return errorsmod.Wrap(ErrInvalidDescription, "denom description is invalid") + } + if err := ValidateDescription(description); err != nil { + return err + } + if err := ValidateURI(msg.PreviewURI); err != nil { + return err + } + if err := ValidateCreationFee(msg.CreationFee); err != nil { + return err + } + + if _, err := sdk.AccAddressFromBech32(msg.Sender); err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid sender address (%s)", err) + } + return nil +} + +// GetSignBytes Implements Msg. +func (msg MsgCreateDenom) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +func (msg MsgCreateDenom) GetSigners() []sdk.AccAddress { + from, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + panic(err) + } + return []sdk.AccAddress{from} +} + +func NewMsgUpdateDenom(id, name, description, previewUri, sender string) *MsgUpdateDenom { + return &MsgUpdateDenom{ + Id: id, + Name: name, + Description: description, + PreviewURI: previewUri, + Sender: sender, + } +} + +func (msg MsgUpdateDenom) Route() string { return RouterKey } + +func (msg MsgUpdateDenom) Type() string { return TypeMsgUpdateDenom } + +func (msg MsgUpdateDenom) ValidateBasic() error { + if err := ValidateDenomID(msg.Id); err != nil { + return err + } + name := msg.Name + if len(name) > 0 && !utf8.ValidString(name) { + return errorsmod.Wrap(ErrInvalidName, "denom name is invalid") + } + if err := ValidateName(name); err != nil { + return err + } + description := strings.TrimSpace(msg.Description) + if len(description) > 0 && !utf8.ValidString(description) { + return errorsmod.Wrap(ErrInvalidDescription, "denom description is invalid") + } + if err := ValidateDescription(description); err != nil { + return err + } + if err := ValidateURI(msg.PreviewURI); err != nil { + return err + } + + if _, err := sdk.AccAddressFromBech32(msg.Sender); err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid sender address (%s)", err) + } + return nil +} + +// GetSignBytes Implements Msg. +func (msg MsgUpdateDenom) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +func (msg MsgUpdateDenom) GetSigners() []sdk.AccAddress { + from, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + panic(err) + } + return []sdk.AccAddress{from} +} + +func NewMsgTransferDenom(id, sender, recipient string) *MsgTransferDenom { + return &MsgTransferDenom{ + Id: id, + Sender: sender, + Recipient: recipient, + } +} + +func (msg MsgTransferDenom) Route() string { return RouterKey } + +func (msg MsgTransferDenom) Type() string { return TypeMsgTransferDenom } + +func (msg MsgTransferDenom) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Sender); err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid sender address; %s", err) + } + + if _, err := sdk.AccAddressFromBech32(msg.Recipient); err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid recipient address; %s", err) + } + return nil +} + +func (msg MsgTransferDenom) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +func (msg MsgTransferDenom) GetSigners() []sdk.AccAddress { + from, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + panic(err) + } + return []sdk.AccAddress{from} +} + +func NewMsgMintONFT( + denomId, sender, recipient string, metadata Metadata, data string, + transferable, extensible, nsfw bool, royaltyShare sdk.Dec, +) *MsgMintONFT { + return &MsgMintONFT{ + Id: GenUniqueID(IDPrefix), + DenomId: denomId, + Metadata: metadata, + Data: data, + Transferable: transferable, + Extensible: extensible, + Nsfw: nsfw, + RoyaltyShare: royaltyShare, + Sender: sender, + Recipient: recipient, + } +} + +func (msg MsgMintONFT) Route() string { return RouterKey } + +func (msg MsgMintONFT) Type() string { return TypeMsgMintONFT } + +func (msg MsgMintONFT) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Sender); err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid sender address; %s", err) + } + + if _, err := sdk.AccAddressFromBech32(msg.Recipient); err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid recipient address; %s", err) + } + if err := ValidateName(msg.Metadata.Name); err != nil { + return err + } + if err := ValidateDescription(msg.Metadata.Description); err != nil { + return err + } + if err := ValidateMediaURI(msg.Metadata.MediaURI); err != nil { + return err + } + if err := ValidateURI(msg.Metadata.PreviewURI); err != nil { + return err + } + if msg.RoyaltyShare.IsNegative() || msg.RoyaltyShare.GTE(sdk.NewDec(1)) { + return errorsmod.Wrapf(ErrInvalidPercentage, "invalid royalty share percentage decimal value; %d, must be positive and less than 1", msg.RoyaltyShare) + } + + return ValidateONFTID(msg.Id) +} + +func (msg MsgMintONFT) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +func (msg MsgMintONFT) GetSigners() []sdk.AccAddress { + from, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + panic(err) + } + return []sdk.AccAddress{from} +} + +func NewMsgTransferONFT(id, denomId, sender, recipient string) *MsgTransferONFT { + return &MsgTransferONFT{ + Id: strings.ToLower(strings.TrimSpace(id)), + DenomId: strings.TrimSpace(denomId), + Sender: sender, + Recipient: recipient, + } +} + +func (msg MsgTransferONFT) Route() string { return RouterKey } + +func (msg MsgTransferONFT) Type() string { return TypeMsgTransferONFT } + +func (msg MsgTransferONFT) ValidateBasic() error { + if err := ValidateDenomID(msg.DenomId); err != nil { + return err + } + + if _, err := sdk.AccAddressFromBech32(msg.Sender); err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid sender address; %s", err) + } + + if _, err := sdk.AccAddressFromBech32(msg.Recipient); err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid recipient address; %s", err) + } + return ValidateONFTID(msg.Id) +} + +func (msg MsgTransferONFT) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +func (msg MsgTransferONFT) GetSigners() []sdk.AccAddress { + from, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + panic(err) + } + return []sdk.AccAddress{from} +} + +func NewMsgBurnONFT(denomId, id, sender string) *MsgBurnONFT { + return &MsgBurnONFT{ + DenomId: denomId, + Id: id, + Sender: sender, + } +} + +func (msg MsgBurnONFT) Route() string { return RouterKey } + +func (msg MsgBurnONFT) Type() string { return TypeMsgBurnONFT } + +func (msg MsgBurnONFT) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Sender); err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid sender address; %s", err) + } + return ValidateONFTID(msg.Id) +} + +func (msg MsgBurnONFT) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +func (msg MsgBurnONFT) GetSigners() []sdk.AccAddress { + from, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + panic(err) + } + return []sdk.AccAddress{from} +} + +// MsgUpdateParams + +// GetSignBytes implements the LegacyMsg interface. +func (m MsgUpdateParams) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) +} + +// GetSigners returns the expected signers for a MsgUpdateParams message. +func (m *MsgUpdateParams) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(m.Authority) + return []sdk.AccAddress{addr} +} + +// ValidateBasic does a sanity check on the provided data. +func (m *MsgUpdateParams) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { + return errorsmod.Wrap(err, "invalid authority address") + } + + return m.Params.ValidateBasic() +} diff --git a/x/onft/types/onft.go b/x/onft/types/onft.go new file mode 100644 index 00000000..cc384cb8 --- /dev/null +++ b/x/onft/types/onft.go @@ -0,0 +1,108 @@ +package types + +import ( + "time" + + "github.com/OmniFlix/omniflixhub/v2/x/onft/exported" + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var _ exported.ONFTI = ONFT{} + +func UnmarshalNFTMetadata(cdc codec.BinaryCodec, bz []byte) (ONFTMetadata, error) { + var nftMetadata ONFTMetadata + if len(bz) == 0 { + return nftMetadata, nil + } + + if err := cdc.Unmarshal(bz, &nftMetadata); err != nil { + return nftMetadata, err + } + return nftMetadata, nil +} + +func NewONFT( + id string, metadata Metadata, data string, transferable, extensible bool, owner sdk.AccAddress, + createdTime time.Time, nsfw bool, royaltyShare sdk.Dec, +) ONFT { + return ONFT{ + Id: id, + Metadata: metadata, + Data: data, + Owner: owner.String(), + Transferable: transferable, + Extensible: extensible, + CreatedAt: createdTime, + Nsfw: nsfw, + RoyaltyShare: royaltyShare, + } +} + +func (onft ONFT) GetID() string { + return onft.Id +} + +func (onft ONFT) GetName() string { + return onft.Metadata.Name +} + +func (onft ONFT) GetDescription() string { + return onft.Metadata.Description +} + +func (onft ONFT) GetMediaURI() string { + return onft.Metadata.MediaURI +} + +func (onft ONFT) GetURIHash() string { + return onft.Metadata.UriHash +} + +func (onft ONFT) GetPreviewURI() string { + return onft.Metadata.PreviewURI +} + +func (onft ONFT) GetOwner() sdk.AccAddress { + owner, _ := sdk.AccAddressFromBech32(onft.Owner) + return owner +} + +func (onft ONFT) GetMetadata() string { + return onft.Metadata.String() +} + +func (onft ONFT) GetData() string { + return onft.Data +} + +func (onft ONFT) IsTransferable() bool { + return onft.Transferable +} + +func (onft ONFT) IsExtensible() bool { + return onft.Extensible +} + +func (onft ONFT) GetCreatedTime() time.Time { + return onft.CreatedAt +} + +func (onft ONFT) IsNSFW() bool { + return onft.Nsfw +} + +func (onft ONFT) GetRoyaltyShare() sdk.Dec { + return onft.RoyaltyShare +} + +// ONFT + +type ONFTs []exported.ONFTI + +func NewONFTs(onfts ...exported.ONFTI) ONFTs { + if len(onfts) == 0 { + return ONFTs{} + } + return onfts +} diff --git a/x/onft/types/onft.pb.go b/x/onft/types/onft.pb.go new file mode 100644 index 00000000..151e8e7c --- /dev/null +++ b/x/onft/types/onft.pb.go @@ -0,0 +1,3383 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: OmniFlix/onft/v1beta1/onft.proto + +package types + +import ( + fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_gogo_protobuf_types "github.com/cosmos/gogoproto/types" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Collection +type Collection struct { + Denom Denom `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom"` + ONFTs []ONFT `protobuf:"bytes,2,rep,name=onfts,proto3" json:"onfts"` +} + +func (m *Collection) Reset() { *m = Collection{} } +func (m *Collection) String() string { return proto.CompactTextString(m) } +func (*Collection) ProtoMessage() {} +func (*Collection) Descriptor() ([]byte, []int) { + return fileDescriptor_de1608f52787b22e, []int{0} +} +func (m *Collection) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Collection) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Collection.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Collection) XXX_Merge(src proto.Message) { + xxx_messageInfo_Collection.Merge(m, src) +} +func (m *Collection) XXX_Size() int { + return m.Size() +} +func (m *Collection) XXX_DiscardUnknown() { + xxx_messageInfo_Collection.DiscardUnknown(m) +} + +var xxx_messageInfo_Collection proto.InternalMessageInfo + +type IDCollection struct { + DenomId string `protobuf:"bytes,1,opt,name=denom_id,json=denomId,proto3" json:"denom_id,omitempty" yaml:"denom_id"` + OnftIds []string `protobuf:"bytes,2,rep,name=onft_ids,json=onftIds,proto3" json:"onft_ids,omitempty" yaml:"onft_ids"` +} + +func (m *IDCollection) Reset() { *m = IDCollection{} } +func (m *IDCollection) String() string { return proto.CompactTextString(m) } +func (*IDCollection) ProtoMessage() {} +func (*IDCollection) Descriptor() ([]byte, []int) { + return fileDescriptor_de1608f52787b22e, []int{1} +} +func (m *IDCollection) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IDCollection) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_IDCollection.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *IDCollection) XXX_Merge(src proto.Message) { + xxx_messageInfo_IDCollection.Merge(m, src) +} +func (m *IDCollection) XXX_Size() int { + return m.Size() +} +func (m *IDCollection) XXX_DiscardUnknown() { + xxx_messageInfo_IDCollection.DiscardUnknown(m) +} + +var xxx_messageInfo_IDCollection proto.InternalMessageInfo + +type Denom struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Symbol string `protobuf:"bytes,2,opt,name=symbol,proto3" json:"symbol,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Schema string `protobuf:"bytes,4,opt,name=schema,proto3" json:"schema,omitempty"` + Creator string `protobuf:"bytes,5,opt,name=creator,proto3" json:"creator,omitempty"` + Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"` + PreviewURI string `protobuf:"bytes,7,opt,name=preview_uri,json=previewUri,proto3" json:"preview_uri,omitempty" yaml:"preview_uri"` + Uri string `protobuf:"bytes,8,opt,name=uri,proto3" json:"uri,omitempty"` + UriHash string `protobuf:"bytes,9,opt,name=uri_hash,json=uriHash,proto3" json:"uri_hash,omitempty"` + Data string `protobuf:"bytes,10,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *Denom) Reset() { *m = Denom{} } +func (m *Denom) String() string { return proto.CompactTextString(m) } +func (*Denom) ProtoMessage() {} +func (*Denom) Descriptor() ([]byte, []int) { + return fileDescriptor_de1608f52787b22e, []int{2} +} +func (m *Denom) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Denom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Denom.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Denom) XXX_Merge(src proto.Message) { + xxx_messageInfo_Denom.Merge(m, src) +} +func (m *Denom) XXX_Size() int { + return m.Size() +} +func (m *Denom) XXX_DiscardUnknown() { + xxx_messageInfo_Denom.DiscardUnknown(m) +} + +var xxx_messageInfo_Denom proto.InternalMessageInfo + +type DenomMetadata struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + Schema string `protobuf:"bytes,2,opt,name=schema,proto3" json:"schema,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + PreviewUri string `protobuf:"bytes,4,opt,name=preview_uri,json=previewUri,proto3" json:"preview_uri,omitempty"` + Data string `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"` + UriHash string `protobuf:"bytes,6,opt,name=uri_hash,json=uriHash,proto3" json:"uri_hash,omitempty"` +} + +func (m *DenomMetadata) Reset() { *m = DenomMetadata{} } +func (m *DenomMetadata) String() string { return proto.CompactTextString(m) } +func (*DenomMetadata) ProtoMessage() {} +func (*DenomMetadata) Descriptor() ([]byte, []int) { + return fileDescriptor_de1608f52787b22e, []int{3} +} +func (m *DenomMetadata) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DenomMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DenomMetadata.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DenomMetadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_DenomMetadata.Merge(m, src) +} +func (m *DenomMetadata) XXX_Size() int { + return m.Size() +} +func (m *DenomMetadata) XXX_DiscardUnknown() { + xxx_messageInfo_DenomMetadata.DiscardUnknown(m) +} + +var xxx_messageInfo_DenomMetadata proto.InternalMessageInfo + +// ASSET or ONFT +type ONFT struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Metadata Metadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata"` + Data string `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` + Owner string `protobuf:"bytes,4,opt,name=owner,proto3" json:"owner,omitempty"` + Transferable bool `protobuf:"varint,5,opt,name=transferable,proto3" json:"transferable,omitempty"` + Extensible bool `protobuf:"varint,6,opt,name=extensible,proto3" json:"extensible,omitempty"` + CreatedAt time.Time `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at" yaml:"created_at"` + Nsfw bool `protobuf:"varint,8,opt,name=nsfw,proto3" json:"nsfw,omitempty"` + RoyaltyShare github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,9,opt,name=royalty_share,json=royaltyShare,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"royalty_share" yaml:"royalty_share"` +} + +func (m *ONFT) Reset() { *m = ONFT{} } +func (m *ONFT) String() string { return proto.CompactTextString(m) } +func (*ONFT) ProtoMessage() {} +func (*ONFT) Descriptor() ([]byte, []int) { + return fileDescriptor_de1608f52787b22e, []int{4} +} +func (m *ONFT) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ONFT) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ONFT.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ONFT) XXX_Merge(src proto.Message) { + xxx_messageInfo_ONFT.Merge(m, src) +} +func (m *ONFT) XXX_Size() int { + return m.Size() +} +func (m *ONFT) XXX_DiscardUnknown() { + xxx_messageInfo_ONFT.DiscardUnknown(m) +} + +var xxx_messageInfo_ONFT proto.InternalMessageInfo + +type Metadata struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty" yaml:"name"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty" yaml:"description"` + MediaURI string `protobuf:"bytes,3,opt,name=media_uri,json=mediaUri,proto3" json:"media_uri,omitempty" yaml:"media_uri"` + PreviewURI string `protobuf:"bytes,4,opt,name=preview_uri,json=previewUri,proto3" json:"preview_uri,omitempty" yaml:"preview_uri"` + UriHash string `protobuf:"bytes,5,opt,name=uri_hash,json=uriHash,proto3" json:"uri_hash,omitempty"` +} + +func (m *Metadata) Reset() { *m = Metadata{} } +func (m *Metadata) String() string { return proto.CompactTextString(m) } +func (*Metadata) ProtoMessage() {} +func (*Metadata) Descriptor() ([]byte, []int) { + return fileDescriptor_de1608f52787b22e, []int{5} +} +func (m *Metadata) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Metadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Metadata.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Metadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_Metadata.Merge(m, src) +} +func (m *Metadata) XXX_Size() int { + return m.Size() +} +func (m *Metadata) XXX_DiscardUnknown() { + xxx_messageInfo_Metadata.DiscardUnknown(m) +} + +var xxx_messageInfo_Metadata proto.InternalMessageInfo + +type ONFTMetadata struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + PreviewURI string `protobuf:"bytes,3,opt,name=preview_uri,json=previewUri,proto3" json:"preview_uri,omitempty" yaml:"preview_uri"` + Data string `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` + Transferable bool `protobuf:"varint,5,opt,name=transferable,proto3" json:"transferable,omitempty"` + Extensible bool `protobuf:"varint,6,opt,name=extensible,proto3" json:"extensible,omitempty"` + CreatedAt time.Time `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at" yaml:"created_at"` + Nsfw bool `protobuf:"varint,8,opt,name=nsfw,proto3" json:"nsfw,omitempty"` + RoyaltyShare github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,9,opt,name=royalty_share,json=royaltyShare,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"royalty_share" yaml:"royalty_share"` + UriHash string `protobuf:"bytes,10,opt,name=uri_hash,json=uriHash,proto3" json:"uri_hash,omitempty"` +} + +func (m *ONFTMetadata) Reset() { *m = ONFTMetadata{} } +func (m *ONFTMetadata) String() string { return proto.CompactTextString(m) } +func (*ONFTMetadata) ProtoMessage() {} +func (*ONFTMetadata) Descriptor() ([]byte, []int) { + return fileDescriptor_de1608f52787b22e, []int{6} +} +func (m *ONFTMetadata) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ONFTMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ONFTMetadata.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ONFTMetadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_ONFTMetadata.Merge(m, src) +} +func (m *ONFTMetadata) XXX_Size() int { + return m.Size() +} +func (m *ONFTMetadata) XXX_DiscardUnknown() { + xxx_messageInfo_ONFTMetadata.DiscardUnknown(m) +} + +var xxx_messageInfo_ONFTMetadata proto.InternalMessageInfo + +type Owner struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + IDCollections []IDCollection `protobuf:"bytes,2,rep,name=id_collections,json=idCollections,proto3" json:"id_collections" yaml:"idcs"` +} + +func (m *Owner) Reset() { *m = Owner{} } +func (m *Owner) String() string { return proto.CompactTextString(m) } +func (*Owner) ProtoMessage() {} +func (*Owner) Descriptor() ([]byte, []int) { + return fileDescriptor_de1608f52787b22e, []int{7} +} +func (m *Owner) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Owner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Owner.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Owner) XXX_Merge(src proto.Message) { + xxx_messageInfo_Owner.Merge(m, src) +} +func (m *Owner) XXX_Size() int { + return m.Size() +} +func (m *Owner) XXX_DiscardUnknown() { + xxx_messageInfo_Owner.DiscardUnknown(m) +} + +var xxx_messageInfo_Owner proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Collection)(nil), "OmniFlix.onft.v1beta1.Collection") + proto.RegisterType((*IDCollection)(nil), "OmniFlix.onft.v1beta1.IDCollection") + proto.RegisterType((*Denom)(nil), "OmniFlix.onft.v1beta1.Denom") + proto.RegisterType((*DenomMetadata)(nil), "OmniFlix.onft.v1beta1.DenomMetadata") + proto.RegisterType((*ONFT)(nil), "OmniFlix.onft.v1beta1.ONFT") + proto.RegisterType((*Metadata)(nil), "OmniFlix.onft.v1beta1.Metadata") + proto.RegisterType((*ONFTMetadata)(nil), "OmniFlix.onft.v1beta1.ONFTMetadata") + proto.RegisterType((*Owner)(nil), "OmniFlix.onft.v1beta1.Owner") +} + +func init() { proto.RegisterFile("OmniFlix/onft/v1beta1/onft.proto", fileDescriptor_de1608f52787b22e) } + +var fileDescriptor_de1608f52787b22e = []byte{ + // 916 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x56, 0x4f, 0x8f, 0xdb, 0x44, + 0x14, 0x8f, 0x93, 0x38, 0xc9, 0xbe, 0x6c, 0xda, 0x32, 0x2c, 0x95, 0x59, 0x20, 0x8e, 0xdc, 0x0a, + 0xf5, 0x82, 0xad, 0x86, 0x4b, 0x55, 0x09, 0x89, 0x9a, 0x65, 0xc5, 0x1e, 0xc2, 0x22, 0xd3, 0x4a, + 0x88, 0x4b, 0x34, 0xb1, 0x27, 0xc9, 0xa8, 0xfe, 0x13, 0x79, 0x9c, 0xdd, 0xcd, 0x97, 0x40, 0x7b, + 0xe5, 0xc6, 0x05, 0x89, 0x3b, 0x5f, 0x62, 0x8f, 0x3d, 0x02, 0x07, 0x03, 0xd9, 0x0b, 0xe7, 0x7c, + 0x02, 0x34, 0x7f, 0x9c, 0xd8, 0x6d, 0xb7, 0x87, 0x9e, 0x7b, 0xca, 0xbc, 0xf7, 0x7e, 0x6f, 0xe6, + 0xfd, 0xde, 0xfc, 0xde, 0x38, 0x30, 0x38, 0x8d, 0x62, 0x7a, 0x1c, 0xd2, 0x0b, 0x27, 0x89, 0xa7, + 0x99, 0x73, 0xf6, 0x70, 0x42, 0x32, 0xfc, 0x50, 0x18, 0xf6, 0x22, 0x4d, 0xb2, 0x04, 0x7d, 0x50, + 0x20, 0x6c, 0xe1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fd, 0xb3, 0xee, 0x6b, 0x97, 0xd7, + 0xfd, 0xda, 0x8b, 0xeb, 0x7e, 0xed, 0x8f, 0xeb, 0x7e, 0xed, 0x47, 0xa7, 0xd4, 0xa2, 0xdd, 0x7f, + 0x96, 0x28, 0xa6, 0xd3, 0x90, 0x5e, 0xcc, 0x97, 0x13, 0xe7, 0x6c, 0xe8, 0xa8, 0x3f, 0x31, 0xa2, + 0x5f, 0x93, 0x96, 0xb8, 0xc4, 0xcf, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, 0xbf, 0x52, 0xd5, 0xd9, + 0xe2, 0x08, 0x00, 0x00, +} + +func (this *Collection) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Collection) + if !ok { + that2, ok := that.(Collection) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Denom.Equal(&that1.Denom) { + return false + } + if len(this.ONFTs) != len(that1.ONFTs) { + return false + } + for i := range this.ONFTs { + if !this.ONFTs[i].Equal(&that1.ONFTs[i]) { + return false + } + } + return true +} +func (this *IDCollection) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*IDCollection) + if !ok { + that2, ok := that.(IDCollection) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.DenomId != that1.DenomId { + return false + } + if len(this.OnftIds) != len(that1.OnftIds) { + return false + } + for i := range this.OnftIds { + if this.OnftIds[i] != that1.OnftIds[i] { + return false + } + } + return true +} +func (this *Denom) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Denom) + if !ok { + that2, ok := that.(Denom) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Id != that1.Id { + return false + } + if this.Symbol != that1.Symbol { + return false + } + if this.Name != that1.Name { + return false + } + if this.Schema != that1.Schema { + return false + } + if this.Creator != that1.Creator { + return false + } + if this.Description != that1.Description { + return false + } + if this.PreviewURI != that1.PreviewURI { + return false + } + if this.Uri != that1.Uri { + return false + } + if this.UriHash != that1.UriHash { + return false + } + if this.Data != that1.Data { + return false + } + return true +} +func (this *ONFT) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ONFT) + if !ok { + that2, ok := that.(ONFT) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Id != that1.Id { + return false + } + if !this.Metadata.Equal(&that1.Metadata) { + return false + } + if this.Data != that1.Data { + return false + } + if this.Owner != that1.Owner { + return false + } + if this.Transferable != that1.Transferable { + return false + } + if this.Extensible != that1.Extensible { + return false + } + if !this.CreatedAt.Equal(that1.CreatedAt) { + return false + } + if this.Nsfw != that1.Nsfw { + return false + } + if !this.RoyaltyShare.Equal(that1.RoyaltyShare) { + return false + } + return true +} +func (this *Metadata) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Metadata) + if !ok { + that2, ok := that.(Metadata) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Name != that1.Name { + return false + } + if this.Description != that1.Description { + return false + } + if this.MediaURI != that1.MediaURI { + return false + } + if this.PreviewURI != that1.PreviewURI { + return false + } + if this.UriHash != that1.UriHash { + return false + } + return true +} +func (this *Owner) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Owner) + if !ok { + that2, ok := that.(Owner) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Address != that1.Address { + return false + } + if len(this.IDCollections) != len(that1.IDCollections) { + return false + } + for i := range this.IDCollections { + if !this.IDCollections[i].Equal(&that1.IDCollections[i]) { + return false + } + } + return true +} +func (m *Collection) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Collection) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Collection) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ONFTs) > 0 { + for iNdEx := len(m.ONFTs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ONFTs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOnft(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.Denom.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOnft(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *IDCollection) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *IDCollection) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IDCollection) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.OnftIds) > 0 { + for iNdEx := len(m.OnftIds) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.OnftIds[iNdEx]) + copy(dAtA[i:], m.OnftIds[iNdEx]) + i = encodeVarintOnft(dAtA, i, uint64(len(m.OnftIds[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.DenomId) > 0 { + i -= len(m.DenomId) + copy(dAtA[i:], m.DenomId) + i = encodeVarintOnft(dAtA, i, uint64(len(m.DenomId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Denom) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Denom) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Denom) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintOnft(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x52 + } + if len(m.UriHash) > 0 { + i -= len(m.UriHash) + copy(dAtA[i:], m.UriHash) + i = encodeVarintOnft(dAtA, i, uint64(len(m.UriHash))) + i-- + dAtA[i] = 0x4a + } + if len(m.Uri) > 0 { + i -= len(m.Uri) + copy(dAtA[i:], m.Uri) + i = encodeVarintOnft(dAtA, i, uint64(len(m.Uri))) + i-- + dAtA[i] = 0x42 + } + if len(m.PreviewURI) > 0 { + i -= len(m.PreviewURI) + copy(dAtA[i:], m.PreviewURI) + i = encodeVarintOnft(dAtA, i, uint64(len(m.PreviewURI))) + i-- + dAtA[i] = 0x3a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintOnft(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x32 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintOnft(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0x2a + } + if len(m.Schema) > 0 { + i -= len(m.Schema) + copy(dAtA[i:], m.Schema) + i = encodeVarintOnft(dAtA, i, uint64(len(m.Schema))) + i-- + dAtA[i] = 0x22 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintOnft(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x1a + } + if len(m.Symbol) > 0 { + i -= len(m.Symbol) + copy(dAtA[i:], m.Symbol) + i = encodeVarintOnft(dAtA, i, uint64(len(m.Symbol))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintOnft(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DenomMetadata) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DenomMetadata) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DenomMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.UriHash) > 0 { + i -= len(m.UriHash) + copy(dAtA[i:], m.UriHash) + i = encodeVarintOnft(dAtA, i, uint64(len(m.UriHash))) + i-- + dAtA[i] = 0x32 + } + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintOnft(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x2a + } + if len(m.PreviewUri) > 0 { + i -= len(m.PreviewUri) + copy(dAtA[i:], m.PreviewUri) + i = encodeVarintOnft(dAtA, i, uint64(len(m.PreviewUri))) + i-- + dAtA[i] = 0x22 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintOnft(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x1a + } + if len(m.Schema) > 0 { + i -= len(m.Schema) + copy(dAtA[i:], m.Schema) + i = encodeVarintOnft(dAtA, i, uint64(len(m.Schema))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintOnft(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ONFT) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ONFT) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ONFT) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.RoyaltyShare.Size() + i -= size + if _, err := m.RoyaltyShare.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintOnft(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + if m.Nsfw { + i-- + if m.Nsfw { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } + n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintOnft(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x3a + if m.Extensible { + i-- + if m.Extensible { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.Transferable { + i-- + if m.Transferable { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintOnft(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x22 + } + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintOnft(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x1a + } + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOnft(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintOnft(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Metadata) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Metadata) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.UriHash) > 0 { + i -= len(m.UriHash) + copy(dAtA[i:], m.UriHash) + i = encodeVarintOnft(dAtA, i, uint64(len(m.UriHash))) + i-- + dAtA[i] = 0x2a + } + if len(m.PreviewURI) > 0 { + i -= len(m.PreviewURI) + copy(dAtA[i:], m.PreviewURI) + i = encodeVarintOnft(dAtA, i, uint64(len(m.PreviewURI))) + i-- + dAtA[i] = 0x22 + } + if len(m.MediaURI) > 0 { + i -= len(m.MediaURI) + copy(dAtA[i:], m.MediaURI) + i = encodeVarintOnft(dAtA, i, uint64(len(m.MediaURI))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintOnft(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintOnft(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ONFTMetadata) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ONFTMetadata) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ONFTMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.UriHash) > 0 { + i -= len(m.UriHash) + copy(dAtA[i:], m.UriHash) + i = encodeVarintOnft(dAtA, i, uint64(len(m.UriHash))) + i-- + dAtA[i] = 0x52 + } + { + size := m.RoyaltyShare.Size() + i -= size + if _, err := m.RoyaltyShare.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintOnft(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + if m.Nsfw { + i-- + if m.Nsfw { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } + n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt):]) + if err4 != nil { + return 0, err4 + } + i -= n4 + i = encodeVarintOnft(dAtA, i, uint64(n4)) + i-- + dAtA[i] = 0x3a + if m.Extensible { + i-- + if m.Extensible { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.Transferable { + i-- + if m.Transferable { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintOnft(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x22 + } + if len(m.PreviewURI) > 0 { + i -= len(m.PreviewURI) + copy(dAtA[i:], m.PreviewURI) + i = encodeVarintOnft(dAtA, i, uint64(len(m.PreviewURI))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintOnft(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintOnft(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Owner) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Owner) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Owner) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.IDCollections) > 0 { + for iNdEx := len(m.IDCollections) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.IDCollections[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOnft(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintOnft(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintOnft(dAtA []byte, offset int, v uint64) int { + offset -= sovOnft(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Collection) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Denom.Size() + n += 1 + l + sovOnft(uint64(l)) + if len(m.ONFTs) > 0 { + for _, e := range m.ONFTs { + l = e.Size() + n += 1 + l + sovOnft(uint64(l)) + } + } + return n +} + +func (m *IDCollection) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DenomId) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + if len(m.OnftIds) > 0 { + for _, s := range m.OnftIds { + l = len(s) + n += 1 + l + sovOnft(uint64(l)) + } + } + return n +} + +func (m *Denom) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + l = len(m.Symbol) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + l = len(m.Schema) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + l = len(m.PreviewURI) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + l = len(m.Uri) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + l = len(m.UriHash) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + l = len(m.Data) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + return n +} + +func (m *DenomMetadata) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + l = len(m.Schema) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + l = len(m.PreviewUri) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + l = len(m.Data) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + l = len(m.UriHash) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + return n +} + +func (m *ONFT) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + l = m.Metadata.Size() + n += 1 + l + sovOnft(uint64(l)) + l = len(m.Data) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + if m.Transferable { + n += 2 + } + if m.Extensible { + n += 2 + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt) + n += 1 + l + sovOnft(uint64(l)) + if m.Nsfw { + n += 2 + } + l = m.RoyaltyShare.Size() + n += 1 + l + sovOnft(uint64(l)) + return n +} + +func (m *Metadata) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + l = len(m.MediaURI) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + l = len(m.PreviewURI) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + l = len(m.UriHash) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + return n +} + +func (m *ONFTMetadata) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + l = len(m.PreviewURI) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + l = len(m.Data) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + if m.Transferable { + n += 2 + } + if m.Extensible { + n += 2 + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt) + n += 1 + l + sovOnft(uint64(l)) + if m.Nsfw { + n += 2 + } + l = m.RoyaltyShare.Size() + n += 1 + l + sovOnft(uint64(l)) + l = len(m.UriHash) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + return n +} + +func (m *Owner) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovOnft(uint64(l)) + } + if len(m.IDCollections) > 0 { + for _, e := range m.IDCollections { + l = e.Size() + n += 1 + l + sovOnft(uint64(l)) + } + } + return n +} + +func sovOnft(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozOnft(x uint64) (n int) { + return sovOnft(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Collection) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Collection: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Collection: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Denom.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ONFTs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ONFTs = append(m.ONFTs, ONFT{}) + if err := m.ONFTs[len(m.ONFTs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipOnft(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthOnft + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *IDCollection) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: IDCollection: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IDCollection: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DenomId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DenomId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OnftIds", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OnftIds = append(m.OnftIds, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipOnft(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthOnft + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Denom) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Denom: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Denom: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Symbol = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Schema", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Schema = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PreviewURI", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PreviewURI = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Uri", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Uri = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UriHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UriHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipOnft(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthOnft + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DenomMetadata) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DenomMetadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DenomMetadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Schema", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Schema = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PreviewUri", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PreviewUri = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UriHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UriHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipOnft(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthOnft + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ONFT) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ONFT: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ONFT: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Transferable", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Transferable = bool(v != 0) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Extensible", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Extensible = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CreatedAt, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Nsfw", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Nsfw = bool(v != 0) + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RoyaltyShare", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.RoyaltyShare.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipOnft(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthOnft + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Metadata) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Metadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Metadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MediaURI", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MediaURI = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PreviewURI", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PreviewURI = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UriHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UriHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipOnft(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthOnft + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ONFTMetadata) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ONFTMetadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ONFTMetadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PreviewURI", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PreviewURI = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Transferable", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Transferable = bool(v != 0) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Extensible", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Extensible = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CreatedAt, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Nsfw", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Nsfw = bool(v != 0) + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RoyaltyShare", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.RoyaltyShare.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UriHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UriHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipOnft(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthOnft + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Owner) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Owner: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Owner: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IDCollections", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOnft + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthOnft + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOnft + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IDCollections = append(m.IDCollections, IDCollection{}) + if err := m.IDCollections[len(m.IDCollections)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipOnft(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthOnft + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipOnft(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowOnft + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowOnft + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowOnft + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthOnft + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupOnft + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthOnft + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthOnft = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowOnft = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupOnft = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/onft/types/params.go b/x/onft/types/params.go new file mode 100644 index 00000000..e6625f4e --- /dev/null +++ b/x/onft/types/params.go @@ -0,0 +1,46 @@ +package types + +import ( + "fmt" + + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// DefaultDenomCreationFee Default period for closing bids for an auction +var DefaultDenomCreationFee = sdk.NewInt64Coin("uflix", 100_000_000) // 100FLIX + +func NewONFTParams(denomCreationFee sdk.Coin) Params { + return Params{ + DenomCreationFee: denomCreationFee, + } +} + +// DefaultParams returns default onft parameters +func DefaultParams() Params { + return NewONFTParams( + DefaultDenomCreationFee, + ) +} + +// ValidateBasic performs basic validation on onft parameters. +func (p Params) ValidateBasic() error { + if err := validateDenomCreationFee(p.DenomCreationFee); err != nil { + return err + } + return nil +} + +// ValidateDenomCreationFee performs validation of denom creation fee + +func validateDenomCreationFee(i interface{}) error { + fee, ok := i.(sdk.Coin) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + if !fee.IsValid() || fee.IsZero() { + return errorsmod.Wrapf(ErrInvalidDenomCreationFee, "invalid fee amount %s, only accepts positive amounts", fee.String()) + } + return nil +} diff --git a/x/onft/types/params.pb.go b/x/onft/types/params.pb.go new file mode 100644 index 00000000..6f87b7ab --- /dev/null +++ b/x/onft/types/params.pb.go @@ -0,0 +1,322 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: OmniFlix/onft/v1beta1/params.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type Params struct { + DenomCreationFee github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,1,opt,name=denom_creation_fee,json=denomCreationFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Coin" json:"denom_creation_fee" yaml:"denom_creation_fee"` +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_45b4f6ff6cbc6db3, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Params)(nil), "OmniFlix.onft.v1beta1.Params") +} + +func init() { + proto.RegisterFile("OmniFlix/onft/v1beta1/params.proto", fileDescriptor_45b4f6ff6cbc6db3) +} + +var fileDescriptor_45b4f6ff6cbc6db3 = []byte{ + // 279 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xf2, 0xcf, 0xcd, 0xcb, + 0x74, 0xcb, 0xc9, 0xac, 0xd0, 0xcf, 0xcf, 0x4b, 0x2b, 0xd1, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, + 0x34, 0xd4, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, + 0x85, 0xa9, 0xd1, 0x03, 0xa9, 0xd1, 0x83, 0xaa, 0x91, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0xab, + 0xd0, 0x07, 0xb1, 0x20, 0x8a, 0xa5, 0xe4, 0x92, 0xf3, 0x8b, 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3e, + 0x34, 0x34, 0xc1, 0x4e, 0x48, 0x62, 0x03, 0x7b, 0xdc, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x2d, + 0x83, 0xa6, 0x2e, 0x6b, 0x01, 0x00, 0x00, +} + +func (m *Params) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.DenomCreationFee.Size() + i -= size + if _, err := m.DenomCreationFee.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.DenomCreationFee.Size() + n += 1 + l + sovParams(uint64(l)) + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DenomCreationFee", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.DenomCreationFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowParams + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/onft/types/params_legacy.go b/x/onft/types/params_legacy.go new file mode 100644 index 00000000..98c77359 --- /dev/null +++ b/x/onft/types/params_legacy.go @@ -0,0 +1,21 @@ +package types + +import ( + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" +) + +var ParamStoreKeyDenomCreationFee = []byte("DenomCreationFee") + +var _ paramtypes.ParamSet = (*Params)(nil) + +// ParamKeyTable returns the parameter key table. +func ParamKeyTable() paramtypes.KeyTable { + return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) +} + +// ParamSetPairs returns the parameter set pairs. +func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { + return paramtypes.ParamSetPairs{ + paramtypes.NewParamSetPair(ParamStoreKeyDenomCreationFee, &p.DenomCreationFee, validateDenomCreationFee), + } +} diff --git a/x/onft/types/query.pb.go b/x/onft/types/query.pb.go new file mode 100644 index 00000000..4bed50e0 --- /dev/null +++ b/x/onft/types/query.pb.go @@ -0,0 +1,4082 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: OmniFlix/onft/v1beta1/query.proto + +package types + +import ( + context "context" + fmt "fmt" + query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type QueryCollectionRequest struct { + DenomId string `protobuf:"bytes,1,opt,name=denom_id,json=denomId,proto3" json:"denom_id,omitempty" yaml:"denom_id"` + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryCollectionRequest) Reset() { *m = QueryCollectionRequest{} } +func (m *QueryCollectionRequest) String() string { return proto.CompactTextString(m) } +func (*QueryCollectionRequest) ProtoMessage() {} +func (*QueryCollectionRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_1e7e0660fe727010, []int{0} +} +func (m *QueryCollectionRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCollectionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCollectionRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCollectionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCollectionRequest.Merge(m, src) +} +func (m *QueryCollectionRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryCollectionRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCollectionRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCollectionRequest proto.InternalMessageInfo + +func (m *QueryCollectionRequest) GetDenomId() string { + if m != nil { + return m.DenomId + } + return "" +} + +func (m *QueryCollectionRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryCollectionResponse struct { + Collection *Collection `protobuf:"bytes,1,opt,name=collection,proto3" json:"collection,omitempty"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryCollectionResponse) Reset() { *m = QueryCollectionResponse{} } +func (m *QueryCollectionResponse) String() string { return proto.CompactTextString(m) } +func (*QueryCollectionResponse) ProtoMessage() {} +func (*QueryCollectionResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1e7e0660fe727010, []int{1} +} +func (m *QueryCollectionResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCollectionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCollectionResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCollectionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCollectionResponse.Merge(m, src) +} +func (m *QueryCollectionResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryCollectionResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCollectionResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCollectionResponse proto.InternalMessageInfo + +func (m *QueryCollectionResponse) GetCollection() *Collection { + if m != nil { + return m.Collection + } + return nil +} + +func (m *QueryCollectionResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryIBCCollectionRequest struct { + Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty" yaml:"hash"` + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryIBCCollectionRequest) Reset() { *m = QueryIBCCollectionRequest{} } +func (m *QueryIBCCollectionRequest) String() string { return proto.CompactTextString(m) } +func (*QueryIBCCollectionRequest) ProtoMessage() {} +func (*QueryIBCCollectionRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_1e7e0660fe727010, []int{2} +} +func (m *QueryIBCCollectionRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryIBCCollectionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryIBCCollectionRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryIBCCollectionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryIBCCollectionRequest.Merge(m, src) +} +func (m *QueryIBCCollectionRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryIBCCollectionRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryIBCCollectionRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryIBCCollectionRequest proto.InternalMessageInfo + +func (m *QueryIBCCollectionRequest) GetHash() string { + if m != nil { + return m.Hash + } + return "" +} + +func (m *QueryIBCCollectionRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryDenomRequest struct { + DenomId string `protobuf:"bytes,1,opt,name=denom_id,json=denomId,proto3" json:"denom_id,omitempty" yaml:"denom_id"` +} + +func (m *QueryDenomRequest) Reset() { *m = QueryDenomRequest{} } +func (m *QueryDenomRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDenomRequest) ProtoMessage() {} +func (*QueryDenomRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_1e7e0660fe727010, []int{3} +} +func (m *QueryDenomRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDenomRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDenomRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDenomRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDenomRequest.Merge(m, src) +} +func (m *QueryDenomRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDenomRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDenomRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDenomRequest proto.InternalMessageInfo + +func (m *QueryDenomRequest) GetDenomId() string { + if m != nil { + return m.DenomId + } + return "" +} + +type QueryDenomResponse struct { + Denom *Denom `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` +} + +func (m *QueryDenomResponse) Reset() { *m = QueryDenomResponse{} } +func (m *QueryDenomResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDenomResponse) ProtoMessage() {} +func (*QueryDenomResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1e7e0660fe727010, []int{4} +} +func (m *QueryDenomResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDenomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDenomResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDenomResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDenomResponse.Merge(m, src) +} +func (m *QueryDenomResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDenomResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDenomResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDenomResponse proto.InternalMessageInfo + +func (m *QueryDenomResponse) GetDenom() *Denom { + if m != nil { + return m.Denom + } + return nil +} + +type QueryIBCDenomRequest struct { + Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty" yaml:"hash"` +} + +func (m *QueryIBCDenomRequest) Reset() { *m = QueryIBCDenomRequest{} } +func (m *QueryIBCDenomRequest) String() string { return proto.CompactTextString(m) } +func (*QueryIBCDenomRequest) ProtoMessage() {} +func (*QueryIBCDenomRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_1e7e0660fe727010, []int{5} +} +func (m *QueryIBCDenomRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryIBCDenomRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryIBCDenomRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryIBCDenomRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryIBCDenomRequest.Merge(m, src) +} +func (m *QueryIBCDenomRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryIBCDenomRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryIBCDenomRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryIBCDenomRequest proto.InternalMessageInfo + +func (m *QueryIBCDenomRequest) GetHash() string { + if m != nil { + return m.Hash + } + return "" +} + +type QueryDenomsRequest struct { + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` + Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` +} + +func (m *QueryDenomsRequest) Reset() { *m = QueryDenomsRequest{} } +func (m *QueryDenomsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDenomsRequest) ProtoMessage() {} +func (*QueryDenomsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_1e7e0660fe727010, []int{6} +} +func (m *QueryDenomsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDenomsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDenomsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDenomsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDenomsRequest.Merge(m, src) +} +func (m *QueryDenomsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDenomsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDenomsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDenomsRequest proto.InternalMessageInfo + +func (m *QueryDenomsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +func (m *QueryDenomsRequest) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +type QueryDenomsResponse struct { + Denoms []Denom `protobuf:"bytes,1,rep,name=denoms,proto3" json:"denoms"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryDenomsResponse) Reset() { *m = QueryDenomsResponse{} } +func (m *QueryDenomsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDenomsResponse) ProtoMessage() {} +func (*QueryDenomsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1e7e0660fe727010, []int{7} +} +func (m *QueryDenomsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDenomsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDenomsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDenomsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDenomsResponse.Merge(m, src) +} +func (m *QueryDenomsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDenomsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDenomsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDenomsResponse proto.InternalMessageInfo + +func (m *QueryDenomsResponse) GetDenoms() []Denom { + if m != nil { + return m.Denoms + } + return nil +} + +func (m *QueryDenomsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryONFTRequest struct { + DenomId string `protobuf:"bytes,1,opt,name=denom_id,json=denomId,proto3" json:"denom_id,omitempty" yaml:"denom_id"` + Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *QueryONFTRequest) Reset() { *m = QueryONFTRequest{} } +func (m *QueryONFTRequest) String() string { return proto.CompactTextString(m) } +func (*QueryONFTRequest) ProtoMessage() {} +func (*QueryONFTRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_1e7e0660fe727010, []int{8} +} +func (m *QueryONFTRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryONFTRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryONFTRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryONFTRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryONFTRequest.Merge(m, src) +} +func (m *QueryONFTRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryONFTRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryONFTRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryONFTRequest proto.InternalMessageInfo + +func (m *QueryONFTRequest) GetDenomId() string { + if m != nil { + return m.DenomId + } + return "" +} + +func (m *QueryONFTRequest) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +type QueryONFTResponse struct { + ONFT *ONFT `protobuf:"bytes,1,opt,name=onft,proto3" json:"onft,omitempty"` +} + +func (m *QueryONFTResponse) Reset() { *m = QueryONFTResponse{} } +func (m *QueryONFTResponse) String() string { return proto.CompactTextString(m) } +func (*QueryONFTResponse) ProtoMessage() {} +func (*QueryONFTResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1e7e0660fe727010, []int{9} +} +func (m *QueryONFTResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryONFTResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryONFTResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryONFTResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryONFTResponse.Merge(m, src) +} +func (m *QueryONFTResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryONFTResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryONFTResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryONFTResponse proto.InternalMessageInfo + +func (m *QueryONFTResponse) GetONFT() *ONFT { + if m != nil { + return m.ONFT + } + return nil +} + +type QueryOwnerONFTsRequest struct { + DenomId string `protobuf:"bytes,1,opt,name=denom_id,json=denomId,proto3" json:"denom_id,omitempty" yaml:"denom_id"` + Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryOwnerONFTsRequest) Reset() { *m = QueryOwnerONFTsRequest{} } +func (m *QueryOwnerONFTsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryOwnerONFTsRequest) ProtoMessage() {} +func (*QueryOwnerONFTsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_1e7e0660fe727010, []int{10} +} +func (m *QueryOwnerONFTsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryOwnerONFTsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryOwnerONFTsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryOwnerONFTsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryOwnerONFTsRequest.Merge(m, src) +} +func (m *QueryOwnerONFTsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryOwnerONFTsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryOwnerONFTsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryOwnerONFTsRequest proto.InternalMessageInfo + +func (m *QueryOwnerONFTsRequest) GetDenomId() string { + if m != nil { + return m.DenomId + } + return "" +} + +func (m *QueryOwnerONFTsRequest) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +func (m *QueryOwnerONFTsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryOwnerONFTsResponse struct { + Owner *Owner `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryOwnerONFTsResponse) Reset() { *m = QueryOwnerONFTsResponse{} } +func (m *QueryOwnerONFTsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryOwnerONFTsResponse) ProtoMessage() {} +func (*QueryOwnerONFTsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1e7e0660fe727010, []int{11} +} +func (m *QueryOwnerONFTsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryOwnerONFTsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryOwnerONFTsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryOwnerONFTsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryOwnerONFTsResponse.Merge(m, src) +} +func (m *QueryOwnerONFTsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryOwnerONFTsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryOwnerONFTsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryOwnerONFTsResponse proto.InternalMessageInfo + +func (m *QueryOwnerONFTsResponse) GetOwner() *Owner { + if m != nil { + return m.Owner + } + return nil +} + +func (m *QueryOwnerONFTsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +type QuerySupplyRequest struct { + DenomId string `protobuf:"bytes,1,opt,name=denom_id,json=denomId,proto3" json:"denom_id,omitempty" yaml:"denom_id"` + Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` +} + +func (m *QuerySupplyRequest) Reset() { *m = QuerySupplyRequest{} } +func (m *QuerySupplyRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySupplyRequest) ProtoMessage() {} +func (*QuerySupplyRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_1e7e0660fe727010, []int{12} +} +func (m *QuerySupplyRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySupplyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySupplyRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QuerySupplyRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySupplyRequest.Merge(m, src) +} +func (m *QuerySupplyRequest) XXX_Size() int { + return m.Size() +} +func (m *QuerySupplyRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySupplyRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySupplyRequest proto.InternalMessageInfo + +func (m *QuerySupplyRequest) GetDenomId() string { + if m != nil { + return m.DenomId + } + return "" +} + +func (m *QuerySupplyRequest) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +type QuerySupplyResponse struct { + Amount uint64 `protobuf:"varint,1,opt,name=amount,proto3" json:"amount,omitempty"` +} + +func (m *QuerySupplyResponse) Reset() { *m = QuerySupplyResponse{} } +func (m *QuerySupplyResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySupplyResponse) ProtoMessage() {} +func (*QuerySupplyResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1e7e0660fe727010, []int{13} +} +func (m *QuerySupplyResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySupplyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySupplyResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QuerySupplyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySupplyResponse.Merge(m, src) +} +func (m *QuerySupplyResponse) XXX_Size() int { + return m.Size() +} +func (m *QuerySupplyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySupplyResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySupplyResponse proto.InternalMessageInfo + +func (m *QuerySupplyResponse) GetAmount() uint64 { + if m != nil { + return m.Amount + } + return 0 +} + +type OwnerONFTCollection struct { + Denom Denom `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom"` + Onfts []ONFT `protobuf:"bytes,2,rep,name=onfts,proto3" json:"onfts"` +} + +func (m *OwnerONFTCollection) Reset() { *m = OwnerONFTCollection{} } +func (m *OwnerONFTCollection) String() string { return proto.CompactTextString(m) } +func (*OwnerONFTCollection) ProtoMessage() {} +func (*OwnerONFTCollection) Descriptor() ([]byte, []int) { + return fileDescriptor_1e7e0660fe727010, []int{14} +} +func (m *OwnerONFTCollection) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OwnerONFTCollection) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OwnerONFTCollection.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *OwnerONFTCollection) XXX_Merge(src proto.Message) { + xxx_messageInfo_OwnerONFTCollection.Merge(m, src) +} +func (m *OwnerONFTCollection) XXX_Size() int { + return m.Size() +} +func (m *OwnerONFTCollection) XXX_DiscardUnknown() { + xxx_messageInfo_OwnerONFTCollection.DiscardUnknown(m) +} + +var xxx_messageInfo_OwnerONFTCollection proto.InternalMessageInfo + +func (m *OwnerONFTCollection) GetDenom() Denom { + if m != nil { + return m.Denom + } + return Denom{} +} + +func (m *OwnerONFTCollection) GetOnfts() []ONFT { + if m != nil { + return m.Onfts + } + return nil +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +type QueryParamsRequest struct { +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_1e7e0660fe727010, []int{15} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +// QueryParamsResponse is the response type for the Query/Params RPC method. +type QueryParamsResponse struct { + // params defines the parameters of the module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1e7e0660fe727010, []int{16} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func init() { + proto.RegisterType((*QueryCollectionRequest)(nil), "OmniFlix.onft.v1beta1.QueryCollectionRequest") + proto.RegisterType((*QueryCollectionResponse)(nil), "OmniFlix.onft.v1beta1.QueryCollectionResponse") + proto.RegisterType((*QueryIBCCollectionRequest)(nil), "OmniFlix.onft.v1beta1.QueryIBCCollectionRequest") + proto.RegisterType((*QueryDenomRequest)(nil), "OmniFlix.onft.v1beta1.QueryDenomRequest") + proto.RegisterType((*QueryDenomResponse)(nil), "OmniFlix.onft.v1beta1.QueryDenomResponse") + proto.RegisterType((*QueryIBCDenomRequest)(nil), "OmniFlix.onft.v1beta1.QueryIBCDenomRequest") + proto.RegisterType((*QueryDenomsRequest)(nil), "OmniFlix.onft.v1beta1.QueryDenomsRequest") + proto.RegisterType((*QueryDenomsResponse)(nil), "OmniFlix.onft.v1beta1.QueryDenomsResponse") + proto.RegisterType((*QueryONFTRequest)(nil), "OmniFlix.onft.v1beta1.QueryONFTRequest") + proto.RegisterType((*QueryONFTResponse)(nil), "OmniFlix.onft.v1beta1.QueryONFTResponse") + proto.RegisterType((*QueryOwnerONFTsRequest)(nil), "OmniFlix.onft.v1beta1.QueryOwnerONFTsRequest") + proto.RegisterType((*QueryOwnerONFTsResponse)(nil), "OmniFlix.onft.v1beta1.QueryOwnerONFTsResponse") + proto.RegisterType((*QuerySupplyRequest)(nil), "OmniFlix.onft.v1beta1.QuerySupplyRequest") + proto.RegisterType((*QuerySupplyResponse)(nil), "OmniFlix.onft.v1beta1.QuerySupplyResponse") + proto.RegisterType((*OwnerONFTCollection)(nil), "OmniFlix.onft.v1beta1.OwnerONFTCollection") + proto.RegisterType((*QueryParamsRequest)(nil), "OmniFlix.onft.v1beta1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "OmniFlix.onft.v1beta1.QueryParamsResponse") +} + +func init() { proto.RegisterFile("OmniFlix/onft/v1beta1/query.proto", fileDescriptor_1e7e0660fe727010) } + +var fileDescriptor_1e7e0660fe727010 = []byte{ + // 944 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x97, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xc7, 0x3d, 0xae, 0x6d, 0xd2, 0x17, 0x41, 0x61, 0x62, 0x8a, 0x31, 0xad, 0xed, 0x0e, 0x82, + 0x9a, 0xa0, 0xec, 0x34, 0xae, 0x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3, 0x7e, 0xde, 0xb3, 0xb9, + 0x8f, 0x0d, 0x58, 0x6b, 0xd8, 0x1e, 0x73, 0xbf, 0x74, 0x1a, 0x39, 0x54, 0x42, 0xe5, 0xeb, 0xd5, + 0x8d, 0x8b, 0x61, 0xf1, 0x46, 0xdf, 0x72, 0xdb, 0x8f, 0x48, 0x70, 0x42, 0xcc, 0x97, 0xe4, 0xc7, + 0xfd, 0x06, 0xde, 0x03, 0x18, 0x87, 0xcf, 0x25, 0x4b, 0xa8, 0xbc, 0x5e, 0x79, 0xd7, 0x50, 0x2c, + 0x86, 0x60, 0x31, 0x94, 0x6a, 0x9a, 0xc5, 0x78, 0x62, 0x35, 0x6d, 0x7d, 0x97, 0x19, 0xf2, 0x24, + 0xbf, 0x21, 0x78, 0x63, 0x02, 0x89, 0x77, 0x98, 0xc7, 0x6d, 0xfc, 0x11, 0x40, 0xfd, 0xf2, 0x57, + 0x49, 0xb5, 0x5e, 0xb9, 0x63, 0x4c, 0x2d, 0x80, 0x11, 0x72, 0x0f, 0x39, 0xe1, 0x4f, 0xa6, 0x60, + 0xde, 0x9d, 0x8b, 0xa9, 0xee, 0x8f, 0x70, 0x7e, 0x87, 0xe0, 0x4d, 0xc9, 0xb9, 0x5f, 0xdd, 0x9d, + 0x54, 0xef, 0x6d, 0x48, 0xb5, 0x2c, 0xde, 0xd2, 0xca, 0xdd, 0xb8, 0x18, 0x16, 0xd7, 0x95, 0x72, + 0xe2, 0x57, 0x62, 0xca, 0xc3, 0x95, 0x49, 0xb6, 0x0b, 0xaf, 0x49, 0x92, 0x8f, 0x45, 0x29, 0x96, + 0xac, 0x1f, 0xf9, 0x14, 0x70, 0x38, 0x88, 0x56, 0xbc, 0x02, 0x69, 0x69, 0xa0, 0xc5, 0xbe, 0x35, + 0x43, 0x6c, 0xe5, 0xa4, 0x4c, 0xc9, 0x0e, 0x64, 0x03, 0x61, 0x22, 0x44, 0x8b, 0x68, 0x42, 0xba, + 0x61, 0x0c, 0x1e, 0xb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f1, 0xed, 0x58, 0x26, 0x7c, 0x82, 0x40, 0xce, 0x76, 0x7c, 0x37, 0x2e, 0x76, 0x68, 0x1d, 0xe5, + 0xcb, 0xf3, 0x0d, 0x35, 0xc2, 0x8e, 0x44, 0x78, 0x80, 0xef, 0x2f, 0x5a, 0x2d, 0x79, 0xcc, 0xe9, + 0x40, 0x14, 0xee, 0x57, 0x04, 0x30, 0x9e, 0xdb, 0xf1, 0x2f, 0x73, 0x62, 0x11, 0xc5, 0xb7, 0xfb, + 0xe4, 0x3a, 0x20, 0x0f, 0x25, 0xea, 0x36, 0xa6, 0x33, 0x50, 0x35, 0xd8, 0x98, 0x74, 0x20, 0xa7, + 0xed, 0x11, 0xfe, 0x09, 0x41, 0x46, 0x8d, 0xda, 0xf8, 0x42, 0x46, 0x46, 0x7d, 0x7c, 0x21, 0xa3, + 0x93, 0x7b, 0x2e, 0xda, 0xa4, 0x8a, 0x5c, 0xf1, 0x88, 0x1e, 0x53, 0xe3, 0x2f, 0x1e, 0x2d, 0x32, + 0x6f, 0xe3, 0xd1, 0xa2, 0x43, 0x78, 0x6e, 0x8f, 0xa9, 0x71, 0x5b, 0xdd, 0x3f, 0x1d, 0x15, 0xd0, + 0xd9, 0xa8, 0x80, 0xfe, 0x1e, 0x15, 0xd0, 0xf1, 0x79, 0x21, 0x71, 0x76, 0x5e, 0x48, 0xfc, 0x75, + 0x5e, 0x48, 0x3c, 0xa5, 0x4d, 0xc7, 0x6f, 0xf5, 0x6a, 0x46, 0x9d, 0xb9, 0x74, 0xfc, 0x67, 0x47, + 0xc7, 0x6a, 0xf5, 0x6a, 0xf4, 0xb0, 0x42, 0x75, 0x4c, 0xbf, 0xdf, 0xb1, 0x79, 0x2d, 0x23, 0xff, + 0xc9, 0xdc, 0xff, 0x2f, 0x00, 0x00, 0xff, 0xff, 0xb2, 0x26, 0x81, 0x0b, 0xab, 0x0d, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + Collection(ctx context.Context, in *QueryCollectionRequest, opts ...grpc.CallOption) (*QueryCollectionResponse, error) + IBCCollection(ctx context.Context, in *QueryIBCCollectionRequest, opts ...grpc.CallOption) (*QueryCollectionResponse, error) + Denom(ctx context.Context, in *QueryDenomRequest, opts ...grpc.CallOption) (*QueryDenomResponse, error) + IBCDenom(ctx context.Context, in *QueryIBCDenomRequest, opts ...grpc.CallOption) (*QueryDenomResponse, error) + Denoms(ctx context.Context, in *QueryDenomsRequest, opts ...grpc.CallOption) (*QueryDenomsResponse, error) + ONFT(ctx context.Context, in *QueryONFTRequest, opts ...grpc.CallOption) (*QueryONFTResponse, error) + OwnerONFTs(ctx context.Context, in *QueryOwnerONFTsRequest, opts ...grpc.CallOption) (*QueryOwnerONFTsResponse, error) + Supply(ctx context.Context, in *QuerySupplyRequest, opts ...grpc.CallOption) (*QuerySupplyResponse, error) + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Collection(ctx context.Context, in *QueryCollectionRequest, opts ...grpc.CallOption) (*QueryCollectionResponse, error) { + out := new(QueryCollectionResponse) + err := c.cc.Invoke(ctx, "/OmniFlix.onft.v1beta1.Query/Collection", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) IBCCollection(ctx context.Context, in *QueryIBCCollectionRequest, opts ...grpc.CallOption) (*QueryCollectionResponse, error) { + out := new(QueryCollectionResponse) + err := c.cc.Invoke(ctx, "/OmniFlix.onft.v1beta1.Query/IBCCollection", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Denom(ctx context.Context, in *QueryDenomRequest, opts ...grpc.CallOption) (*QueryDenomResponse, error) { + out := new(QueryDenomResponse) + err := c.cc.Invoke(ctx, "/OmniFlix.onft.v1beta1.Query/Denom", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) IBCDenom(ctx context.Context, in *QueryIBCDenomRequest, opts ...grpc.CallOption) (*QueryDenomResponse, error) { + out := new(QueryDenomResponse) + err := c.cc.Invoke(ctx, "/OmniFlix.onft.v1beta1.Query/IBCDenom", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Denoms(ctx context.Context, in *QueryDenomsRequest, opts ...grpc.CallOption) (*QueryDenomsResponse, error) { + out := new(QueryDenomsResponse) + err := c.cc.Invoke(ctx, "/OmniFlix.onft.v1beta1.Query/Denoms", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ONFT(ctx context.Context, in *QueryONFTRequest, opts ...grpc.CallOption) (*QueryONFTResponse, error) { + out := new(QueryONFTResponse) + err := c.cc.Invoke(ctx, "/OmniFlix.onft.v1beta1.Query/ONFT", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) OwnerONFTs(ctx context.Context, in *QueryOwnerONFTsRequest, opts ...grpc.CallOption) (*QueryOwnerONFTsResponse, error) { + out := new(QueryOwnerONFTsResponse) + err := c.cc.Invoke(ctx, "/OmniFlix.onft.v1beta1.Query/OwnerONFTs", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Supply(ctx context.Context, in *QuerySupplyRequest, opts ...grpc.CallOption) (*QuerySupplyResponse, error) { + out := new(QuerySupplyResponse) + err := c.cc.Invoke(ctx, "/OmniFlix.onft.v1beta1.Query/Supply", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/OmniFlix.onft.v1beta1.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + Collection(context.Context, *QueryCollectionRequest) (*QueryCollectionResponse, error) + IBCCollection(context.Context, *QueryIBCCollectionRequest) (*QueryCollectionResponse, error) + Denom(context.Context, *QueryDenomRequest) (*QueryDenomResponse, error) + IBCDenom(context.Context, *QueryIBCDenomRequest) (*QueryDenomResponse, error) + Denoms(context.Context, *QueryDenomsRequest) (*QueryDenomsResponse, error) + ONFT(context.Context, *QueryONFTRequest) (*QueryONFTResponse, error) + OwnerONFTs(context.Context, *QueryOwnerONFTsRequest) (*QueryOwnerONFTsResponse, error) + Supply(context.Context, *QuerySupplyRequest) (*QuerySupplyResponse, error) + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Collection(ctx context.Context, req *QueryCollectionRequest) (*QueryCollectionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Collection not implemented") +} +func (*UnimplementedQueryServer) IBCCollection(ctx context.Context, req *QueryIBCCollectionRequest) (*QueryCollectionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method IBCCollection not implemented") +} +func (*UnimplementedQueryServer) Denom(ctx context.Context, req *QueryDenomRequest) (*QueryDenomResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Denom not implemented") +} +func (*UnimplementedQueryServer) IBCDenom(ctx context.Context, req *QueryIBCDenomRequest) (*QueryDenomResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method IBCDenom not implemented") +} +func (*UnimplementedQueryServer) Denoms(ctx context.Context, req *QueryDenomsRequest) (*QueryDenomsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Denoms not implemented") +} +func (*UnimplementedQueryServer) ONFT(ctx context.Context, req *QueryONFTRequest) (*QueryONFTResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ONFT not implemented") +} +func (*UnimplementedQueryServer) OwnerONFTs(ctx context.Context, req *QueryOwnerONFTsRequest) (*QueryOwnerONFTsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method OwnerONFTs not implemented") +} +func (*UnimplementedQueryServer) Supply(ctx context.Context, req *QuerySupplyRequest) (*QuerySupplyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Supply not implemented") +} +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Collection_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryCollectionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Collection(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/OmniFlix.onft.v1beta1.Query/Collection", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Collection(ctx, req.(*QueryCollectionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_IBCCollection_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryIBCCollectionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).IBCCollection(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/OmniFlix.onft.v1beta1.Query/IBCCollection", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).IBCCollection(ctx, req.(*QueryIBCCollectionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Denom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDenomRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Denom(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/OmniFlix.onft.v1beta1.Query/Denom", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Denom(ctx, req.(*QueryDenomRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_IBCDenom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryIBCDenomRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).IBCDenom(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/OmniFlix.onft.v1beta1.Query/IBCDenom", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).IBCDenom(ctx, req.(*QueryIBCDenomRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Denoms_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDenomsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Denoms(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/OmniFlix.onft.v1beta1.Query/Denoms", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Denoms(ctx, req.(*QueryDenomsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ONFT_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryONFTRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ONFT(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/OmniFlix.onft.v1beta1.Query/ONFT", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ONFT(ctx, req.(*QueryONFTRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_OwnerONFTs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryOwnerONFTsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).OwnerONFTs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/OmniFlix.onft.v1beta1.Query/OwnerONFTs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).OwnerONFTs(ctx, req.(*QueryOwnerONFTsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Supply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySupplyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Supply(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/OmniFlix.onft.v1beta1.Query/Supply", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Supply(ctx, req.(*QuerySupplyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/OmniFlix.onft.v1beta1.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "OmniFlix.onft.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Collection", + Handler: _Query_Collection_Handler, + }, + { + MethodName: "IBCCollection", + Handler: _Query_IBCCollection_Handler, + }, + { + MethodName: "Denom", + Handler: _Query_Denom_Handler, + }, + { + MethodName: "IBCDenom", + Handler: _Query_IBCDenom_Handler, + }, + { + MethodName: "Denoms", + Handler: _Query_Denoms_Handler, + }, + { + MethodName: "ONFT", + Handler: _Query_ONFT_Handler, + }, + { + MethodName: "OwnerONFTs", + Handler: _Query_OwnerONFTs_Handler, + }, + { + MethodName: "Supply", + Handler: _Query_Supply_Handler, + }, + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "OmniFlix/onft/v1beta1/query.proto", +} + +func (m *QueryCollectionRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCollectionRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCollectionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.DenomId) > 0 { + i -= len(m.DenomId) + copy(dAtA[i:], m.DenomId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.DenomId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryCollectionResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCollectionResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCollectionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Collection != nil { + { + size, err := m.Collection.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryIBCCollectionRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryIBCCollectionRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryIBCCollectionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryDenomRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDenomRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDenomRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.DenomId) > 0 { + i -= len(m.DenomId) + copy(dAtA[i:], m.DenomId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.DenomId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryDenomResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDenomResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDenomResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Denom != nil { + { + size, err := m.Denom.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryIBCDenomRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryIBCDenomRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryIBCDenomRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryDenomsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDenomsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDenomsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x12 + } + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryDenomsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDenomsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDenomsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Denoms) > 0 { + for iNdEx := len(m.Denoms) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Denoms[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryONFTRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryONFTRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryONFTRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0x12 + } + if len(m.DenomId) > 0 { + i -= len(m.DenomId) + copy(dAtA[i:], m.DenomId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.DenomId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryONFTResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryONFTResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryONFTResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ONFT != nil { + { + size, err := m.ONFT.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryOwnerONFTsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryOwnerONFTsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryOwnerONFTsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x12 + } + if len(m.DenomId) > 0 { + i -= len(m.DenomId) + copy(dAtA[i:], m.DenomId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.DenomId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryOwnerONFTsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryOwnerONFTsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryOwnerONFTsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Owner != nil { + { + size, err := m.Owner.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QuerySupplyRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QuerySupplyRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySupplyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x12 + } + if len(m.DenomId) > 0 { + i -= len(m.DenomId) + copy(dAtA[i:], m.DenomId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.DenomId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QuerySupplyResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QuerySupplyResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySupplyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Amount != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Amount)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *OwnerONFTCollection) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *OwnerONFTCollection) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OwnerONFTCollection) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Onfts) > 0 { + for iNdEx := len(m.Onfts) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Onfts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.Denom.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryCollectionRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DenomId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryCollectionResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Collection != nil { + l = m.Collection.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryIBCCollectionRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDenomRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DenomId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDenomResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Denom != nil { + l = m.Denom.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryIBCDenomRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDenomsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDenomsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Denoms) > 0 { + for _, e := range m.Denoms { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryONFTRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DenomId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Id) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryONFTResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ONFT != nil { + l = m.ONFT.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryOwnerONFTsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DenomId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryOwnerONFTsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Owner != nil { + l = m.Owner.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySupplyRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DenomId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySupplyResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Amount != 0 { + n += 1 + sovQuery(uint64(m.Amount)) + } + return n +} + +func (m *OwnerONFTCollection) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Denom.Size() + n += 1 + l + sovQuery(uint64(l)) + if len(m.Onfts) > 0 { + for _, e := range m.Onfts { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryCollectionRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryCollectionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCollectionRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DenomId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DenomId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryCollectionResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryCollectionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCollectionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Collection", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Collection == nil { + m.Collection = &Collection{} + } + if err := m.Collection.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryIBCCollectionRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryIBCCollectionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryIBCCollectionRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDenomRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDenomRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDenomRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DenomId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DenomId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDenomResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDenomResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDenomResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Denom == nil { + m.Denom = &Denom{} + } + if err := m.Denom.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryIBCDenomRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryIBCDenomRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryIBCDenomRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDenomsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDenomsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDenomsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDenomsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDenomsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDenomsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denoms", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denoms = append(m.Denoms, Denom{}) + if err := m.Denoms[len(m.Denoms)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryONFTRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryONFTRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryONFTRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DenomId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DenomId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryONFTResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryONFTResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryONFTResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ONFT", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ONFT == nil { + m.ONFT = &ONFT{} + } + if err := m.ONFT.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryOwnerONFTsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryOwnerONFTsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryOwnerONFTsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DenomId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DenomId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryOwnerONFTsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryOwnerONFTsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryOwnerONFTsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Owner == nil { + m.Owner = &Owner{} + } + if err := m.Owner.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySupplyRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QuerySupplyRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySupplyRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DenomId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DenomId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySupplyResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QuerySupplyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySupplyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + m.Amount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Amount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OwnerONFTCollection) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: OwnerONFTCollection: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OwnerONFTCollection: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Denom.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Onfts", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Onfts = append(m.Onfts, ONFT{}) + if err := m.Onfts[len(m.Onfts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/onft/types/query.pb.gw.go b/x/onft/types/query.pb.gw.go new file mode 100644 index 00000000..48d04203 --- /dev/null +++ b/x/onft/types/query.pb.gw.go @@ -0,0 +1,1059 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: OmniFlix/onft/v1beta1/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +var ( + filter_Query_Collection_0 = &utilities.DoubleArray{Encoding: map[string]int{"denom_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_Collection_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCollectionRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["denom_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom_id") + } + + protoReq.DenomId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Collection_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Collection(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Collection_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCollectionRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["denom_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom_id") + } + + protoReq.DenomId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Collection_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Collection(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_IBCCollection_0 = &utilities.DoubleArray{Encoding: map[string]int{"hash": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_IBCCollection_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryIBCCollectionRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["hash"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "hash") + } + + protoReq.Hash, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "hash", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_IBCCollection_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.IBCCollection(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_IBCCollection_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryIBCCollectionRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["hash"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "hash") + } + + protoReq.Hash, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "hash", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_IBCCollection_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.IBCCollection(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Denom_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDenomRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["denom_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom_id") + } + + protoReq.DenomId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom_id", err) + } + + msg, err := client.Denom(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Denom_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDenomRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["denom_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom_id") + } + + protoReq.DenomId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom_id", err) + } + + msg, err := server.Denom(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_IBCDenom_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryIBCDenomRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["hash"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "hash") + } + + protoReq.Hash, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "hash", err) + } + + msg, err := client.IBCDenom(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_IBCDenom_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryIBCDenomRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["hash"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "hash") + } + + protoReq.Hash, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "hash", err) + } + + msg, err := server.IBCDenom(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_Denoms_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_Denoms_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDenomsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Denoms_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Denoms(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Denoms_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDenomsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Denoms_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Denoms(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_ONFT_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryONFTRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["denom_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom_id") + } + + protoReq.DenomId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom_id", err) + } + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.ONFT(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ONFT_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryONFTRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["denom_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom_id") + } + + protoReq.DenomId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom_id", err) + } + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.ONFT(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_OwnerONFTs_0 = &utilities.DoubleArray{Encoding: map[string]int{"denom_id": 0, "owner": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} +) + +func request_Query_OwnerONFTs_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryOwnerONFTsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["denom_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom_id") + } + + protoReq.DenomId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom_id", err) + } + + val, ok = pathParams["owner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "owner") + } + + protoReq.Owner, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "owner", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_OwnerONFTs_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.OwnerONFTs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_OwnerONFTs_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryOwnerONFTsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["denom_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom_id") + } + + protoReq.DenomId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom_id", err) + } + + val, ok = pathParams["owner"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "owner") + } + + protoReq.Owner, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "owner", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_OwnerONFTs_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.OwnerONFTs(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_Supply_0 = &utilities.DoubleArray{Encoding: map[string]int{"denom_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_Supply_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySupplyRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["denom_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom_id") + } + + protoReq.DenomId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Supply_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Supply(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Supply_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySupplyRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["denom_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom_id") + } + + protoReq.DenomId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Supply_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Supply(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Collection_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Collection_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Collection_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_IBCCollection_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_IBCCollection_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_IBCCollection_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Denom_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Denom_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Denom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_IBCDenom_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_IBCDenom_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_IBCDenom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Denoms_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Denoms_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Denoms_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ONFT_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_ONFT_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ONFT_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_OwnerONFTs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_OwnerONFTs_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_OwnerONFTs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Supply_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Supply_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Supply_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Collection_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Collection_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Collection_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_IBCCollection_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_IBCCollection_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_IBCCollection_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Denom_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Denom_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Denom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_IBCDenom_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_IBCDenom_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_IBCDenom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Denoms_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Denoms_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Denoms_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ONFT_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_ONFT_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ONFT_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_OwnerONFTs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_OwnerONFTs_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_OwnerONFTs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Supply_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Supply_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Supply_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Collection_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"omniflix", "onft", "v1beta1", "collections", "denom_id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_IBCCollection_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"omniflix", "onft", "v1beta1", "collections", "ibc", "hash"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Denom_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"omniflix", "onft", "v1beta1", "denoms", "denom_id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_IBCDenom_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"omniflix", "onft", "v1beta1", "denoms", "ibc", "hash"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Denoms_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"omniflix", "onft", "v1beta1", "denoms"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_ONFT_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"omniflix", "onft", "v1beta1", "denoms", "denom_id", "onfts", "id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_OwnerONFTs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"omniflix", "onft", "v1beta1", "onfts", "denom_id", "owner"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Supply_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"omniflix", "onft", "v1beta1", "denoms", "denom_id", "supply"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"omniflix", "onft", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Collection_0 = runtime.ForwardResponseMessage + + forward_Query_IBCCollection_0 = runtime.ForwardResponseMessage + + forward_Query_Denom_0 = runtime.ForwardResponseMessage + + forward_Query_IBCDenom_0 = runtime.ForwardResponseMessage + + forward_Query_Denoms_0 = runtime.ForwardResponseMessage + + forward_Query_ONFT_0 = runtime.ForwardResponseMessage + + forward_Query_OwnerONFTs_0 = runtime.ForwardResponseMessage + + forward_Query_Supply_0 = runtime.ForwardResponseMessage + + forward_Query_Params_0 = runtime.ForwardResponseMessage +) diff --git a/x/onft/types/tx.pb.go b/x/onft/types/tx.pb.go new file mode 100644 index 00000000..1ecea70f --- /dev/null +++ b/x/onft/types/tx.pb.go @@ -0,0 +1,4073 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: OmniFlix/onft/v1beta1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type MsgCreateDenom struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Symbol string `protobuf:"bytes,2,opt,name=symbol,proto3" json:"symbol,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` + PreviewURI string `protobuf:"bytes,5,opt,name=preview_uri,json=previewUri,proto3" json:"preview_uri,omitempty" yaml:"preview_uri"` + Schema string `protobuf:"bytes,6,opt,name=schema,proto3" json:"schema,omitempty"` + Sender string `protobuf:"bytes,7,opt,name=sender,proto3" json:"sender,omitempty"` + CreationFee types.Coin `protobuf:"bytes,8,opt,name=creation_fee,json=creationFee,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coin" json:"creation_fee" yaml:"creation_fee"` + Uri string `protobuf:"bytes,9,opt,name=uri,proto3" json:"uri,omitempty"` + UriHash string `protobuf:"bytes,10,opt,name=uri_hash,json=uriHash,proto3" json:"uri_hash,omitempty"` + Data string `protobuf:"bytes,11,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *MsgCreateDenom) Reset() { *m = MsgCreateDenom{} } +func (m *MsgCreateDenom) String() string { return proto.CompactTextString(m) } +func (*MsgCreateDenom) ProtoMessage() {} +func (*MsgCreateDenom) Descriptor() ([]byte, []int) { + return fileDescriptor_adb8c7aefdb74d05, []int{0} +} +func (m *MsgCreateDenom) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateDenom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateDenom.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCreateDenom) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateDenom.Merge(m, src) +} +func (m *MsgCreateDenom) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateDenom) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateDenom.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateDenom proto.InternalMessageInfo + +type MsgCreateDenomResponse struct { +} + +func (m *MsgCreateDenomResponse) Reset() { *m = MsgCreateDenomResponse{} } +func (m *MsgCreateDenomResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateDenomResponse) ProtoMessage() {} +func (*MsgCreateDenomResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_adb8c7aefdb74d05, []int{1} +} +func (m *MsgCreateDenomResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateDenomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateDenomResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCreateDenomResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateDenomResponse.Merge(m, src) +} +func (m *MsgCreateDenomResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateDenomResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateDenomResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateDenomResponse proto.InternalMessageInfo + +type MsgUpdateDenom struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + PreviewURI string `protobuf:"bytes,4,opt,name=preview_uri,json=previewUri,proto3" json:"preview_uri,omitempty" yaml:"preview_uri"` + Sender string `protobuf:"bytes,5,opt,name=sender,proto3" json:"sender,omitempty"` +} + +func (m *MsgUpdateDenom) Reset() { *m = MsgUpdateDenom{} } +func (m *MsgUpdateDenom) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateDenom) ProtoMessage() {} +func (*MsgUpdateDenom) Descriptor() ([]byte, []int) { + return fileDescriptor_adb8c7aefdb74d05, []int{2} +} +func (m *MsgUpdateDenom) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateDenom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateDenom.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateDenom) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateDenom.Merge(m, src) +} +func (m *MsgUpdateDenom) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateDenom) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateDenom.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateDenom proto.InternalMessageInfo + +type MsgUpdateDenomResponse struct { +} + +func (m *MsgUpdateDenomResponse) Reset() { *m = MsgUpdateDenomResponse{} } +func (m *MsgUpdateDenomResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateDenomResponse) ProtoMessage() {} +func (*MsgUpdateDenomResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_adb8c7aefdb74d05, []int{3} +} +func (m *MsgUpdateDenomResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateDenomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateDenomResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateDenomResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateDenomResponse.Merge(m, src) +} +func (m *MsgUpdateDenomResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateDenomResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateDenomResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateDenomResponse proto.InternalMessageInfo + +type MsgTransferDenom struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Sender string `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty"` + Recipient string `protobuf:"bytes,3,opt,name=recipient,proto3" json:"recipient,omitempty"` +} + +func (m *MsgTransferDenom) Reset() { *m = MsgTransferDenom{} } +func (m *MsgTransferDenom) String() string { return proto.CompactTextString(m) } +func (*MsgTransferDenom) ProtoMessage() {} +func (*MsgTransferDenom) Descriptor() ([]byte, []int) { + return fileDescriptor_adb8c7aefdb74d05, []int{4} +} +func (m *MsgTransferDenom) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTransferDenom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTransferDenom.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgTransferDenom) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTransferDenom.Merge(m, src) +} +func (m *MsgTransferDenom) XXX_Size() int { + return m.Size() +} +func (m *MsgTransferDenom) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTransferDenom.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTransferDenom proto.InternalMessageInfo + +type MsgTransferDenomResponse struct { +} + +func (m *MsgTransferDenomResponse) Reset() { *m = MsgTransferDenomResponse{} } +func (m *MsgTransferDenomResponse) String() string { return proto.CompactTextString(m) } +func (*MsgTransferDenomResponse) ProtoMessage() {} +func (*MsgTransferDenomResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_adb8c7aefdb74d05, []int{5} +} +func (m *MsgTransferDenomResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTransferDenomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTransferDenomResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgTransferDenomResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTransferDenomResponse.Merge(m, src) +} +func (m *MsgTransferDenomResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgTransferDenomResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTransferDenomResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTransferDenomResponse proto.InternalMessageInfo + +type MsgMintONFT struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + DenomId string `protobuf:"bytes,2,opt,name=denom_id,json=denomId,proto3" json:"denom_id,omitempty" yaml:"denom_id"` + Metadata Metadata `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata"` + Data string `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` + Transferable bool `protobuf:"varint,5,opt,name=transferable,proto3" json:"transferable,omitempty"` + Extensible bool `protobuf:"varint,6,opt,name=extensible,proto3" json:"extensible,omitempty"` + Nsfw bool `protobuf:"varint,7,opt,name=nsfw,proto3" json:"nsfw,omitempty"` + RoyaltyShare github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=royalty_share,json=royaltyShare,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"royalty_share" yaml:"royalty_share"` + Sender string `protobuf:"bytes,9,opt,name=sender,proto3" json:"sender,omitempty"` + Recipient string `protobuf:"bytes,10,opt,name=recipient,proto3" json:"recipient,omitempty"` +} + +func (m *MsgMintONFT) Reset() { *m = MsgMintONFT{} } +func (m *MsgMintONFT) String() string { return proto.CompactTextString(m) } +func (*MsgMintONFT) ProtoMessage() {} +func (*MsgMintONFT) Descriptor() ([]byte, []int) { + return fileDescriptor_adb8c7aefdb74d05, []int{6} +} +func (m *MsgMintONFT) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgMintONFT) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgMintONFT.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgMintONFT) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgMintONFT.Merge(m, src) +} +func (m *MsgMintONFT) XXX_Size() int { + return m.Size() +} +func (m *MsgMintONFT) XXX_DiscardUnknown() { + xxx_messageInfo_MsgMintONFT.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgMintONFT proto.InternalMessageInfo + +type MsgMintONFTResponse struct { +} + +func (m *MsgMintONFTResponse) Reset() { *m = MsgMintONFTResponse{} } +func (m *MsgMintONFTResponse) String() string { return proto.CompactTextString(m) } +func (*MsgMintONFTResponse) ProtoMessage() {} +func (*MsgMintONFTResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_adb8c7aefdb74d05, []int{7} +} +func (m *MsgMintONFTResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgMintONFTResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgMintONFTResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgMintONFTResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgMintONFTResponse.Merge(m, src) +} +func (m *MsgMintONFTResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgMintONFTResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgMintONFTResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgMintONFTResponse proto.InternalMessageInfo + +type MsgTransferONFT struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + DenomId string `protobuf:"bytes,2,opt,name=denom_id,json=denomId,proto3" json:"denom_id,omitempty" yaml:"denom_id"` + Sender string `protobuf:"bytes,3,opt,name=sender,proto3" json:"sender,omitempty"` + Recipient string `protobuf:"bytes,4,opt,name=recipient,proto3" json:"recipient,omitempty"` +} + +func (m *MsgTransferONFT) Reset() { *m = MsgTransferONFT{} } +func (m *MsgTransferONFT) String() string { return proto.CompactTextString(m) } +func (*MsgTransferONFT) ProtoMessage() {} +func (*MsgTransferONFT) Descriptor() ([]byte, []int) { + return fileDescriptor_adb8c7aefdb74d05, []int{8} +} +func (m *MsgTransferONFT) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTransferONFT) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTransferONFT.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgTransferONFT) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTransferONFT.Merge(m, src) +} +func (m *MsgTransferONFT) XXX_Size() int { + return m.Size() +} +func (m *MsgTransferONFT) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTransferONFT.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTransferONFT proto.InternalMessageInfo + +type MsgTransferONFTResponse struct { +} + +func (m *MsgTransferONFTResponse) Reset() { *m = MsgTransferONFTResponse{} } +func (m *MsgTransferONFTResponse) String() string { return proto.CompactTextString(m) } +func (*MsgTransferONFTResponse) ProtoMessage() {} +func (*MsgTransferONFTResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_adb8c7aefdb74d05, []int{9} +} +func (m *MsgTransferONFTResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTransferONFTResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTransferONFTResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgTransferONFTResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTransferONFTResponse.Merge(m, src) +} +func (m *MsgTransferONFTResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgTransferONFTResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTransferONFTResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTransferONFTResponse proto.InternalMessageInfo + +type MsgBurnONFT struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + DenomId string `protobuf:"bytes,2,opt,name=denom_id,json=denomId,proto3" json:"denom_id,omitempty" yaml:"denom_id"` + Sender string `protobuf:"bytes,3,opt,name=sender,proto3" json:"sender,omitempty"` +} + +func (m *MsgBurnONFT) Reset() { *m = MsgBurnONFT{} } +func (m *MsgBurnONFT) String() string { return proto.CompactTextString(m) } +func (*MsgBurnONFT) ProtoMessage() {} +func (*MsgBurnONFT) Descriptor() ([]byte, []int) { + return fileDescriptor_adb8c7aefdb74d05, []int{10} +} +func (m *MsgBurnONFT) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgBurnONFT) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgBurnONFT.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgBurnONFT) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgBurnONFT.Merge(m, src) +} +func (m *MsgBurnONFT) XXX_Size() int { + return m.Size() +} +func (m *MsgBurnONFT) XXX_DiscardUnknown() { + xxx_messageInfo_MsgBurnONFT.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgBurnONFT proto.InternalMessageInfo + +type MsgBurnONFTResponse struct { +} + +func (m *MsgBurnONFTResponse) Reset() { *m = MsgBurnONFTResponse{} } +func (m *MsgBurnONFTResponse) String() string { return proto.CompactTextString(m) } +func (*MsgBurnONFTResponse) ProtoMessage() {} +func (*MsgBurnONFTResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_adb8c7aefdb74d05, []int{11} +} +func (m *MsgBurnONFTResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgBurnONFTResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgBurnONFTResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgBurnONFTResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgBurnONFTResponse.Merge(m, src) +} +func (m *MsgBurnONFTResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgBurnONFTResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgBurnONFTResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgBurnONFTResponse proto.InternalMessageInfo + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +type MsgUpdateParams struct { + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the onft module parameters to update. + // + // NOTE: All parameters must be supplied. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_adb8c7aefdb74d05, []int{12} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_adb8c7aefdb74d05, []int{13} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgCreateDenom)(nil), "OmniFlix.onft.v1beta1.MsgCreateDenom") + proto.RegisterType((*MsgCreateDenomResponse)(nil), "OmniFlix.onft.v1beta1.MsgCreateDenomResponse") + proto.RegisterType((*MsgUpdateDenom)(nil), "OmniFlix.onft.v1beta1.MsgUpdateDenom") + proto.RegisterType((*MsgUpdateDenomResponse)(nil), "OmniFlix.onft.v1beta1.MsgUpdateDenomResponse") + proto.RegisterType((*MsgTransferDenom)(nil), "OmniFlix.onft.v1beta1.MsgTransferDenom") + proto.RegisterType((*MsgTransferDenomResponse)(nil), "OmniFlix.onft.v1beta1.MsgTransferDenomResponse") + proto.RegisterType((*MsgMintONFT)(nil), "OmniFlix.onft.v1beta1.MsgMintONFT") + proto.RegisterType((*MsgMintONFTResponse)(nil), "OmniFlix.onft.v1beta1.MsgMintONFTResponse") + proto.RegisterType((*MsgTransferONFT)(nil), "OmniFlix.onft.v1beta1.MsgTransferONFT") + proto.RegisterType((*MsgTransferONFTResponse)(nil), "OmniFlix.onft.v1beta1.MsgTransferONFTResponse") + proto.RegisterType((*MsgBurnONFT)(nil), "OmniFlix.onft.v1beta1.MsgBurnONFT") + proto.RegisterType((*MsgBurnONFTResponse)(nil), "OmniFlix.onft.v1beta1.MsgBurnONFTResponse") + proto.RegisterType((*MsgUpdateParams)(nil), "OmniFlix.onft.v1beta1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "OmniFlix.onft.v1beta1.MsgUpdateParamsResponse") +} + +func init() { proto.RegisterFile("OmniFlix/onft/v1beta1/tx.proto", fileDescriptor_adb8c7aefdb74d05) } + +var fileDescriptor_adb8c7aefdb74d05 = []byte{ + // 992 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xb1, 0x6f, 0xdb, 0xc6, + 0x17, 0x16, 0x25, 0x59, 0x96, 0x4e, 0x8e, 0x13, 0x9c, 0x9d, 0x84, 0x16, 0x7e, 0x3f, 0xd2, 0x20, + 0x5a, 0x27, 0x08, 0x60, 0x12, 0x76, 0x81, 0x0e, 0xee, 0x14, 0x25, 0x35, 0x9a, 0x41, 0x4d, 0xc0, + 0xc4, 0x4b, 0x86, 0x0a, 0x27, 0xf1, 0x44, 0x1d, 0x2c, 0x92, 0xc2, 0xdd, 0xc9, 0xb1, 0xd6, 0xa2, + 0x6b, 0x81, 0x4e, 0x9d, 0xbb, 0x74, 0xe9, 0x54, 0xa0, 0xdd, 0xba, 0x75, 0xf2, 0x18, 0x74, 0x2a, + 0x3a, 0xa8, 0xad, 0x3d, 0xb4, 0xb3, 0xff, 0x82, 0x82, 0x77, 0x47, 0x8a, 0x74, 0x45, 0xd9, 0x40, + 0xdb, 0x49, 0x77, 0xef, 0xbe, 0xbb, 0xf7, 0xbd, 0xf7, 0xbd, 0xf7, 0x44, 0x60, 0x3c, 0x0f, 0x42, + 0x72, 0x38, 0x22, 0xa7, 0x4e, 0x14, 0x0e, 0xb8, 0x73, 0xb2, 0xd7, 0xc3, 0x1c, 0xed, 0x39, 0xfc, + 0xd4, 0x1e, 0xd3, 0x88, 0x47, 0xf0, 0x6e, 0x72, 0x6e, 0xc7, 0xe7, 0xb6, 0x3a, 0x6f, 0xdd, 0xef, + 0x47, 0x2c, 0x88, 0x98, 0x13, 0x30, 0xdf, 0x39, 0xd9, 0x8b, 0x7f, 0x24, 0xbe, 0xb5, 0x25, 0x0f, + 0xba, 0x62, 0xe7, 0xc8, 0x8d, 0x3a, 0xb2, 0x16, 0xbb, 0x1a, 0x23, 0x8a, 0x82, 0x04, 0x63, 0xa8, + 0x77, 0x7b, 0x88, 0xe1, 0x14, 0xd1, 0x8f, 0x48, 0xa8, 0xce, 0x37, 0xfd, 0xc8, 0x8f, 0xe4, 0xdb, + 0xf1, 0x4a, 0x59, 0xb7, 0x17, 0xbf, 0x2c, 0x18, 0x0b, 0x84, 0xf5, 0x5d, 0x05, 0xac, 0x77, 0x98, + 0xff, 0x84, 0x62, 0xc4, 0xf1, 0x53, 0x1c, 0x46, 0x01, 0x5c, 0x07, 0x65, 0xe2, 0xe9, 0xda, 0xb6, + 0xf6, 0xb0, 0xe1, 0x96, 0x89, 0x07, 0xef, 0x81, 0x1a, 0x9b, 0x06, 0xbd, 0x68, 0xa4, 0x97, 0x85, + 0x4d, 0xed, 0x20, 0x04, 0xd5, 0x10, 0x05, 0x58, 0xaf, 0x08, 0xab, 0x58, 0xc3, 0x6d, 0xd0, 0xf4, + 0x30, 0xeb, 0x53, 0x32, 0xe6, 0x24, 0x0a, 0xf5, 0xaa, 0x38, 0xca, 0x9a, 0xe0, 0x87, 0xa0, 0x39, + 0xa6, 0xf8, 0x84, 0xe0, 0x37, 0xdd, 0x09, 0x25, 0xfa, 0x4a, 0x8c, 0x68, 0xbf, 0x73, 0x3e, 0x33, + 0xc1, 0x0b, 0x69, 0x3e, 0x72, 0x9f, 0x5d, 0xce, 0x4c, 0x38, 0x45, 0xc1, 0xe8, 0xc0, 0xca, 0x40, + 0x2d, 0x17, 0xa8, 0xdd, 0x11, 0x25, 0x82, 0x54, 0x7f, 0x88, 0x03, 0xa4, 0xd7, 0x14, 0x29, 0xb1, + 0x13, 0x76, 0x1c, 0x7a, 0x98, 0xea, 0xab, 0xca, 0x2e, 0x76, 0xf0, 0x33, 0x0d, 0xac, 0xf5, 0xe3, + 0x20, 0x49, 0x14, 0x76, 0x07, 0x18, 0xeb, 0xf5, 0x6d, 0xed, 0x61, 0x73, 0x7f, 0xcb, 0x56, 0x4a, + 0xc4, 0x79, 0x4d, 0x44, 0xb4, 0x9f, 0x44, 0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0xe7, 0x1f, 0x1f, + 0xbe, 0xfa, 0x9b, 0x5f, 0x1b, 0xd4, 0xbd, 0xf8, 0x42, 0x97, 0x78, 0xd2, 0x73, 0x7b, 0xe3, 0x72, + 0x66, 0xde, 0x96, 0x99, 0x48, 0x4e, 0x2c, 0x77, 0x55, 0x2c, 0x9f, 0x79, 0xf0, 0x31, 0xa8, 0x07, + 0x98, 0x23, 0xa1, 0x6d, 0x45, 0x94, 0xa1, 0x69, 0x2f, 0x9c, 0x26, 0x76, 0x47, 0xc1, 0xda, 0xd5, + 0xb8, 0x18, 0xdd, 0xf4, 0x5a, 0x5a, 0x1a, 0xd5, 0x79, 0x69, 0x40, 0x0b, 0xac, 0x71, 0xc5, 0x1f, + 0xf5, 0x46, 0x58, 0x24, 0xb8, 0xee, 0xe6, 0x6c, 0xd0, 0x00, 0x00, 0x9f, 0x72, 0x1c, 0x32, 0x12, + 0x23, 0x6a, 0x02, 0x91, 0xb1, 0x88, 0xda, 0x60, 0x83, 0x37, 0xa2, 0x79, 0xea, 0xae, 0x58, 0xc3, + 0x63, 0x70, 0x8b, 0x46, 0x53, 0x34, 0xe2, 0xd3, 0x2e, 0x1b, 0x22, 0x2a, 0x5b, 0xa7, 0x21, 0xfb, + 0xe3, 0x97, 0x99, 0xb9, 0x73, 0x83, 0x46, 0x78, 0x8a, 0xfb, 0x97, 0x33, 0x73, 0x53, 0x66, 0x24, + 0xf7, 0x98, 0xe5, 0xae, 0xa9, 0xfd, 0xcb, 0x78, 0x9b, 0xd1, 0xb0, 0x51, 0xac, 0x21, 0x58, 0xac, + 0xe1, 0x5d, 0xb0, 0x91, 0x91, 0x29, 0x95, 0xef, 0x73, 0x0d, 0xdc, 0xce, 0x68, 0xfb, 0xaf, 0x48, + 0x38, 0xa7, 0x59, 0x29, 0xa6, 0x59, 0x5d, 0x4c, 0x73, 0x0b, 0xdc, 0xbf, 0x42, 0x27, 0xa5, 0x7a, + 0x2c, 0x0a, 0xad, 0x3d, 0xa1, 0xe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 0x21, 0xd7, 0x0c, 0x3b, + 0xd7, 0x29, 0x29, 0x71, 0xcb, 0x62, 0x58, 0x54, 0xc4, 0xed, 0xce, 0xd9, 0xef, 0x46, 0xe9, 0xec, + 0xdc, 0xd0, 0xde, 0x9e, 0x1b, 0xda, 0x6f, 0xe7, 0x86, 0xf6, 0xc5, 0x85, 0x51, 0x7a, 0x7b, 0x61, + 0x94, 0x7e, 0xbe, 0x30, 0x4a, 0xaf, 0x9d, 0xcc, 0x98, 0x9d, 0x7f, 0xd5, 0x05, 0x21, 0x19, 0x8c, + 0xc8, 0xe9, 0x70, 0xd2, 0x73, 0x4e, 0xf6, 0x1d, 0xf5, 0x99, 0x27, 0x66, 0x6e, 0xaf, 0x26, 0x3e, + 0xf0, 0xde, 0xfb, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x01, 0x67, 0xb9, 0x5e, 0xc9, 0x0a, 0x00, 0x00, +} + +func (this *MsgCreateDenom) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgCreateDenom) + if !ok { + that2, ok := that.(MsgCreateDenom) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Id != that1.Id { + return false + } + if this.Symbol != that1.Symbol { + return false + } + if this.Name != that1.Name { + return false + } + if this.Description != that1.Description { + return false + } + if this.PreviewURI != that1.PreviewURI { + return false + } + if this.Schema != that1.Schema { + return false + } + if this.Sender != that1.Sender { + return false + } + if !this.CreationFee.Equal(&that1.CreationFee) { + return false + } + if this.Uri != that1.Uri { + return false + } + if this.UriHash != that1.UriHash { + return false + } + if this.Data != that1.Data { + return false + } + return true +} +func (this *MsgUpdateDenom) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgUpdateDenom) + if !ok { + that2, ok := that.(MsgUpdateDenom) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Id != that1.Id { + return false + } + if this.Name != that1.Name { + return false + } + if this.Description != that1.Description { + return false + } + if this.PreviewURI != that1.PreviewURI { + return false + } + if this.Sender != that1.Sender { + return false + } + return true +} +func (this *MsgTransferDenom) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgTransferDenom) + if !ok { + that2, ok := that.(MsgTransferDenom) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Id != that1.Id { + return false + } + if this.Sender != that1.Sender { + return false + } + if this.Recipient != that1.Recipient { + return false + } + return true +} +func (this *MsgMintONFT) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgMintONFT) + if !ok { + that2, ok := that.(MsgMintONFT) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Id != that1.Id { + return false + } + if this.DenomId != that1.DenomId { + return false + } + if !this.Metadata.Equal(&that1.Metadata) { + return false + } + if this.Data != that1.Data { + return false + } + if this.Transferable != that1.Transferable { + return false + } + if this.Extensible != that1.Extensible { + return false + } + if this.Nsfw != that1.Nsfw { + return false + } + if !this.RoyaltyShare.Equal(that1.RoyaltyShare) { + return false + } + if this.Sender != that1.Sender { + return false + } + if this.Recipient != that1.Recipient { + return false + } + return true +} +func (this *MsgTransferONFT) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgTransferONFT) + if !ok { + that2, ok := that.(MsgTransferONFT) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Id != that1.Id { + return false + } + if this.DenomId != that1.DenomId { + return false + } + if this.Sender != that1.Sender { + return false + } + if this.Recipient != that1.Recipient { + return false + } + return true +} +func (this *MsgBurnONFT) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgBurnONFT) + if !ok { + that2, ok := that.(MsgBurnONFT) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Id != that1.Id { + return false + } + if this.DenomId != that1.DenomId { + return false + } + if this.Sender != that1.Sender { + return false + } + return true +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + CreateDenom(ctx context.Context, in *MsgCreateDenom, opts ...grpc.CallOption) (*MsgCreateDenomResponse, error) + UpdateDenom(ctx context.Context, in *MsgUpdateDenom, opts ...grpc.CallOption) (*MsgUpdateDenomResponse, error) + TransferDenom(ctx context.Context, in *MsgTransferDenom, opts ...grpc.CallOption) (*MsgTransferDenomResponse, error) + MintONFT(ctx context.Context, in *MsgMintONFT, opts ...grpc.CallOption) (*MsgMintONFTResponse, error) + TransferONFT(ctx context.Context, in *MsgTransferONFT, opts ...grpc.CallOption) (*MsgTransferONFTResponse, error) + BurnONFT(ctx context.Context, in *MsgBurnONFT, opts ...grpc.CallOption) (*MsgBurnONFTResponse, error) + // UpdateParams defines a governance operation for updating the onft module + // parameters. The authority is hard-coded to the onft module account. + // + // Since: cosmos-sdk 0.47 + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) CreateDenom(ctx context.Context, in *MsgCreateDenom, opts ...grpc.CallOption) (*MsgCreateDenomResponse, error) { + out := new(MsgCreateDenomResponse) + err := c.cc.Invoke(ctx, "/OmniFlix.onft.v1beta1.Msg/CreateDenom", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateDenom(ctx context.Context, in *MsgUpdateDenom, opts ...grpc.CallOption) (*MsgUpdateDenomResponse, error) { + out := new(MsgUpdateDenomResponse) + err := c.cc.Invoke(ctx, "/OmniFlix.onft.v1beta1.Msg/UpdateDenom", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) TransferDenom(ctx context.Context, in *MsgTransferDenom, opts ...grpc.CallOption) (*MsgTransferDenomResponse, error) { + out := new(MsgTransferDenomResponse) + err := c.cc.Invoke(ctx, "/OmniFlix.onft.v1beta1.Msg/TransferDenom", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) MintONFT(ctx context.Context, in *MsgMintONFT, opts ...grpc.CallOption) (*MsgMintONFTResponse, error) { + out := new(MsgMintONFTResponse) + err := c.cc.Invoke(ctx, "/OmniFlix.onft.v1beta1.Msg/MintONFT", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) TransferONFT(ctx context.Context, in *MsgTransferONFT, opts ...grpc.CallOption) (*MsgTransferONFTResponse, error) { + out := new(MsgTransferONFTResponse) + err := c.cc.Invoke(ctx, "/OmniFlix.onft.v1beta1.Msg/TransferONFT", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) BurnONFT(ctx context.Context, in *MsgBurnONFT, opts ...grpc.CallOption) (*MsgBurnONFTResponse, error) { + out := new(MsgBurnONFTResponse) + err := c.cc.Invoke(ctx, "/OmniFlix.onft.v1beta1.Msg/BurnONFT", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/OmniFlix.onft.v1beta1.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + CreateDenom(context.Context, *MsgCreateDenom) (*MsgCreateDenomResponse, error) + UpdateDenom(context.Context, *MsgUpdateDenom) (*MsgUpdateDenomResponse, error) + TransferDenom(context.Context, *MsgTransferDenom) (*MsgTransferDenomResponse, error) + MintONFT(context.Context, *MsgMintONFT) (*MsgMintONFTResponse, error) + TransferONFT(context.Context, *MsgTransferONFT) (*MsgTransferONFTResponse, error) + BurnONFT(context.Context, *MsgBurnONFT) (*MsgBurnONFTResponse, error) + // UpdateParams defines a governance operation for updating the onft module + // parameters. The authority is hard-coded to the onft module account. + // + // Since: cosmos-sdk 0.47 + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) CreateDenom(ctx context.Context, req *MsgCreateDenom) (*MsgCreateDenomResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateDenom not implemented") +} +func (*UnimplementedMsgServer) UpdateDenom(ctx context.Context, req *MsgUpdateDenom) (*MsgUpdateDenomResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateDenom not implemented") +} +func (*UnimplementedMsgServer) TransferDenom(ctx context.Context, req *MsgTransferDenom) (*MsgTransferDenomResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TransferDenom not implemented") +} +func (*UnimplementedMsgServer) MintONFT(ctx context.Context, req *MsgMintONFT) (*MsgMintONFTResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MintONFT not implemented") +} +func (*UnimplementedMsgServer) TransferONFT(ctx context.Context, req *MsgTransferONFT) (*MsgTransferONFTResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TransferONFT not implemented") +} +func (*UnimplementedMsgServer) BurnONFT(ctx context.Context, req *MsgBurnONFT) (*MsgBurnONFTResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BurnONFT not implemented") +} +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_CreateDenom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateDenom) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateDenom(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/OmniFlix.onft.v1beta1.Msg/CreateDenom", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateDenom(ctx, req.(*MsgCreateDenom)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateDenom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateDenom) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateDenom(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/OmniFlix.onft.v1beta1.Msg/UpdateDenom", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateDenom(ctx, req.(*MsgUpdateDenom)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_TransferDenom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgTransferDenom) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).TransferDenom(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/OmniFlix.onft.v1beta1.Msg/TransferDenom", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).TransferDenom(ctx, req.(*MsgTransferDenom)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_MintONFT_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgMintONFT) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).MintONFT(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/OmniFlix.onft.v1beta1.Msg/MintONFT", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).MintONFT(ctx, req.(*MsgMintONFT)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_TransferONFT_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgTransferONFT) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).TransferONFT(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/OmniFlix.onft.v1beta1.Msg/TransferONFT", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).TransferONFT(ctx, req.(*MsgTransferONFT)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_BurnONFT_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgBurnONFT) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).BurnONFT(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/OmniFlix.onft.v1beta1.Msg/BurnONFT", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).BurnONFT(ctx, req.(*MsgBurnONFT)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/OmniFlix.onft.v1beta1.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "OmniFlix.onft.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateDenom", + Handler: _Msg_CreateDenom_Handler, + }, + { + MethodName: "UpdateDenom", + Handler: _Msg_UpdateDenom_Handler, + }, + { + MethodName: "TransferDenom", + Handler: _Msg_TransferDenom_Handler, + }, + { + MethodName: "MintONFT", + Handler: _Msg_MintONFT_Handler, + }, + { + MethodName: "TransferONFT", + Handler: _Msg_TransferONFT_Handler, + }, + { + MethodName: "BurnONFT", + Handler: _Msg_BurnONFT_Handler, + }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "OmniFlix/onft/v1beta1/tx.proto", +} + +func (m *MsgCreateDenom) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCreateDenom) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateDenom) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintTx(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x5a + } + if len(m.UriHash) > 0 { + i -= len(m.UriHash) + copy(dAtA[i:], m.UriHash) + i = encodeVarintTx(dAtA, i, uint64(len(m.UriHash))) + i-- + dAtA[i] = 0x52 + } + if len(m.Uri) > 0 { + i -= len(m.Uri) + copy(dAtA[i:], m.Uri) + i = encodeVarintTx(dAtA, i, uint64(len(m.Uri))) + i-- + dAtA[i] = 0x4a + } + { + size, err := m.CreationFee.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0x3a + } + if len(m.Schema) > 0 { + i -= len(m.Schema) + copy(dAtA[i:], m.Schema) + i = encodeVarintTx(dAtA, i, uint64(len(m.Schema))) + i-- + dAtA[i] = 0x32 + } + if len(m.PreviewURI) > 0 { + i -= len(m.PreviewURI) + copy(dAtA[i:], m.PreviewURI) + i = encodeVarintTx(dAtA, i, uint64(len(m.PreviewURI))) + i-- + dAtA[i] = 0x2a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintTx(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x22 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x1a + } + if len(m.Symbol) > 0 { + i -= len(m.Symbol) + copy(dAtA[i:], m.Symbol) + i = encodeVarintTx(dAtA, i, uint64(len(m.Symbol))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintTx(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCreateDenomResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCreateDenomResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateDenomResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUpdateDenom) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateDenom) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateDenom) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0x2a + } + if len(m.PreviewURI) > 0 { + i -= len(m.PreviewURI) + copy(dAtA[i:], m.PreviewURI) + i = encodeVarintTx(dAtA, i, uint64(len(m.PreviewURI))) + i-- + dAtA[i] = 0x22 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintTx(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x1a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintTx(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateDenomResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateDenomResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateDenomResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgTransferDenom) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgTransferDenom) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTransferDenom) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Recipient) > 0 { + i -= len(m.Recipient) + copy(dAtA[i:], m.Recipient) + i = encodeVarintTx(dAtA, i, uint64(len(m.Recipient))) + i-- + dAtA[i] = 0x1a + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintTx(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgTransferDenomResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgTransferDenomResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTransferDenomResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgMintONFT) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgMintONFT) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgMintONFT) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Recipient) > 0 { + i -= len(m.Recipient) + copy(dAtA[i:], m.Recipient) + i = encodeVarintTx(dAtA, i, uint64(len(m.Recipient))) + i-- + dAtA[i] = 0x52 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0x4a + } + { + size := m.RoyaltyShare.Size() + i -= size + if _, err := m.RoyaltyShare.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + if m.Nsfw { + i-- + if m.Nsfw { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } + if m.Extensible { + i-- + if m.Extensible { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.Transferable { + i-- + if m.Transferable { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintTx(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x22 + } + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.DenomId) > 0 { + i -= len(m.DenomId) + copy(dAtA[i:], m.DenomId) + i = encodeVarintTx(dAtA, i, uint64(len(m.DenomId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintTx(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgMintONFTResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgMintONFTResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgMintONFTResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgTransferONFT) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgTransferONFT) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTransferONFT) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Recipient) > 0 { + i -= len(m.Recipient) + copy(dAtA[i:], m.Recipient) + i = encodeVarintTx(dAtA, i, uint64(len(m.Recipient))) + i-- + dAtA[i] = 0x22 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0x1a + } + if len(m.DenomId) > 0 { + i -= len(m.DenomId) + copy(dAtA[i:], m.DenomId) + i = encodeVarintTx(dAtA, i, uint64(len(m.DenomId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintTx(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgTransferONFTResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgTransferONFTResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTransferONFTResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgBurnONFT) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgBurnONFT) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgBurnONFT) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0x1a + } + if len(m.DenomId) > 0 { + i -= len(m.DenomId) + copy(dAtA[i:], m.DenomId) + i = encodeVarintTx(dAtA, i, uint64(len(m.DenomId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintTx(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgBurnONFTResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgBurnONFTResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgBurnONFTResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgCreateDenom) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Symbol) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.PreviewURI) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Schema) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.CreationFee.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.Uri) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.UriHash) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Data) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgCreateDenomResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdateDenom) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.PreviewURI) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUpdateDenomResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgTransferDenom) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Recipient) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgTransferDenomResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgMintONFT) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.DenomId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Metadata.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.Data) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Transferable { + n += 2 + } + if m.Extensible { + n += 2 + } + if m.Nsfw { + n += 2 + } + l = m.RoyaltyShare.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Recipient) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgMintONFTResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgTransferONFT) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.DenomId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Recipient) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgTransferONFTResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgBurnONFT) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.DenomId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgBurnONFTResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgCreateDenom) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreateDenom: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateDenom: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Symbol = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PreviewURI", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PreviewURI = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Schema", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Schema = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreationFee", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.CreationFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Uri", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Uri = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UriHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UriHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateDenomResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreateDenomResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateDenomResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateDenom) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateDenom: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateDenom: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PreviewURI", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PreviewURI = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateDenomResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateDenomResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateDenomResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgTransferDenom) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgTransferDenom: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTransferDenom: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Recipient", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Recipient = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgTransferDenomResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgTransferDenomResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTransferDenomResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgMintONFT) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgMintONFT: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgMintONFT: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DenomId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DenomId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Transferable", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Transferable = bool(v != 0) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Extensible", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Extensible = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Nsfw", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Nsfw = bool(v != 0) + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RoyaltyShare", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.RoyaltyShare.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Recipient", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Recipient = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgMintONFTResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgMintONFTResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgMintONFTResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgTransferONFT) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgTransferONFT: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTransferONFT: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DenomId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DenomId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Recipient", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Recipient = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgTransferONFTResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgTransferONFTResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTransferONFTResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgBurnONFT) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgBurnONFT: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgBurnONFT: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DenomId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DenomId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgBurnONFTResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgBurnONFTResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgBurnONFTResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/onft/types/utils.go b/x/onft/types/utils.go new file mode 100644 index 00000000..b78dc3a1 --- /dev/null +++ b/x/onft/types/utils.go @@ -0,0 +1,22 @@ +package types + +import ( + "regexp" + "strings" + + "github.com/google/uuid" +) + +var ( + IsAlphaNumeric = regexp.MustCompile(`^[a-zA-Z0-9]+$`).MatchString + IsBeginWithAlpha = regexp.MustCompile(`^[a-zA-Z].*`).MatchString + IsAlpha = regexp.MustCompile(`^[a-zA-Z]+`).MatchString +) + +func GenUniqueID(prefix string) string { + return prefix + strings.ReplaceAll(uuid.New().String(), "-", "") +} + +func IsIBCDenom(denomID string) bool { + return strings.HasPrefix(denomID, "ibc/") +} diff --git a/x/onft/types/validations.go b/x/onft/types/validations.go new file mode 100644 index 00000000..66c1f59c --- /dev/null +++ b/x/onft/types/validations.go @@ -0,0 +1,126 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func ValidateONFTID(onftId string) error { + if len(onftId) < MinIDLen || len(onftId) > MaxIDLen { + return errorsmod.Wrapf( + ErrInvalidONFTID, + "invalid onftId %s, length must be between [%d, %d]", onftId, MinIDLen, MaxIDLen) + } + if !IsBeginWithAlpha(onftId) || !IsAlphaNumeric(onftId) { + return errorsmod.Wrapf( + ErrInvalidONFTID, + "invalid onftId %s, only accepts alphanumeric characters and begin with an english letter", onftId) + } + return nil +} + +func ValidateDenomID(denomID string) error { + if len(denomID) < MinIDLen || len(denomID) > MaxIDLen { + return errorsmod.Wrapf( + ErrInvalidDenom, + "invalid denom ID %s, length must be between [%d, %d]", + denomID, + MinIDLen, + MaxIDLen, + ) + } + if !IsBeginWithAlpha(denomID) || !IsAlphaNumeric(denomID) { + return errorsmod.Wrapf( + ErrInvalidDenom, + "invalid denom ID %s, only accepts alphanumeric characters,and begin with an english letter", + denomID, + ) + } + return nil +} + +func ValidateDenomSymbol(denomSymbol string) error { + if len(denomSymbol) < MinDenomLen || len(denomSymbol) > MaxDenomLen { + return errorsmod.Wrapf( + ErrInvalidDenom, + "invalid denom symbol %s, only accepts value [%d, %d]", + denomSymbol, + MinDenomLen, + MaxDenomLen, + ) + } + if !IsBeginWithAlpha(denomSymbol) || !IsAlpha(denomSymbol) { + return errorsmod.Wrapf( + ErrInvalidDenom, + "invalid denom symbol %s, only accepts alphabetic characters", + denomSymbol, + ) + } + return nil +} + +func ValidateName(name string) error { + if len(name) > MaxNameLen { + return errorsmod.Wrapf( + ErrInvalidName, + "invalid name %s, length must be less than %d", + name, + MaxNameLen, + ) + } + return nil +} + +func ValidateDescription(description string) error { + if len(description) > MaxDescriptionLen { + return errorsmod.Wrapf( + ErrInvalidDescription, + "invalid description %s, length must be less than %d", + description, + MaxDescriptionLen, + ) + } + return nil +} + +func ValidateURI(uri string) error { + if len(uri) > MaxURILen { + return errorsmod.Wrapf( + ErrInvalidURI, + "invalid uri %s, length must be less than %d", + uri, + MaxURILen, + ) + } + return nil +} + +func ValidateMediaURI(uri string) error { + if len(uri) == 0 { + return errorsmod.Wrapf( + ErrInvalidURI, + "invalid uri %s, media uri should not be empty", + uri, + ) + } + if len(uri) > MaxURILen { + return errorsmod.Wrapf( + ErrInvalidURI, + "invalid uri %s, length must be less than %d", + uri, + MaxURILen, + ) + } + return nil +} + +func ValidateCreationFee(fee sdk.Coin) error { + if !fee.IsValid() || fee.IsNil() { + return errorsmod.Wrapf( + ErrInvalidURI, + "invalid creation fee %s, fee must be positive", + fee.String(), + ) + } + return nil +} diff --git a/x/tokenfactory/types/authorityMetadata.pb.go b/x/tokenfactory/types/authorityMetadata.pb.go index 115ef4b1..481ca614 100644 --- a/x/tokenfactory/types/authorityMetadata.pb.go +++ b/x/tokenfactory/types/authorityMetadata.pb.go @@ -81,7 +81,7 @@ func init() { } var fileDescriptor_99435de88ae175f7 = []byte{ - // 243 bytes of a gzipped FileDescriptorProto + // 249 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0xc9, 0x2f, 0xce, 0xcd, 0x2f, 0xce, 0x2c, 0xd6, 0x2f, 0xc9, 0xcf, 0x4e, 0xcd, 0x4b, 0x4b, 0x4c, 0x2e, 0xc9, 0x2f, 0xaa, 0xd4, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0x2c, 0x2d, 0xc9, 0xc8, 0x2f, 0xca, @@ -91,13 +91,13 @@ var fileDescriptor_99435de88ae175f7 = []byte{ 0xa7, 0xc2, 0x2d, 0x48, 0xce, 0xcf, 0xcc, 0x83, 0xc8, 0x2b, 0xb9, 0x71, 0x89, 0xb9, 0xa4, 0xe6, 0xe5, 0xe7, 0x3a, 0xa2, 0xdb, 0x29, 0xa4, 0xc6, 0xc5, 0x9a, 0x98, 0x92, 0x9b, 0x99, 0x27, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0xe9, 0x24, 0xf0, 0xe9, 0x9e, 0x3c, 0x4f, 0x65, 0x62, 0x6e, 0x8e, 0x95, - 0x12, 0x58, 0x58, 0x29, 0x08, 0x22, 0x6d, 0xc5, 0xf2, 0x62, 0x81, 0x3c, 0xa3, 0x93, 0xdf, 0x89, + 0x12, 0x58, 0x58, 0x29, 0x08, 0x22, 0x6d, 0xc5, 0xf2, 0x62, 0x81, 0x3c, 0xa3, 0x53, 0xe0, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, - 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x99, 0xa4, 0x67, 0x96, 0x64, 0x94, 0x26, - 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x3b, 0x83, 0x1d, 0xe3, 0x9c, 0x9f, 0x57, 0x52, 0x94, 0x98, 0x5c, - 0x52, 0xac, 0x9f, 0x55, 0x9a, 0x97, 0xaf, 0x5f, 0x81, 0x1a, 0x0a, 0x25, 0x95, 0x05, 0xa9, 0xc5, - 0x49, 0x6c, 0x60, 0xe7, 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x33, 0x00, 0x78, 0xbe, 0x2a, - 0x01, 0x00, 0x00, + 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x99, 0xa7, 0x67, 0x96, 0x64, 0x94, 0x26, + 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xfb, 0xe7, 0xe6, 0x65, 0xba, 0xe5, 0x64, 0x56, 0xe8, 0xe7, 0xe7, + 0xe6, 0x65, 0xa6, 0xe5, 0x64, 0x56, 0x64, 0x94, 0x26, 0xe9, 0x97, 0x19, 0xe9, 0x57, 0xa0, 0x06, + 0x44, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, 0x85, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x7a, 0xc8, 0xf2, 0x35, 0x2d, 0x01, 0x00, 0x00, } func (this *DenomAuthorityMetadata) Equal(that interface{}) bool { diff --git a/x/tokenfactory/types/genesis.pb.go b/x/tokenfactory/types/genesis.pb.go index eade1da5..af6574d1 100644 --- a/x/tokenfactory/types/genesis.pb.go +++ b/x/tokenfactory/types/genesis.pb.go @@ -142,31 +142,31 @@ func init() { } var fileDescriptor_5749c3f71850298b = []byte{ - // 369 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0xc1, 0x4e, 0xf2, 0x40, - 0x14, 0x85, 0x3b, 0xfc, 0xfc, 0x24, 0x16, 0x34, 0xda, 0x68, 0x82, 0x44, 0x5b, 0x6c, 0x8c, 0x41, - 0x16, 0x6d, 0x40, 0x56, 0xec, 0x2c, 0x24, 0xae, 0x34, 0xa6, 0xee, 0xdc, 0x90, 0x01, 0xc6, 0x52, - 0xb5, 0x9d, 0xa6, 0x73, 0x31, 0xf6, 0x05, 0x5c, 0xfb, 0x08, 0x3e, 0x8c, 0x26, 0x2c, 0x59, 0xba, - 0x22, 0x06, 0x36, 0xae, 0x79, 0x02, 0xc3, 0xcc, 0x44, 0x45, 0x92, 0xee, 0xda, 0x3b, 0xdf, 0x39, - 0x73, 0xee, 0x1c, 0x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 0xcf, 0xd8, 0x09, 0xe4, 0x3b, 0x16, 0x33, 0x7c, - 0xf7, 0x46, 0x7a, 0x5e, 0x7e, 0xd3, 0xe9, 0xdf, 0x0e, 0x9c, 0x03, 0x99, 0x7c, 0x57, 0xdc, 0xb7, - 0xea, 0x6e, 0xba, 0x5b, 0x2b, 0xcd, 0x35, 0xb3, 0x9f, 0x2f, 0x06, 0x72, 0x2e, 0x46, 0x53, 0x1d, - 0x8d, 0xa7, 0x3a, 0xfa, 0x98, 0xea, 0xe8, 0x79, 0xa6, 0x2b, 0xe3, 0x99, 0xae, 0xbc, 0xcf, 0x74, - 0xe5, 0xba, 0xe1, 0xf9, 0x30, 0x18, 0x76, 0xad, 0x1e, 0x0d, 0xec, 0x16, 0x8f, 0xd5, 0xa2, 0x21, - 0xc4, 0xb8, 0x07, 0xcc, 0xbe, 0x1d, 0x86, 0xd4, 0x7e, 0x5c, 0x6e, 0x1b, 0x92, 0x88, 0xb0, 0x6e, - 0x8e, 0xb7, 0x7c, 0xf2, 0x15, 0x00, 0x00, 0xff, 0xff, 0xa0, 0x2e, 0xfa, 0xa4, 0xa8, 0x02, 0x00, - 0x00, + // 375 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0xca, 0x2f, 0xce, 0xcd, + 0x2f, 0xce, 0x2c, 0xd6, 0x2f, 0xc9, 0xcf, 0x4e, 0xcd, 0x4b, 0x4b, 0x4c, 0x2e, 0xc9, 0x2f, 0xaa, + 0xd4, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, + 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x81, 0xaa, 0xd5, 0x43, 0x56, 0xab, 0x07, 0x55, + 0x2b, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f,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 0xf7, + 0x82, 0x6d, 0x72, 0x44, 0x8f, 0x03, 0x27, 0x45, 0xa8, 0xcb, 0x25, 0x21, 0xf6, 0x61, 0x9a, 0xae, + 0x14, 0x24, 0x88, 0x11, 0x73, 0x56, 0x2c, 0x2f, 0x16, 0xc8, 0x33, 0x3a, 0x05, 0x9e, 0x78, 0x24, + 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, + 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x79, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, + 0x72, 0x7e, 0xae, 0xbe, 0x7f, 0x6e, 0x5e, 0xa6, 0x5b, 0x4e, 0x66, 0x85, 0x7e, 0x7e, 0x6e, 0x5e, + 0x66, 0x5a, 0x4e, 0x66, 0x45, 0x46, 0x69, 0x92, 0x7e, 0x99, 0x91, 0x7e, 0x05, 0x6a, 0x84, 0x97, + 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x23, 0xda, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xe9, + 0x25, 0x16, 0xc2, 0xab, 0x02, 0x00, 0x00, } func (this *GenesisDenom) Equal(that interface{}) bool { diff --git a/x/tokenfactory/types/params.pb.go b/x/tokenfactory/types/params.pb.go index 880a5323..8e235608 100644 --- a/x/tokenfactory/types/params.pb.go +++ b/x/tokenfactory/types/params.pb.go @@ -91,30 +91,30 @@ func init() { } var fileDescriptor_cc8299d306f3ff47 = []byte{ - // 356 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0xc1, 0x4e, 0xea, 0x40, - 0x14, 0x86, 0x5b, 0xee, 0x0d, 0x8b, 0xde, 0xcd, 0x4d, 0x73, 0x93, 0x0b, 0xc4, 0xb4, 0xd8, 0x15, - 0x2c, 0xec, 0x04, 0x65, 0xe5, 0x92, 0x26, 0xba, 0xc2, 0x18, 0x96, 0x6e, 0x9a, 0xd3, 0x61, 0x28, - 0x15, 0x3b, 0x87, 0x74, 0xa6, 0xc6, 0x3e, 0x82, 0x3b, 0x57, 0x3e, 0x84, 0x4f, 0xc2, 0x92, 0xa5, - 0xab, 0x6a, 0xe0, 0x0d, 0x78, 0x02, 0xc3, 0x74, 0x34, 0xa0, 0xc6, 0x55, 0x7b, 0xf2, 0xff, 0xff, - 0x37, 0xff, 0x99, 0xb1, 0xba, 0x28, 0x52, 0x14, 0x89, 0x20, 0x12, 0x67, 0x8c, 0x4f, 0x80, 0x4a, - 0xcc, 0x0a, 0x72, 0xdb, 0x8b, 0x98, 0x84, 0x1e, 0x99, 0x43, 0x06, 0xa9, 0xf0, 0xe7, 0x19, 0x4a, - 0xb4, 0x0f, 0xb4, 0xd5, 0xdf, 0xb5, 0xfa, 0xda, 0xda, 0xfa, 0x17, 0x63, 0x8c, 0xca, 0x48, 0xb6, - 0x7f, 0x55, 0xa6, 0xd5, 0xff, 0x11, 0x0f, 0xb9, 0x9c, 0x62, 0x96, 0xc8, 0x62, 0xc8, 0x24, 0x8c, - 0x41, 0x82, 0x4e, 0x35, 0xa9, 0x8a, 0x85, 0x15, 0xae, 0x1a, 0xb4, 0xe4, 0x54, 0x13, 0x89, 0x40, - 0xb0, 0x0f, 0x0e, 0xc5, 0x84, 0x57, 0xba, 0x77, 0x5f, 0xb3, 0xea, 0x97, 0xaa, 0xb5, 0xfd, 0x68, - 0x5a, 0xf6, 0x98, 0x71, 0x4c, 0x43, 0x9a, 0x31, 0x90, 0x09, 0xf2, 0x70, 0xc2, 0x58, 0xc3, 0x6c, - 0xff, 0xea, 0xfc, 0x39, 0x6e, 0xfa, 0x1a, 0xbb, 0x05, 0xbd, 0x2f, 0xe1, 0x07, 0x98, 0xf0, 0xc1, - 0x70, 0x51, 0xba, 0xc6, 0xa6, 0x74, 0x9b, 0x05, 0xa4, 0x37, 0xa7, 0xde, 0x57, 0x84, 0xf7, 0xf4, - 0xe2, 0x76, 0xe2, 0x44, 0x4e, 0xf3, 0xc8, 0xa7, 0x98, 0xea, 0x82, 0xfa, 0x73, 0x24, 0xc6, 0x33, - 0x22, 0x8b, 0x39, 0x13, 0x8a, 0x26, 0x46, 0x7f, 0x15, 0x20, 0xd0, 0xf9, 0x33, 0xc6, 0xec, 0x89, - 0xd5, 0xfa, 0x04, 0x8d, 0x41, 0x84, 0x14, 0xb9, 0xc8, 0x53, 0xd6, 0xa8, 0xb5, 0xcd, 0xce, 0xef, - 0x41, 0x77, 0x51, 0xba, 0xe6, 0xa6, 0x74, 0x0f, 0xbf, 0x2d, 0xb1, 0xe3, 0xf7, 0x46, 0xff, 0xf7, - 0x0e, 0x38, 0x07, 0x11, 0x54, 0xca, 0xe0, 0x62, 0xb1, 0x72, 0xcc, 0xe5, 0xca, 0x31, 0x5f, 0x57, - 0x8e, 0xf9, 0xb0, 0x76, 0x8c, 0xe5, 0xda, 0x31, 0x9e, 0xd7, 0x8e, 0x71, 0xd5, 0xdf, 0x69, 0x1f, - 0xa8, 0xda, 0x01, 0x72, 0x99, 0x01, 0x95, 0x82, 0x5c, 0xe7, 0x1c, 0xc9, 0xdd, 0xfe, 0x83, 0xa9, - 0x7d, 0xa2, 0xba, 0xba, 0xe2, 0x93, 0xb7, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe4, 0xe8, 0xa8, 0x46, - 0x34, 0x02, 0x00, 0x00, + // 359 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0xb1, 0x4e, 0xc2, 0x40, + 0x1c, 0xc6, 0x5b, 0x34, 0x0c, 0x75, 0x31, 0x8d, 0x89, 0x40, 0x4c, 0x8b, 0x9d, 0x60, 0xb0, 0x17, + 0xd0, 0xc4, 0xc4, 0x11, 0x12, 0x9c, 0x88, 0xca, 0xe8, 0xd2, 0x5c, 0xcb, 0xb5, 0x5c, 0xe0, 0xee, + 0x4f, 0x7a, 0x57, 0x42, 0x1f, 0xc1, 0xcd, 0xc9, 0x87, 0xf0, 0x49, 0x18, 0x19, 0x9d, 0xaa, 0x81, + 0x37, 0xe0, 0x09, 0x0c, 0xed, 0x69, 0x40, 0x8d, 0x53, 0xfb, 0xcf, 0xf7, 0x7d, 0xbf, 0xfb, 0xfe, + 0x77, 0x46, 0x13, 0x04, 0x03, 0x41, 0x05, 0x92, 0x30, 0x26, 0x3c, 0xc4, 0x81, 0x84, 0x38, 0x45, + 0xb3, 0x96, 0x4f, 0x24, 0x6e, 0xa1, 0x29, 0x8e, 0x31, 0x13, 0xee, 0x34, 0x06, 0x09, 0xe6, 0x99, + 0xb2, 0xba, 0xbb, 0x56, 0x57, 0x59, 0x6b, 0x27, 0x11, 0x44, 0x90, 0x1b, 0xd1, 0xf6, 0xaf, 0xc8, + 0xd4, 0xae, 0xfe, 0xc5, 0xe3, 0x44, 0x8e, 0x20, 0xa6, 0x32, 0xed, 0x13, 0x89, 0x87, 0x58, 0x62, + 0x95, 0xaa, 0x06, 0x79, 0xcc, 0x2b, 0x70, 0xc5, 0xa0, 0x24, 0xab, 0x98, 0x90, 0x8f, 0x05, 0xf9, + 0xe6, 0x04, 0x40, 0x79, 0xa1, 0x3b, 0x4f, 0x25, 0xa3, 0x7c, 0x9f, 0xb7, 0x36, 0x5f, 0x74, 0xc3, + 0x1c, 0x12, 0x0e, 0xcc, 0x0b, 0x62, 0x82, 0x25, 0x05, 0xee, 0x85, 0x84, 0x54, 0xf4, 0xfa, 0x41, + 0xe3, 0xa8, 0x5d, 0x75, 0x15, 0x76, 0x0b, 0xfa, 0x5a, 0xc2, 0xed, 0x02, 0xe5, 0x9d, 0xfe, 0x22, + 0xb3, 0xb5, 0x4d, 0x66, 0x57, 0x53, 0xcc, 0x26, 0x37, 0xce, 0x6f, 0x84, 0xf3, 0xfa, 0x6e, 0x37, + 0x22, 0x2a, 0x47, 0x89, 0xef, 0x06, 0xc0, 0x54, 0x41, 0xf5, 0xb9, 0x10, 0xc3, 0x31, 0x92, 0xe9, + 0x94, 0x88, 0x9c, 0x26, 0x06, 0xc7, 0x39, 0xa0, 0xab, 0xf2, 0x3d, 0x42, 0xcc, 0xd0, 0xa8, 0xfd, + 0x80, 0x46, 0x58, 0x78, 0x01, 0x70, 0x91, 0x30, 0x52, 0x29, 0xd5, 0xf5, 0xc6, 0x61, 0xa7, 0xb9, + 0xc8, 0x6c, 0x7d, 0x93, 0xd9, 0xe7, 0x7f, 0x96, 0xd8, 0xf1, 0x3b, 0x83, 0xd3, 0xbd, 0x03, 0x6e, + 0xb1, 0xe8, 0x16, 0x4a, 0xe7, 0x61, 0xb1, 0xb2, 0xf4, 0xe5, 0xca, 0xd2, 0x3f, 0x56, 0x96, 0xfe, + 0xbc, 0xb6, 0xb4, 0xe5, 0xda, 0xd2, 0xde, 0xd6, 0x96, 0xf6, 0x78, 0xbd, 0xd3, 0xfe, 0x8e, 0x71, + 0xda, 0x9b, 0xd0, 0x39, 0x02, 0xc6, 0x69, 0x38, 0xa1, 0xf3, 0x51, 0xe2, 0xa3, 0x59, 0x1b, 0xcd, + 0xf7, 0xdf, 0x2c, 0x5f, 0xc9, 0x2f, 0xe7, 0xb7, 0x7c, 0xf9, 0x19, 0x00, 0x00, 0xff, 0xff, 0x07, + 0x40, 0x40, 0xad, 0x37, 0x02, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/tokenfactory/types/query.pb.go b/x/tokenfactory/types/query.pb.go index ab800c86..c66250a5 100644 --- a/x/tokenfactory/types/query.pb.go +++ b/x/tokenfactory/types/query.pb.go @@ -311,43 +311,44 @@ func init() { } var fileDescriptor_6f22013ad0f72e3f = []byte{ - // 575 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x4d, 0x6f, 0x13, 0x31, - 0x10, 0xcd, 0x42, 0x1b, 0x54, 0xf3, 0x21, 0x62, 0x2a, 0x04, 0x51, 0xd9, 0x80, 0xa9, 0xaa, 0x14, - 0x55, 0x6b, 0x52, 0x72, 0xa2, 0x20, 0xc8, 0x06, 0xc1, 0x01, 0x8a, 0x60, 0x6f, 0x70, 0x89, 0x9c, - 0xd4, 0xdd, 0x2e, 0x74, 0x77, 0xb6, 0xb6, 0x83, 0x88, 0xaa, 0x5e, 0x38, 0x70, 0x46, 0xe2, 0xc8, - 0x7f, 0xe0, 0x77, 0xf4, 0x58, 0xa9, 0x17, 0x4e, 0x11, 0x4a, 0x2a, 0x7e, 0x40, 0x7e, 0x01, 0x8a, - 0xed, 0x96, 0x96, 0x84, 0x55, 0x80, 0x53, 0x56, 0x9e, 0xf7, 0xde, 0xbc, 0x37, 0x33, 0x0a, 0x2a, - 0x83, 0x8c, 0x41, 0x46, 0x92, 0x2a, 0x78, 0xcb, 0x93, 0x75, 0xd6, 0x52, 0x20, 0x3a, 0xf4, 0x5d, - 0xa5, 0xc9, 0x15, 0xab, 0xd0, 0xad, 0x36, 0x17, 0x1d, 0x2f, 0x15, 0xa0, 0x00, 0xcf, 0x59, 0xa4, - 0x77, 0x1c, 0xe9, 0x59, 0x64, 0x71, 0x36, 0x84, 0x10, 0x34, 0x90, 0x0e, 0xbf, 0x0c, 0xa7, 0x38, - 0x17, 0x02, 0x84, 0x9b, 0x9c, 0xb2, 0x34, 0xa2, 0x2c, 0x49, 0x40, 0x31, 0x15, 0x41, 0x22, 0x6d, - 0xf5, 0x56, 0x4b, 0x4b, 0xd2, 0x26, 0x93, 0xdc, 0xb4, 0x3a, 0x6a, 0x9c, 0xb2, 0x30, 0x4a, 0x34, - 0xd8, 0x62, 0xab, 0x99, 0x3e, 0x59, 0x5b, 0x6d, 0x80, 0x88, 0x54, 0x67, 0x95, 0x2b, 0xb6, 0xc6, - 0x14, 0xb3, 0xac, 0xc5, 0x4c, 0x56, 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2, - 0x3b, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xa7, 0x10, 0x27, 0x8d, 0xd4, 0x05, 0x00, 0x00, + // 583 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xcf, 0x6b, 0x13, 0x41, + 0x14, 0xce, 0x6a, 0x1b, 0xe9, 0xf8, 0x03, 0x3b, 0x16, 0xd1, 0x50, 0x37, 0x3a, 0x96, 0x92, 0x4a, + 0xd9, 0x31, 0xb1, 0x20, 0x58, 0x45, 0xb3, 0x95, 0x7a, 0xd0, 0xa2, 0xdd, 0x9b, 0x5e, 0xc2, 0x24, + 0x9d, 0x6c, 0x16, 0xb3, 0xfb, 0xb6, 0x3b, 0x93, 0x92, 0x50, 0x7a, 0xf1, 0xe0, 0x59, 0xf0, 0xe8, + 0xff, 0xe0, 0xdf, 0xd1, 0x63, 0xa1, 0x17, 0x4f, 0x41, 0x92, 0xe2, 0x1f, 0x90, 0xbf, 0x40, 0x32, + 0x33, 0xad, 0xad, 0x89, 0x4b, 0xd4, 0x53, 0x96, 0x79, 0xdf, 0xf7, 0xbd, 0xef, 0x7b, 0xef, 0x11, + 0x54, 0x00, 0x11, 0x82, 0x08, 0x04, 0x95, 0xf0, 0x9e, 0x47, 0x75, 0x56, 0x93, 0x90, 0x74, 0xe8, + 0x4e, 0xb1, 0xca, 0x25, 0x2b, 0xd2, 0xed, 0x16, 0x4f, 0x3a, 0x4e, 0x9c, 0x80, 0x04, 0x3c, 0x6f, + 0x90, 0xce, 0x69, 0xa4, 0x63, 0x90, 0xb9, 0x39, 0x1f, 0x7c, 0x50, 0x40, 0x3a, 0xfc, 0xd2, 0x9c, + 0xdc, 0xbc, 0x0f, 0xe0, 0x37, 0x39, 0x65, 0x71, 0x40, 0x59, 0x14, 0x81, 0x64, 0x32, 0x80, 0x48, + 0x98, 0xea, 0xbd, 0x9a, 0x92, 0xa4, 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x87, 0x7e, 0x20, 0x1b, 0xad, 0xaa, 0x53, 0x83, 0x90, 0xbe, 0x0e, 0xa3, 0x60, 0xbd, 0x19, 0xb4, + 0x29, 0x84, 0x51, 0x50, 0x6f, 0x06, 0xed, 0x46, 0xab, 0x4a, 0x77, 0x4a, 0xb4, 0x7d, 0xb6, 0xa5, + 0xec, 0xc4, 0x5c, 0x54, 0xb3, 0xea, 0xcf, 0xec, 0xc1, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x51, + 0x86, 0xfe, 0x7e, 0xd7, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/tokenfactory/types/tx.pb.go b/x/tokenfactory/types/tx.pb.go index 06096461..7d5801fa 100644 --- a/x/tokenfactory/types/tx.pb.go +++ b/x/tokenfactory/types/tx.pb.go @@ -753,62 +753,63 @@ func init() { } var fileDescriptor_283b6c9a90a846b4 = []byte{ - // 876 bytes of a gzipped FileDescriptorProto + // 883 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0x4f, 0x6f, 0xdc, 0x44, 0x14, 0x8f, 0xdb, 0xb0, 0x24, 0xd3, 0xa6, 0x49, 0x9c, 0xd0, 0x6c, 0x4c, 0x6a, 0x57, 0x23, 0x8a, - 0x28, 0xa2, 0xb6, 0xb6, 0x94, 0x4a, 0xf4, 0x44, 0x1d, 0x14, 0x71, 0x60, 0x11, 0x72, 0xc3, 0x05, - 0x55, 0x5a, 0xcd, 0xee, 0x4e, 0x1c, 0x93, 0x7a, 0x66, 0x99, 0x99, 0x6d, 0xba, 0x37, 0xc4, 0x27, + 0x28, 0xa2, 0xb6, 0x36, 0x40, 0x11, 0x3d, 0x51, 0x17, 0x45, 0x1c, 0x58, 0x01, 0x6e, 0xb8, 0xa0, + 0x4a, 0xab, 0xd9, 0xdd, 0x89, 0x63, 0x65, 0x3d, 0xb3, 0x78, 0x66, 0xb3, 0xbb, 0x37, 0xc4, 0x27, 0xe0, 0x80, 0x90, 0x38, 0xf0, 0x01, 0xb8, 0x71, 0xe0, 0x03, 0x70, 0x42, 0x3d, 0x56, 0x9c, 0x38, - 0x59, 0x28, 0x39, 0x70, 0xf7, 0x27, 0xa8, 0x3c, 0x33, 0xfe, 0xbb, 0x55, 0x76, 0xf7, 0x94, 0x53, - 0x62, 0xbf, 0xdf, 0xef, 0x37, 0xef, 0xf7, 0xde, 0x9b, 0xb7, 0x06, 0x77, 0x28, 0x8f, 0x29, 0x8f, - 0xb8, 0x27, 0xe8, 0x09, 0x26, 0x47, 0x68, 0x20, 0x28, 0x9b, 0x78, 0xcf, 0x3b, 0x7d, 0x2c, 0x50, - 0xc7, 0x13, 0x2f, 0xdc, 0x11, 0xa3, 0x82, 0x9a, 0x7b, 0x1a, 0xe6, 0x56, 0x61, 0xae, 0x86, 0x59, - 0xdb, 0x21, 0x0d, 0xa9, 0x04, 0x7a, 0xd9, 0x7f, 0x8a, 0x63, 0xd9, 0x03, 0x49, 0xf2, 0xfa, 0x88, - 0xe3, 0x42, 0x71, 0x40, 0x23, 0x32, 0x15, 0x27, 0x27, 0x45, 0x3c, 0x7b, 0xd0, 0xf1, 0xbb, 0x17, - 0xa6, 0x36, 0x42, 0x0c, 0xc5, 0x5c, 0x43, 0x77, 0xb4, 0x54, 0xcc, 0x43, 0xef, 0x79, 0x27, 0xfb, - 0xa3, 0x03, 0xbb, 0x2a, 0xd0, 0x53, 0xc9, 0xa9, 0x07, 0x15, 0x82, 0xcf, 0xc0, 0x8d, 0x2e, 0x0f, - 0xf7, 0x19, 0x46, 0x02, 0x7f, 0x8e, 0x09, 0x8d, 0xcd, 0xbb, 0xa0, 0xc5, 0x31, 0x19, 0x62, 0xd6, - 0x36, 0x6e, 0x1b, 0x1f, 0xac, 0xfa, 0x9b, 0x69, 0xe2, 0xac, 0x4d, 0x50, 0xfc, 0xec, 0x11, 0x54, - 0xef, 0x61, 0xa0, 0x01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xf6, 0x8b, 0xa1, 0xc6, 0xef, 0x18, - 0x91, 0x10, 0x3f, 0x1e, 0xc6, 0xd1, 0x42, 0x16, 0xdf, 0x07, 0x6f, 0x55, 0x67, 0x6f, 0x23, 0x4d, - 0x9c, 0xeb, 0x0a, 0xa9, 0xe7, 0x43, 0x85, 0xcd, 0x0e, 0x58, 0xcd, 0x46, 0x07, 0x65, 0xfa, 0x3a, - 0xf5, 0xed, 0x34, 0x71, 0x36, 0xca, 0xa9, 0x92, 0x21, 0x18, 0xac, 0x10, 0x7c, 0x2a, 0xb3, 0x80, - 0x6d, 0x35, 0xa8, 0x65, 0x5e, 0x45, 0xca, 0x3f, 0x1b, 0x60, 0xab, 0xcb, 0xc3, 0x27, 0x58, 0xc8, - 0xa1, 0xeb, 0x62, 0x81, 0x86, 0x48, 0xa0, 0x45, 0xf2, 0x0e, 0xc0, 0x4a, 0xac, 0x69, 0xba, 0x39, - 0xb7, 0xca, 0xe6, 0x90, 0x93, 0xa2, 0x39, 0xb9, 0xb6, 0xbf, 0xa3, 0x1b, 0xa4, 0x6f, 0x56, 0x4e, - 0x86, 0x41, 0xa1, 0x03, 0x6f, 0x81, 0x77, 0xdf, 0x90, 0x55, 0x91, 0xf5, 0xef, 0x57, 0xc0, 0x46, - 0x97, 0x87, 0x07, 0x94, 0x0d, 0xf0, 0x21, 0x43, 0x84, 0x1f, 0x61, 0x76, 0x39, 0xd3, 0x14, 0x80, - 0x2d, 0xa1, 0x13, 0x98, 0x9e, 0xa8, 0xdb, 0x69, 0xe2, 0xec, 0x29, 0x5e, 0x0e, 0x6a, 0x4c, 0xd5, - 0x9b, 0xc8, 0xe6, 0x97, 0x60, 0x33, 0x7f, 0x5d, 0xde, 0xbd, 0x65, 0xa9, 0x68, 0xa7, 0x89, 0x63, - 0x35, 0x14, 0xab, 0xf7, 0x6f, 0x9a, 0x08, 0x2d, 0xd0, 0x6e, 0x96, 0xaa, 0xa8, 0xe3, 0x6f, 0x86, - 0x1c, 0xe2, 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x21, 0x58, 0x59, 0x5d, 0x2c, 0xc7, 0xf9, 0xea, 0x29, 0x6c, 0x01, 0xf5, 0xf2, + 0x8a, 0x12, 0xe5, 0x2a, 0xad, 0xa7, 0x05, 0xca, 0x55, 0xa0, 0x17, 0x29, 0xd7, 0xec, 0x8a, 0xd1, + 0x7f, 0xd0, 0xc0, 0xd6, 0xcc, 0x7e, 0x69, 0xcd, 0x95, 0xaa, 0x53, 0x8c, 0x4f, 0x97, 0xa6, 0xe4, + 0x29, 0x8c, 0xc1, 0x46, 0x75, 0x57, 0xd8, 0x73, 0xb5, 0x2a, 0x78, 0xe3, 0xe1, 0x72, 0xf8, 0xfc, + 0x60, 0x0e, 0x6e, 0x56, 0x2e, 0xd7, 0xfc, 0x6e, 0x95, 0xe1, 0xc6, 0xc7, 0x4b, 0xc1, 0xb3, 0x53, + 0xdd, 0x6f, 0x9e, 0x5f, 0x98, 0xda, 0x8b, 0x0b, 0x53, 0xfb, 0xef, 0xc2, 0xd4, 0x7e, 0xba, 0x34, + 0x57, 0x5e, 0x5c, 0x9a, 0x2b, 0xff, 0x5e, 0x9a, 0x2b, 0xdf, 0x7d, 0xe2, 0x07, 0xfc, 0x74, 0xd4, + 0xb5, 0x7b, 0x34, 0x74, 0xbe, 0x0a, 0x49, 0x70, 0x34, 0x08, 0x26, 0x0e, 0x0d, 0x49, 0x70, 0x32, + 0x08, 0x26, 0xa7, 0xa3, 0xae, 0x73, 0x7e, 0xe8, 0x4c, 0xaa, 0xdf, 0x66, 0x7c, 0x3a, 0xc4, 0xac, + 0xdb, 0x10, 0xdf, 0x57, 0x1f, 0xbe, 0x0c, 0x00, 0x00, 0xff, 0xff, 0x61, 0x8f, 0xff, 0x4b, 0x5b, + 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used.