From c1e1c339d464e189abb08ab1bca0552719651ea1 Mon Sep 17 00:00:00 2001 From: Pham Tu Date: Wed, 13 Nov 2024 14:50:37 +0700 Subject: [PATCH] update to v0.50 cosmos-sdk --- README.md | 2 +- package.json | 10 +- proto/README.md | 27 + proto/amino/amino.proto | 84 + proto/buf.gen.gogo.yaml | 8 + proto/buf.gen.pulsar.yaml | 20 + proto/buf.gen.swagger.yaml | 5 + proto/buf.lock | 13 +- proto/buf.md | 18 +- proto/buf.yaml | 13 +- proto/capability/v1/capability.proto | 32 + proto/capability/v1/genesis.proto | 28 + proto/confio/proofs.proto | 234 - .../cosmos/app/runtime/v1alpha1/module.proto | 65 + proto/cosmos/app/v1alpha1/config.proto | 55 + proto/cosmos/app/v1alpha1/module.proto | 91 + proto/cosmos/app/v1alpha1/query.proto | 22 + proto/cosmos/auth/v1beta1/auth.proto | 55 +- proto/cosmos/auth/v1beta1/genesis.proto | 5 +- proto/cosmos/auth/v1beta1/query.proto | 167 +- proto/cosmos/auth/v1beta1/tx.proto | 43 + proto/cosmos/authz/v1beta1/authz.proto | 27 +- proto/cosmos/authz/v1beta1/event.proto | 10 +- proto/cosmos/authz/v1beta1/genesis.proto | 3 +- proto/cosmos/authz/v1beta1/query.proto | 15 +- proto/cosmos/authz/v1beta1/tx.proto | 43 +- proto/cosmos/autocli/v1/options.proto | 124 + proto/cosmos/autocli/v1/query.proto | 28 + proto/cosmos/bank/v1beta1/authz.proto | 18 +- proto/cosmos/bank/v1beta1/bank.proto | 63 +- proto/cosmos/bank/v1beta1/genesis.proto | 37 +- proto/cosmos/bank/v1beta1/query.proto | 263 +- proto/cosmos/bank/v1beta1/tx.proto | 94 +- proto/cosmos/base/abci/v1beta1/abci.proto | 51 +- proto/cosmos/base/node/v1beta1/query.proto | 23 +- .../base/query/v1beta1/pagination.proto | 3 +- .../base/tendermint/v1beta1/query.proto | 82 +- .../base/tendermint/v1beta1/types.proto | 52 + proto/cosmos/base/v1beta1/coin.proto | 29 +- proto/cosmos/circuit/v1/query.proto | 61 + proto/cosmos/circuit/v1/tx.proto | 83 + proto/cosmos/circuit/v1/types.proto | 49 + proto/cosmos/consensus/v1/query.proto | 27 + proto/cosmos/consensus/v1/tx.proto | 46 + proto/cosmos/crisis/v1beta1/genesis.proto | 4 +- proto/cosmos/crisis/v1beta1/tx.proto | 48 +- proto/cosmos/crypto/ed25519/keys.proto | 18 +- proto/cosmos/crypto/hd/v1/hd.proto | 27 + proto/cosmos/crypto/keyring/v1/record.proto | 48 + proto/cosmos/crypto/multisig/keys.proto | 18 +- proto/cosmos/crypto/secp256k1/keys.proto | 16 + .../distribution/v1beta1/distribution.proto | 137 +- .../cosmos/distribution/v1beta1/genesis.proto | 62 +- proto/cosmos/distribution/v1beta1/query.proto | 85 +- proto/cosmos/distribution/v1beta1/tx.proto | 162 +- proto/cosmos/evidence/v1beta1/evidence.proto | 26 +- proto/cosmos/evidence/v1beta1/genesis.proto | 2 +- proto/cosmos/evidence/v1beta1/query.proto | 13 +- proto/cosmos/evidence/v1beta1/tx.proto | 16 +- proto/cosmos/feegrant/v1beta1/feegrant.proto | 62 +- proto/cosmos/feegrant/v1beta1/genesis.proto | 5 +- proto/cosmos/feegrant/v1beta1/query.proto | 22 +- proto/cosmos/feegrant/v1beta1/tx.proto | 44 +- proto/cosmos/genutil/v1beta1/genesis.proto | 10 +- proto/cosmos/gov/v1/genesis.proto | 40 + proto/cosmos/gov/v1/gov.proto | 271 ++ proto/cosmos/gov/v1/query.proto | 205 + proto/cosmos/gov/v1/tx.proto | 213 + proto/cosmos/gov/v1beta1/genesis.proto | 26 +- proto/cosmos/gov/v1beta1/gov.proto | 176 +- proto/cosmos/gov/v1beta1/query.proto | 42 +- proto/cosmos/gov/v1beta1/tx.proto | 107 +- proto/cosmos/group/v1/events.proto | 94 + proto/cosmos/group/v1/genesis.proto | 39 + proto/cosmos/group/v1/query.proto | 320 ++ proto/cosmos/group/v1/tx.proto | 394 ++ proto/cosmos/group/v1/types.proto | 339 ++ proto/cosmos/ics23/v1/proofs.proto | 202 + proto/cosmos/mint/v1beta1/genesis.proto | 7 +- proto/cosmos/mint/v1beta1/mint.proto | 47 +- proto/cosmos/mint/v1beta1/query.proto | 19 +- proto/cosmos/mint/v1beta1/tx.proto | 43 + proto/cosmos/msg/textual/v1/textual.proto | 18 + proto/cosmos/msg/v1/msg.proto | 30 + proto/cosmos/nft/v1beta1/event.proto | 43 + proto/cosmos/nft/v1beta1/genesis.proto | 24 + proto/cosmos/nft/v1beta1/nft.proto | 48 + proto/cosmos/nft/v1beta1/query.proto | 152 + proto/cosmos/nft/v1beta1/tx.proto | 34 + proto/cosmos/orm/query/v1alpha1/query.proto | 131 + proto/cosmos/orm/v1/orm.proto | 107 + proto/cosmos/orm/v1alpha1/schema.proto | 58 + proto/cosmos/params/v1beta1/params.proto | 11 +- proto/cosmos/params/v1beta1/query.proto | 33 +- proto/cosmos/query/v1/query.proto | 35 + proto/cosmos/reflection/v1/reflection.proto | 27 + proto/cosmos/slashing/v1beta1/genesis.proto | 22 +- proto/cosmos/slashing/v1beta1/query.proto | 13 +- proto/cosmos/slashing/v1beta1/slashing.proto | 64 +- proto/cosmos/slashing/v1beta1/tx.proto | 49 +- proto/cosmos/staking/v1beta1/authz.proto | 12 +- proto/cosmos/staking/v1beta1/genesis.proto | 30 +- proto/cosmos/staking/v1beta1/query.proto | 137 +- proto/cosmos/staking/v1beta1/staking.proto | 270 +- proto/cosmos/staking/v1beta1/tx.proto | 149 +- .../cosmos/store/internal/kv/v1beta1/kv.proto | 19 + .../cosmos/store/snapshots/v1/snapshot.proto | 67 + proto/cosmos/store/streaming/abci/grpc.proto | 36 + proto/cosmos/store/v1beta1/commit_info.proto | 31 + proto/cosmos/store/v1beta1/listening.proto | 28 + proto/cosmos/tx/config/v1/config.proto | 20 + proto/cosmos/tx/signing/v1beta1/signing.proto | 24 +- proto/cosmos/tx/v1beta1/service.proto | 163 +- proto/cosmos/tx/v1beta1/tx.proto | 85 +- proto/cosmos/upgrade/v1beta1/query.proto | 22 +- proto/cosmos/upgrade/v1beta1/tx.proto | 62 + proto/cosmos/upgrade/v1beta1/upgrade.proto | 48 +- proto/cosmos/vesting/v1beta1/tx.proto | 83 +- proto/cosmos/vesting/v1beta1/vesting.proto | 57 +- .../v1beta1/authorityMetadata.proto | 17 + .../tokenfactory/v1beta1/genesis.proto | 32 + .../tokenfactory/v1beta1/params.proto | 24 + .../cosmwasm/tokenfactory/v1beta1/query.proto | 71 + proto/cosmwasm/tokenfactory/v1beta1/tx.proto | 118 + proto/cosmwasm/wasm/v1/authz.proto | 55 +- proto/cosmwasm/wasm/v1/genesis.proto | 28 +- proto/cosmwasm/wasm/v1/ibc.proto | 3 + proto/cosmwasm/wasm/v1/proposal_legacy.proto | 387 ++ proto/cosmwasm/wasm/v1/query.proto | 104 +- proto/cosmwasm/wasm/v1/tx.proto | 417 +- proto/cosmwasm/wasm/v1/types.proto | 33 +- .../v1beta1/proposal_legacy_v1beta1.proto | 386 ++ proto/descriptor.proto | 921 ---- proto/ibc/applications/fee/v1/ack.proto | 10 +- proto/ibc/applications/fee/v1/fee.proto | 29 +- proto/ibc/applications/fee/v1/genesis.proto | 30 +- proto/ibc/applications/fee/v1/metadata.proto | 8 +- proto/ibc/applications/fee/v1/query.proto | 46 +- proto/ibc/applications/fee/v1/tx.proto | 42 +- .../controller/v1/controller.proto | 6 +- .../controller/v1/query.proto | 5 +- .../controller/v1/tx.proto | 82 + .../genesis/v1/genesis.proto | 47 + .../interchain_accounts/host/v1/host.proto | 19 +- .../interchain_accounts/host/v1/query.proto | 2 +- .../interchain_accounts/host/v1/tx.proto | 60 + .../interchain_accounts/v1/account.proto | 9 +- .../interchain_accounts/v1/metadata.proto | 8 +- .../interchain_accounts/v1/packet.proto | 2 +- .../ibc/applications/transfer/v1/authz.proto | 34 + .../applications/transfer/v1/genesis.proto | 17 +- .../ibc/applications/transfer/v1/query.proto | 20 +- .../applications/transfer/v1/transfer.proto | 8 +- proto/ibc/applications/transfer/v1/tx.proto | 46 +- .../ibc/applications/transfer/v2/packet.proto | 2 +- proto/ibc/core/channel/v1/channel.proto | 59 +- proto/ibc/core/channel/v1/genesis.proto | 18 +- proto/ibc/core/channel/v1/query.proto | 87 +- proto/ibc/core/channel/v1/tx.proto | 352 +- proto/ibc/core/channel/v1/upgrade.proto | 43 + proto/ibc/core/client/v1/client.proto | 86 +- proto/ibc/core/client/v1/genesis.proto | 26 +- proto/ibc/core/client/v1/query.proto | 41 +- proto/ibc/core/client/v1/tx.proto | 110 +- proto/ibc/core/commitment/v1/commitment.proto | 12 +- proto/ibc/core/connection/v1/connection.proto | 20 +- proto/ibc/core/connection/v1/genesis.proto | 7 +- proto/ibc/core/connection/v1/query.proto | 20 +- proto/ibc/core/connection/v1/tx.proto | 104 +- proto/ibc/core/types/v1/genesis.proto | 11 +- .../lightclients/localhost/v2/localhost.proto | 16 + .../solomachine/v2/solomachine.proto | 36 +- .../solomachine/v3/solomachine.proto | 99 + .../tendermint/v1/tendermint.proto | 57 +- proto/ibc/lightclients/wasm/v1/genesis.proto | 20 + proto/ibc/lightclients/wasm/v1/query.proto | 46 + proto/ibc/lightclients/wasm/v1/tx.proto | 66 + proto/ibc/lightclients/wasm/v1/wasm.proto | 43 + proto/proofs.proto | 234 - proto/tendermint/abci/types.proto | 471 +- proto/tendermint/crypto/keys.proto | 2 +- proto/tendermint/crypto/proof.proto | 2 +- proto/tendermint/libs/bits/types.proto | 2 +- proto/tendermint/p2p/types.proto | 2 +- proto/tendermint/types/block.proto | 2 +- proto/tendermint/types/evidence.proto | 4 +- proto/tendermint/types/params.proto | 37 +- proto/tendermint/types/types.proto | 89 +- proto/tendermint/types/validator.proto | 14 +- proto/tendermint/version/types.proto | 2 +- src/codegen/amino/amino.ts | 1 + src/codegen/amino/bundle.ts | 4 + src/codegen/capability/bundle.ts | 8 + src/codegen/capability/v1/capability.ts | 294 ++ src/codegen/capability/v1/genesis.ts | 214 + .../cosmos/app/runtime/v1alpha1/module.ts | 423 ++ src/codegen/cosmos/app/v1alpha1/config.ts | 417 ++ src/codegen/cosmos/app/v1alpha1/module.ts | 450 ++ .../cosmos/app/v1alpha1/query.rpc.Query.ts | 30 + src/codegen/cosmos/app/v1alpha1/query.ts | 163 + src/codegen/cosmos/auth/v1beta1/auth.ts | 133 +- src/codegen/cosmos/auth/v1beta1/genesis.ts | 8 +- src/codegen/cosmos/auth/v1beta1/query.lcd.ts | 61 +- .../cosmos/auth/v1beta1/query.rpc.Query.ts | 97 +- src/codegen/cosmos/auth/v1beta1/query.ts | 1355 +++++- src/codegen/cosmos/auth/v1beta1/tx.amino.ts | 8 + .../cosmos/auth/v1beta1/tx.registry.ts | 34 + src/codegen/cosmos/auth/v1beta1/tx.rpc.msg.ts | 25 + src/codegen/cosmos/auth/v1beta1/tx.ts | 215 + src/codegen/cosmos/authz/v1beta1/authz.ts | 121 +- src/codegen/cosmos/authz/v1beta1/genesis.ts | 2 +- src/codegen/cosmos/authz/v1beta1/query.lcd.ts | 4 +- .../cosmos/authz/v1beta1/query.rpc.Query.ts | 4 +- src/codegen/cosmos/authz/v1beta1/query.ts | 6 +- src/codegen/cosmos/authz/v1beta1/tx.ts | 190 +- src/codegen/cosmos/autocli/v1/options.ts | 1159 +++++ .../cosmos/autocli/v1/query.rpc.Query.ts | 31 + src/codegen/cosmos/autocli/v1/query.ts | 280 ++ src/codegen/cosmos/bank/v1beta1/authz.ts | 33 +- src/codegen/cosmos/bank/v1beta1/bank.ts | 85 +- src/codegen/cosmos/bank/v1beta1/genesis.ts | 51 +- src/codegen/cosmos/bank/v1beta1/query.lcd.ts | 131 +- .../cosmos/bank/v1beta1/query.rpc.Query.ts | 121 +- src/codegen/cosmos/bank/v1beta1/query.ts | 1412 +++++- src/codegen/cosmos/bank/v1beta1/tx.amino.ts | 12 +- .../cosmos/bank/v1beta1/tx.registry.ts | 40 +- src/codegen/cosmos/bank/v1beta1/tx.rpc.msg.ts | 30 +- src/codegen/cosmos/bank/v1beta1/tx.ts | 474 +- src/codegen/cosmos/base/abci/v1beta1/abci.ts | 272 +- .../cosmos/base/node/v1beta1/query.lcd.ts | 8 +- .../base/node/v1beta1/query.rpc.Service.ts | 13 +- src/codegen/cosmos/base/node/v1beta1/query.ts | 278 +- .../cosmos/base/query/v1beta1/pagination.ts | 6 +- .../cosmos/base/store/v1beta1/listening.ts | 112 +- .../base/tendermint/v1beta1/query.lcd.ts | 27 +- .../tendermint/v1beta1/query.rpc.Service.ts | 19 +- .../cosmos/base/tendermint/v1beta1/query.ts | 690 ++- .../cosmos/base/tendermint/v1beta1/types.ts | 459 ++ src/codegen/cosmos/base/v1beta1/coin.ts | 43 +- src/codegen/cosmos/bundle.ts | 904 ++-- src/codegen/cosmos/circuit/v1/query.lcd.ts | 39 + .../cosmos/circuit/v1/query.rpc.Query.ts | 54 + src/codegen/cosmos/circuit/v1/query.ts | 541 +++ src/codegen/cosmos/circuit/v1/tx.amino.ts | 18 + src/codegen/cosmos/circuit/v1/tx.registry.ts | 70 + src/codegen/cosmos/circuit/v1/tx.rpc.msg.ts | 42 + src/codegen/cosmos/circuit/v1/tx.ts | 648 +++ src/codegen/cosmos/circuit/v1/types.ts | 403 ++ src/codegen/cosmos/client.ts | 26 +- src/codegen/cosmos/consensus/v1/query.lcd.ts | 18 + .../cosmos/consensus/v1/query.rpc.Query.ts | 30 + src/codegen/cosmos/consensus/v1/query.ts | 171 + src/codegen/cosmos/consensus/v1/tx.amino.ts | 8 + .../cosmos/consensus/v1/tx.registry.ts | 34 + src/codegen/cosmos/consensus/v1/tx.rpc.msg.ts | 25 + src/codegen/cosmos/consensus/v1/tx.ts | 248 + src/codegen/cosmos/crisis/v1beta1/genesis.ts | 4 +- src/codegen/cosmos/crisis/v1beta1/tx.amino.ts | 7 +- .../cosmos/crisis/v1beta1/tx.registry.ts | 22 +- .../cosmos/crisis/v1beta1/tx.rpc.msg.ts | 17 +- src/codegen/cosmos/crisis/v1beta1/tx.ts | 212 + src/codegen/cosmos/crypto/ed25519/keys.ts | 14 +- src/codegen/cosmos/crypto/hd/v1/hd.ts | 166 + .../cosmos/crypto/keyring/v1/record.ts | 506 ++ src/codegen/cosmos/crypto/multisig/keys.ts | 4 +- src/codegen/cosmos/crypto/secp256k1/keys.ts | 8 +- .../distribution/v1beta1/distribution.ts | 76 +- .../cosmos/distribution/v1beta1/genesis.ts | 60 +- .../cosmos/distribution/v1beta1/query.lcd.ts | 10 +- .../distribution/v1beta1/query.rpc.Query.ts | 15 +- .../cosmos/distribution/v1beta1/query.ts | 246 +- .../cosmos/distribution/v1beta1/tx.amino.ts | 17 +- .../distribution/v1beta1/tx.registry.ts | 58 +- .../cosmos/distribution/v1beta1/tx.rpc.msg.ts | 43 +- src/codegen/cosmos/distribution/v1beta1/tx.ts | 786 ++- .../cosmos/evidence/v1beta1/evidence.ts | 12 +- .../cosmos/evidence/v1beta1/query.lcd.ts | 10 +- src/codegen/cosmos/evidence/v1beta1/query.ts | 40 +- src/codegen/cosmos/evidence/v1beta1/tx.ts | 4 + .../cosmos/feegrant/v1beta1/feegrant.ts | 40 +- .../cosmos/feegrant/v1beta1/genesis.ts | 2 +- .../cosmos/feegrant/v1beta1/query.lcd.ts | 7 +- .../feegrant/v1beta1/query.rpc.Query.ts | 7 +- src/codegen/cosmos/feegrant/v1beta1/query.ts | 36 +- .../cosmos/feegrant/v1beta1/tx.amino.ts | 7 +- .../cosmos/feegrant/v1beta1/tx.registry.ts | 22 +- .../cosmos/feegrant/v1beta1/tx.rpc.msg.ts | 14 +- src/codegen/cosmos/feegrant/v1beta1/tx.ts | 189 +- src/codegen/cosmos/gov/v1/genesis.ts | 284 ++ src/codegen/cosmos/gov/v1/gov.ts | 1853 ++++++++ src/codegen/cosmos/gov/v1/query.lcd.ts | 94 + src/codegen/cosmos/gov/v1/query.rpc.Query.ts | 118 + src/codegen/cosmos/gov/v1/query.ts | 1895 ++++++++ src/codegen/cosmos/gov/v1/tx.amino.ts | 38 + src/codegen/cosmos/gov/v1/tx.registry.ts | 142 + src/codegen/cosmos/gov/v1/tx.rpc.msg.ts | 80 + src/codegen/cosmos/gov/v1/tx.ts | 1610 +++++++ src/codegen/cosmos/gov/v1beta1/genesis.ts | 30 +- src/codegen/cosmos/gov/v1beta1/gov.ts | 120 +- src/codegen/cosmos/gov/v1beta1/query.lcd.ts | 2 +- .../cosmos/gov/v1beta1/query.rpc.Query.ts | 2 +- src/codegen/cosmos/gov/v1beta1/query.ts | 50 +- src/codegen/cosmos/gov/v1beta1/tx.rpc.msg.ts | 2 +- src/codegen/cosmos/gov/v1beta1/tx.ts | 40 +- src/codegen/cosmos/group/v1/events.ts | 997 ++++ src/codegen/cosmos/group/v1/genesis.ts | 240 + src/codegen/cosmos/group/v1/query.lcd.ts | 159 + .../cosmos/group/v1/query.rpc.Query.ts | 185 + src/codegen/cosmos/group/v1/query.ts | 2899 +++++++++++ src/codegen/cosmos/group/v1/tx.amino.ts | 73 + src/codegen/cosmos/group/v1/tx.registry.ts | 268 ++ src/codegen/cosmos/group/v1/tx.rpc.msg.ts | 124 + src/codegen/cosmos/group/v1/tx.ts | 3075 ++++++++++++ src/codegen/cosmos/group/v1/types.ts | 2091 ++++++++ src/codegen/cosmos/ics23/v1/proofs.ts | 2032 ++++++++ src/codegen/cosmos/lcd.ts | 23 + src/codegen/cosmos/mint/v1beta1/genesis.ts | 12 +- src/codegen/cosmos/mint/v1beta1/mint.ts | 26 +- src/codegen/cosmos/mint/v1beta1/query.ts | 12 +- src/codegen/cosmos/mint/v1beta1/tx.amino.ts | 8 + .../cosmos/mint/v1beta1/tx.registry.ts | 34 + src/codegen/cosmos/mint/v1beta1/tx.rpc.msg.ts | 25 + src/codegen/cosmos/mint/v1beta1/tx.ts | 215 + src/codegen/cosmos/msg/textual/v1/textual.ts | 1 + src/codegen/cosmos/msg/v1/msg.ts | 1 + src/codegen/cosmos/nft/v1beta1/event.ts | 393 ++ src/codegen/cosmos/nft/v1beta1/genesis.ts | 224 + src/codegen/cosmos/nft/v1beta1/nft.ts | 354 ++ src/codegen/cosmos/nft/v1beta1/query.lcd.ts | 76 + .../cosmos/nft/v1beta1/query.rpc.Query.ts | 101 + src/codegen/cosmos/nft/v1beta1/query.ts | 1400 ++++++ src/codegen/cosmos/nft/v1beta1/tx.amino.ts | 8 + src/codegen/cosmos/nft/v1beta1/tx.registry.ts | 34 + src/codegen/cosmos/nft/v1beta1/tx.rpc.msg.ts | 20 + src/codegen/cosmos/nft/v1beta1/tx.ts | 213 + .../orm/query/v1alpha1/query.rpc.Query.ts | 41 + .../cosmos/orm/query/v1alpha1/query.ts | 972 ++++ src/codegen/cosmos/orm/v1/orm.ts | 572 +++ src/codegen/cosmos/orm/v1alpha1/schema.ts | 318 ++ src/codegen/cosmos/params/v1beta1/params.ts | 2 +- .../cosmos/params/v1beta1/query.lcd.ts | 10 +- .../cosmos/params/v1beta1/query.rpc.Query.ts | 17 +- src/codegen/cosmos/params/v1beta1/query.ts | 316 +- src/codegen/cosmos/query/v1/query.ts | 1 + .../cosmos/reflection/v1/reflection.ts | 165 + src/codegen/cosmos/rpc.query.ts | 24 + src/codegen/cosmos/rpc.tx.ts | 22 + .../cosmos/slashing/v1beta1/genesis.ts | 18 +- src/codegen/cosmos/slashing/v1beta1/query.ts | 10 +- .../cosmos/slashing/v1beta1/slashing.ts | 58 +- .../cosmos/slashing/v1beta1/tx.amino.ts | 7 +- .../cosmos/slashing/v1beta1/tx.registry.ts | 22 +- .../cosmos/slashing/v1beta1/tx.rpc.msg.ts | 15 +- src/codegen/cosmos/slashing/v1beta1/tx.ts | 214 + src/codegen/cosmos/staking/v1beta1/authz.ts | 7 + src/codegen/cosmos/staking/v1beta1/genesis.ts | 28 +- .../cosmos/staking/v1beta1/query.lcd.ts | 35 +- .../cosmos/staking/v1beta1/query.rpc.Query.ts | 41 +- src/codegen/cosmos/staking/v1beta1/query.ts | 46 +- src/codegen/cosmos/staking/v1beta1/staking.ts | 202 +- .../cosmos/staking/v1beta1/tx.amino.ts | 12 +- .../cosmos/staking/v1beta1/tx.registry.ts | 40 +- .../cosmos/staking/v1beta1/tx.rpc.msg.ts | 27 +- src/codegen/cosmos/staking/v1beta1/tx.ts | 527 +- .../cosmos/store/internal/kv/v1beta1/kv.ts | 197 + .../cosmos/store/snapshots/v1/snapshot.ts | 858 ++++ .../cosmos/store/streaming/abci/grpc.ts | 370 ++ .../cosmos/store/v1beta1/commit_info.ts | 359 ++ src/codegen/cosmos/store/v1beta1/listening.ts | 289 ++ src/codegen/cosmos/tx/config/v1/config.ts | 121 + .../cosmos/tx/signing/v1beta1/signing.ts | 34 +- src/codegen/cosmos/tx/v1beta1/service.lcd.ts | 9 + .../cosmos/tx/v1beta1/service.rpc.Service.ts | 62 +- src/codegen/cosmos/tx/v1beta1/service.ts | 1006 +++- src/codegen/cosmos/tx/v1beta1/tx.ts | 550 ++- .../cosmos/upgrade/v1beta1/query.lcd.ts | 10 +- .../cosmos/upgrade/v1beta1/query.rpc.Query.ts | 17 +- src/codegen/cosmos/upgrade/v1beta1/query.ts | 183 + .../cosmos/upgrade/v1beta1/tx.amino.ts | 13 + .../cosmos/upgrade/v1beta1/tx.registry.ts | 52 + .../cosmos/upgrade/v1beta1/tx.rpc.msg.ts | 37 + src/codegen/cosmos/upgrade/v1beta1/tx.ts | 389 ++ src/codegen/cosmos/upgrade/v1beta1/upgrade.ts | 46 +- .../cosmos/vesting/v1beta1/tx.amino.ts | 12 +- .../cosmos/vesting/v1beta1/tx.registry.ts | 40 +- .../cosmos/vesting/v1beta1/tx.rpc.msg.ts | 28 +- src/codegen/cosmos/vesting/v1beta1/tx.ts | 461 +- src/codegen/cosmos/vesting/v1beta1/vesting.ts | 16 +- src/codegen/cosmos_proto/bundle.ts | 4 +- src/codegen/cosmwasm/bundle.ts | 90 +- src/codegen/cosmwasm/client.ts | 5 +- src/codegen/cosmwasm/lcd.ts | 28 + src/codegen/cosmwasm/rpc.query.ts | 27 + src/codegen/cosmwasm/rpc.tx.ts | 25 + .../tokenfactory/v1beta1/authorityMetadata.ts | 104 + .../cosmwasm/tokenfactory/v1beta1/genesis.ts | 227 + .../cosmwasm/tokenfactory/v1beta1/params.ts | 110 + .../tokenfactory/v1beta1/query.lcd.ts | 33 + .../tokenfactory/v1beta1/query.rpc.Query.ts | 61 + .../cosmwasm/tokenfactory/v1beta1/query.ts | 558 +++ .../cosmwasm/tokenfactory/v1beta1/tx.amino.ts | 33 + .../tokenfactory/v1beta1/tx.registry.ts | 124 + .../tokenfactory/v1beta1/tx.rpc.msg.ts | 54 + .../cosmwasm/tokenfactory/v1beta1/tx.ts | 1224 +++++ src/codegen/cosmwasm/wasm/v1/authz.ts | 234 +- src/codegen/cosmwasm/wasm/v1/genesis.ts | 16 +- src/codegen/cosmwasm/wasm/v1/ibc.ts | 70 + .../cosmwasm/wasm/v1/proposal_legacy.ts | 2773 +++++++++++ src/codegen/cosmwasm/wasm/v1/query.lcd.ts | 23 +- .../cosmwasm/wasm/v1/query.rpc.Query.ts | 13 +- src/codegen/cosmwasm/wasm/v1/query.ts | 287 +- src/codegen/cosmwasm/wasm/v1/tx.amino.ts | 52 +- src/codegen/cosmwasm/wasm/v1/tx.registry.ts | 184 +- src/codegen/cosmwasm/wasm/v1/tx.rpc.msg.ts | 126 +- src/codegen/cosmwasm/wasm/v1/tx.ts | 4106 ++++++++++++---- src/codegen/cosmwasm/wasm/v1/types.ts | 41 +- .../wasm/v1beta1/proposal_legacy_v1beta1.ts | 2655 +++++++++++ src/codegen/gogoproto/bundle.ts | 4 +- src/codegen/google/bundle.ts | 34 +- src/codegen/ibc/applications/fee/v1/query.ts | 59 +- src/codegen/ibc/applications/fee/v1/tx.ts | 12 +- .../controller/v1/tx.amino.ts | 18 + .../controller/v1/tx.registry.ts | 70 + .../controller/v1/tx.rpc.msg.ts | 36 + .../interchain_accounts/controller/v1/tx.ts | 659 +++ .../interchain_accounts/genesis/v1/genesis.ts | 651 +++ .../interchain_accounts/host/v1/host.ts | 130 + .../interchain_accounts/host/v1/tx.amino.ts | 13 + .../host/v1/tx.registry.ts | 52 + .../interchain_accounts/host/v1/tx.rpc.msg.ts | 28 + .../interchain_accounts/host/v1/tx.ts | 409 ++ .../ibc/applications/transfer/v1/authz.ts | 275 ++ .../ibc/applications/transfer/v1/genesis.ts | 28 +- .../ibc/applications/transfer/v1/query.lcd.ts | 14 +- .../transfer/v1/query.rpc.Query.ts | 13 +- .../ibc/applications/transfer/v1/query.ts | 179 + .../ibc/applications/transfer/v1/tx.amino.ts | 7 +- .../applications/transfer/v1/tx.registry.ts | 22 +- .../applications/transfer/v1/tx.rpc.msg.ts | 10 +- .../ibc/applications/transfer/v1/tx.ts | 203 +- src/codegen/ibc/bundle.ts | 332 +- src/codegen/ibc/client.ts | 13 +- src/codegen/ibc/core/channel/v1/channel.ts | 277 +- src/codegen/ibc/core/channel/v1/genesis.ts | 19 +- src/codegen/ibc/core/channel/v1/query.lcd.ts | 26 +- .../ibc/core/channel/v1/query.rpc.Query.ts | 46 +- src/codegen/ibc/core/channel/v1/query.ts | 875 +++- src/codegen/ibc/core/channel/v1/tx.amino.ts | 47 +- .../ibc/core/channel/v1/tx.registry.ts | 166 +- src/codegen/ibc/core/channel/v1/tx.rpc.msg.ts | 74 +- src/codegen/ibc/core/channel/v1/tx.ts | 2348 ++++++++- src/codegen/ibc/core/channel/v1/upgrade.ts | 389 ++ src/codegen/ibc/core/client/v1/client.ts | 492 +- src/codegen/ibc/core/client/v1/genesis.ts | 13 +- src/codegen/ibc/core/client/v1/query.lcd.ts | 4 +- .../ibc/core/client/v1/query.rpc.Query.ts | 15 +- src/codegen/ibc/core/client/v1/query.ts | 287 +- src/codegen/ibc/core/client/v1/tx.amino.ts | 17 +- src/codegen/ibc/core/client/v1/tx.registry.ts | 58 +- src/codegen/ibc/core/client/v1/tx.rpc.msg.ts | 26 +- src/codegen/ibc/core/client/v1/tx.ts | 638 ++- .../ibc/core/commitment/v1/commitment.ts | 2 +- .../ibc/core/connection/v1/query.lcd.ts | 8 +- .../ibc/core/connection/v1/query.rpc.Query.ts | 13 +- src/codegen/ibc/core/connection/v1/query.ts | 163 +- .../ibc/core/connection/v1/tx.amino.ts | 7 +- .../ibc/core/connection/v1/tx.registry.ts | 22 +- .../ibc/core/connection/v1/tx.rpc.msg.ts | 13 +- src/codegen/ibc/core/connection/v1/tx.ts | 226 +- src/codegen/ibc/lcd.ts | 30 + .../lightclients/localhost/v2/localhost.ts | 93 + .../solomachine/v3/solomachine.ts | 1063 +++++ .../lightclients/tendermint/v1/tendermint.ts | 7 +- .../ibc/lightclients/wasm/v1/genesis.ts | 186 + .../ibc/lightclients/wasm/v1/query.lcd.ts | 33 + .../lightclients/wasm/v1/query.rpc.Query.ts | 43 + src/codegen/ibc/lightclients/wasm/v1/query.ts | 384 ++ .../ibc/lightclients/wasm/v1/tx.amino.ts | 18 + .../ibc/lightclients/wasm/v1/tx.registry.ts | 70 + .../ibc/lightclients/wasm/v1/tx.rpc.msg.ts | 36 + src/codegen/ibc/lightclients/wasm/v1/tx.ts | 591 +++ src/codegen/ibc/lightclients/wasm/v1/wasm.ts | 425 ++ src/codegen/ibc/rpc.query.ts | 29 + src/codegen/ibc/rpc.tx.ts | 35 + src/codegen/index.ts | 5 +- src/codegen/tendermint/abci/types.ts | 4232 ++++++++++------- src/codegen/tendermint/bundle.ts | 44 +- src/codegen/tendermint/types/params.ts | 195 +- src/codegen/tendermint/types/types.ts | 414 +- src/codegen/tendermint/types/validator.ts | 48 + 490 files changed, 83145 insertions(+), 7516 deletions(-) create mode 100644 proto/README.md create mode 100644 proto/amino/amino.proto create mode 100644 proto/buf.gen.gogo.yaml create mode 100644 proto/buf.gen.pulsar.yaml create mode 100644 proto/buf.gen.swagger.yaml create mode 100644 proto/capability/v1/capability.proto create mode 100644 proto/capability/v1/genesis.proto delete mode 100644 proto/confio/proofs.proto create mode 100644 proto/cosmos/app/runtime/v1alpha1/module.proto create mode 100644 proto/cosmos/app/v1alpha1/config.proto create mode 100644 proto/cosmos/app/v1alpha1/module.proto create mode 100644 proto/cosmos/app/v1alpha1/query.proto create mode 100644 proto/cosmos/auth/v1beta1/tx.proto create mode 100644 proto/cosmos/autocli/v1/options.proto create mode 100644 proto/cosmos/autocli/v1/query.proto create mode 100644 proto/cosmos/base/tendermint/v1beta1/types.proto create mode 100644 proto/cosmos/circuit/v1/query.proto create mode 100644 proto/cosmos/circuit/v1/tx.proto create mode 100644 proto/cosmos/circuit/v1/types.proto create mode 100644 proto/cosmos/consensus/v1/query.proto create mode 100644 proto/cosmos/consensus/v1/tx.proto create mode 100644 proto/cosmos/crypto/hd/v1/hd.proto create mode 100644 proto/cosmos/crypto/keyring/v1/record.proto create mode 100644 proto/cosmos/gov/v1/genesis.proto create mode 100644 proto/cosmos/gov/v1/gov.proto create mode 100644 proto/cosmos/gov/v1/query.proto create mode 100644 proto/cosmos/gov/v1/tx.proto create mode 100644 proto/cosmos/group/v1/events.proto create mode 100644 proto/cosmos/group/v1/genesis.proto create mode 100644 proto/cosmos/group/v1/query.proto create mode 100644 proto/cosmos/group/v1/tx.proto create mode 100644 proto/cosmos/group/v1/types.proto create mode 100644 proto/cosmos/ics23/v1/proofs.proto create mode 100644 proto/cosmos/mint/v1beta1/tx.proto create mode 100644 proto/cosmos/msg/textual/v1/textual.proto create mode 100644 proto/cosmos/msg/v1/msg.proto create mode 100644 proto/cosmos/nft/v1beta1/event.proto create mode 100644 proto/cosmos/nft/v1beta1/genesis.proto create mode 100644 proto/cosmos/nft/v1beta1/nft.proto create mode 100644 proto/cosmos/nft/v1beta1/query.proto create mode 100644 proto/cosmos/nft/v1beta1/tx.proto create mode 100644 proto/cosmos/orm/query/v1alpha1/query.proto create mode 100644 proto/cosmos/orm/v1/orm.proto create mode 100644 proto/cosmos/orm/v1alpha1/schema.proto create mode 100644 proto/cosmos/query/v1/query.proto create mode 100644 proto/cosmos/reflection/v1/reflection.proto create mode 100644 proto/cosmos/store/internal/kv/v1beta1/kv.proto create mode 100644 proto/cosmos/store/snapshots/v1/snapshot.proto create mode 100644 proto/cosmos/store/streaming/abci/grpc.proto create mode 100644 proto/cosmos/store/v1beta1/commit_info.proto create mode 100644 proto/cosmos/store/v1beta1/listening.proto create mode 100644 proto/cosmos/tx/config/v1/config.proto create mode 100644 proto/cosmos/upgrade/v1beta1/tx.proto create mode 100755 proto/cosmwasm/tokenfactory/v1beta1/authorityMetadata.proto create mode 100755 proto/cosmwasm/tokenfactory/v1beta1/genesis.proto create mode 100755 proto/cosmwasm/tokenfactory/v1beta1/params.proto create mode 100755 proto/cosmwasm/tokenfactory/v1beta1/query.proto create mode 100755 proto/cosmwasm/tokenfactory/v1beta1/tx.proto create mode 100644 proto/cosmwasm/wasm/v1/proposal_legacy.proto create mode 100644 proto/cosmwasm/wasm/v1beta1/proposal_legacy_v1beta1.proto delete mode 100644 proto/descriptor.proto create mode 100644 proto/ibc/applications/interchain_accounts/controller/v1/tx.proto create mode 100644 proto/ibc/applications/interchain_accounts/genesis/v1/genesis.proto create mode 100644 proto/ibc/applications/interchain_accounts/host/v1/tx.proto create mode 100644 proto/ibc/applications/transfer/v1/authz.proto create mode 100644 proto/ibc/core/channel/v1/upgrade.proto create mode 100644 proto/ibc/lightclients/localhost/v2/localhost.proto create mode 100644 proto/ibc/lightclients/solomachine/v3/solomachine.proto create mode 100644 proto/ibc/lightclients/wasm/v1/genesis.proto create mode 100644 proto/ibc/lightclients/wasm/v1/query.proto create mode 100644 proto/ibc/lightclients/wasm/v1/tx.proto create mode 100644 proto/ibc/lightclients/wasm/v1/wasm.proto delete mode 100644 proto/proofs.proto create mode 100644 src/codegen/amino/amino.ts create mode 100644 src/codegen/amino/bundle.ts create mode 100644 src/codegen/capability/bundle.ts create mode 100644 src/codegen/capability/v1/capability.ts create mode 100644 src/codegen/capability/v1/genesis.ts create mode 100644 src/codegen/cosmos/app/runtime/v1alpha1/module.ts create mode 100644 src/codegen/cosmos/app/v1alpha1/config.ts create mode 100644 src/codegen/cosmos/app/v1alpha1/module.ts create mode 100644 src/codegen/cosmos/app/v1alpha1/query.rpc.Query.ts create mode 100644 src/codegen/cosmos/app/v1alpha1/query.ts create mode 100644 src/codegen/cosmos/auth/v1beta1/tx.amino.ts create mode 100644 src/codegen/cosmos/auth/v1beta1/tx.registry.ts create mode 100644 src/codegen/cosmos/auth/v1beta1/tx.rpc.msg.ts create mode 100644 src/codegen/cosmos/auth/v1beta1/tx.ts create mode 100644 src/codegen/cosmos/autocli/v1/options.ts create mode 100644 src/codegen/cosmos/autocli/v1/query.rpc.Query.ts create mode 100644 src/codegen/cosmos/autocli/v1/query.ts create mode 100644 src/codegen/cosmos/base/tendermint/v1beta1/types.ts create mode 100644 src/codegen/cosmos/circuit/v1/query.lcd.ts create mode 100644 src/codegen/cosmos/circuit/v1/query.rpc.Query.ts create mode 100644 src/codegen/cosmos/circuit/v1/query.ts create mode 100644 src/codegen/cosmos/circuit/v1/tx.amino.ts create mode 100644 src/codegen/cosmos/circuit/v1/tx.registry.ts create mode 100644 src/codegen/cosmos/circuit/v1/tx.rpc.msg.ts create mode 100644 src/codegen/cosmos/circuit/v1/tx.ts create mode 100644 src/codegen/cosmos/circuit/v1/types.ts create mode 100644 src/codegen/cosmos/consensus/v1/query.lcd.ts create mode 100644 src/codegen/cosmos/consensus/v1/query.rpc.Query.ts create mode 100644 src/codegen/cosmos/consensus/v1/query.ts create mode 100644 src/codegen/cosmos/consensus/v1/tx.amino.ts create mode 100644 src/codegen/cosmos/consensus/v1/tx.registry.ts create mode 100644 src/codegen/cosmos/consensus/v1/tx.rpc.msg.ts create mode 100644 src/codegen/cosmos/consensus/v1/tx.ts create mode 100644 src/codegen/cosmos/crypto/hd/v1/hd.ts create mode 100644 src/codegen/cosmos/crypto/keyring/v1/record.ts create mode 100644 src/codegen/cosmos/gov/v1/genesis.ts create mode 100644 src/codegen/cosmos/gov/v1/gov.ts create mode 100644 src/codegen/cosmos/gov/v1/query.lcd.ts create mode 100644 src/codegen/cosmos/gov/v1/query.rpc.Query.ts create mode 100644 src/codegen/cosmos/gov/v1/query.ts create mode 100644 src/codegen/cosmos/gov/v1/tx.amino.ts create mode 100644 src/codegen/cosmos/gov/v1/tx.registry.ts create mode 100644 src/codegen/cosmos/gov/v1/tx.rpc.msg.ts create mode 100644 src/codegen/cosmos/gov/v1/tx.ts create mode 100644 src/codegen/cosmos/group/v1/events.ts create mode 100644 src/codegen/cosmos/group/v1/genesis.ts create mode 100644 src/codegen/cosmos/group/v1/query.lcd.ts create mode 100644 src/codegen/cosmos/group/v1/query.rpc.Query.ts create mode 100644 src/codegen/cosmos/group/v1/query.ts create mode 100644 src/codegen/cosmos/group/v1/tx.amino.ts create mode 100644 src/codegen/cosmos/group/v1/tx.registry.ts create mode 100644 src/codegen/cosmos/group/v1/tx.rpc.msg.ts create mode 100644 src/codegen/cosmos/group/v1/tx.ts create mode 100644 src/codegen/cosmos/group/v1/types.ts create mode 100644 src/codegen/cosmos/ics23/v1/proofs.ts create mode 100644 src/codegen/cosmos/mint/v1beta1/tx.amino.ts create mode 100644 src/codegen/cosmos/mint/v1beta1/tx.registry.ts create mode 100644 src/codegen/cosmos/mint/v1beta1/tx.rpc.msg.ts create mode 100644 src/codegen/cosmos/mint/v1beta1/tx.ts create mode 100644 src/codegen/cosmos/msg/textual/v1/textual.ts create mode 100644 src/codegen/cosmos/msg/v1/msg.ts create mode 100644 src/codegen/cosmos/nft/v1beta1/event.ts create mode 100644 src/codegen/cosmos/nft/v1beta1/genesis.ts create mode 100644 src/codegen/cosmos/nft/v1beta1/nft.ts create mode 100644 src/codegen/cosmos/nft/v1beta1/query.lcd.ts create mode 100644 src/codegen/cosmos/nft/v1beta1/query.rpc.Query.ts create mode 100644 src/codegen/cosmos/nft/v1beta1/query.ts create mode 100644 src/codegen/cosmos/nft/v1beta1/tx.amino.ts create mode 100644 src/codegen/cosmos/nft/v1beta1/tx.registry.ts create mode 100644 src/codegen/cosmos/nft/v1beta1/tx.rpc.msg.ts create mode 100644 src/codegen/cosmos/nft/v1beta1/tx.ts create mode 100644 src/codegen/cosmos/orm/query/v1alpha1/query.rpc.Query.ts create mode 100644 src/codegen/cosmos/orm/query/v1alpha1/query.ts create mode 100644 src/codegen/cosmos/orm/v1/orm.ts create mode 100644 src/codegen/cosmos/orm/v1alpha1/schema.ts create mode 100644 src/codegen/cosmos/query/v1/query.ts create mode 100644 src/codegen/cosmos/reflection/v1/reflection.ts create mode 100644 src/codegen/cosmos/store/internal/kv/v1beta1/kv.ts create mode 100644 src/codegen/cosmos/store/snapshots/v1/snapshot.ts create mode 100644 src/codegen/cosmos/store/streaming/abci/grpc.ts create mode 100644 src/codegen/cosmos/store/v1beta1/commit_info.ts create mode 100644 src/codegen/cosmos/store/v1beta1/listening.ts create mode 100644 src/codegen/cosmos/tx/config/v1/config.ts create mode 100644 src/codegen/cosmos/upgrade/v1beta1/tx.amino.ts create mode 100644 src/codegen/cosmos/upgrade/v1beta1/tx.registry.ts create mode 100644 src/codegen/cosmos/upgrade/v1beta1/tx.rpc.msg.ts create mode 100644 src/codegen/cosmos/upgrade/v1beta1/tx.ts create mode 100644 src/codegen/cosmwasm/tokenfactory/v1beta1/authorityMetadata.ts create mode 100644 src/codegen/cosmwasm/tokenfactory/v1beta1/genesis.ts create mode 100644 src/codegen/cosmwasm/tokenfactory/v1beta1/params.ts create mode 100644 src/codegen/cosmwasm/tokenfactory/v1beta1/query.lcd.ts create mode 100644 src/codegen/cosmwasm/tokenfactory/v1beta1/query.rpc.Query.ts create mode 100644 src/codegen/cosmwasm/tokenfactory/v1beta1/query.ts create mode 100644 src/codegen/cosmwasm/tokenfactory/v1beta1/tx.amino.ts create mode 100644 src/codegen/cosmwasm/tokenfactory/v1beta1/tx.registry.ts create mode 100644 src/codegen/cosmwasm/tokenfactory/v1beta1/tx.rpc.msg.ts create mode 100644 src/codegen/cosmwasm/tokenfactory/v1beta1/tx.ts create mode 100644 src/codegen/cosmwasm/wasm/v1/proposal_legacy.ts create mode 100644 src/codegen/cosmwasm/wasm/v1beta1/proposal_legacy_v1beta1.ts create mode 100644 src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.amino.ts create mode 100644 src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.registry.ts create mode 100644 src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.rpc.msg.ts create mode 100644 src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.ts create mode 100644 src/codegen/ibc/applications/interchain_accounts/genesis/v1/genesis.ts create mode 100644 src/codegen/ibc/applications/interchain_accounts/host/v1/tx.amino.ts create mode 100644 src/codegen/ibc/applications/interchain_accounts/host/v1/tx.registry.ts create mode 100644 src/codegen/ibc/applications/interchain_accounts/host/v1/tx.rpc.msg.ts create mode 100644 src/codegen/ibc/applications/interchain_accounts/host/v1/tx.ts create mode 100644 src/codegen/ibc/applications/transfer/v1/authz.ts create mode 100644 src/codegen/ibc/core/channel/v1/upgrade.ts create mode 100644 src/codegen/ibc/lightclients/localhost/v2/localhost.ts create mode 100644 src/codegen/ibc/lightclients/solomachine/v3/solomachine.ts create mode 100644 src/codegen/ibc/lightclients/wasm/v1/genesis.ts create mode 100644 src/codegen/ibc/lightclients/wasm/v1/query.lcd.ts create mode 100644 src/codegen/ibc/lightclients/wasm/v1/query.rpc.Query.ts create mode 100644 src/codegen/ibc/lightclients/wasm/v1/query.ts create mode 100644 src/codegen/ibc/lightclients/wasm/v1/tx.amino.ts create mode 100644 src/codegen/ibc/lightclients/wasm/v1/tx.registry.ts create mode 100644 src/codegen/ibc/lightclients/wasm/v1/tx.rpc.msg.ts create mode 100644 src/codegen/ibc/lightclients/wasm/v1/tx.ts create mode 100644 src/codegen/ibc/lightclients/wasm/v1/wasm.ts diff --git a/README.md b/README.md index 45461ba..c718ce9 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ COSMOS_WASM_DIR=${COSMOS_WASM_DIR:-$(go list -f "{{ .Dir }}" -m github.com/CosmW IBC_DIR=${IBC_DIR:-$(go list -f "{{ .Dir }}" -m github.com/cosmos/ibc-go/v4)} # copy all proto files -cp -r $PROJECTDIR/proto/* $COSMOS_SDK_DIR/proto/* $COSMOS_SDK_DIR/third_party/proto/* $IBC_DIR/proto/* $COSMOS_WASM_DIR/proto/* proto +cp -r $PROJECTDIR/proto/* $COSMOS_SDK_DIR/proto/* $IBC_DIR/proto/* $COSMOS_WASM_DIR/proto/* proto telescope transpile ``` diff --git a/package.json b/package.json index 01afc67..e0f447c 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "url": "https://github.com/tubackkhoa/@oraichain/proto/issues" }, "devDependencies": { - "@cosmology/telescope": "^1.0.1", + "@cosmology/telescope": "^1.10.8", "@types/jest": "^29.5.0", "@types/node": "^20.12.7", "eslint": "8.45.0", @@ -57,10 +57,10 @@ "typescript": "^5.0.4" }, "dependencies": { - "@cosmjs/amino": "0.29.4", - "@cosmjs/proto-signing": "0.29.4", - "@cosmjs/stargate": "0.29.4", - "@cosmjs/tendermint-rpc": "^0.29.4", + "@cosmjs/amino": "^0.32.4", + "@cosmjs/proto-signing": "^0.32.4", + "@cosmjs/stargate": "^0.32.4", + "@cosmjs/tendermint-rpc": "^0.32.4", "@cosmology/lcd": "^0.13.3" } } diff --git a/proto/README.md b/proto/README.md new file mode 100644 index 0000000..ea22555 --- /dev/null +++ b/proto/README.md @@ -0,0 +1,27 @@ +# Maintaining Cosmos SDK Proto Files + +All of the Cosmos SDK proto files are defined here. This folder should +be synced regularly with buf.build/cosmos/cosmos-sdk regularly by +a maintainer by running `buf push` in this folder. + +User facing documentation should not be placed here but instead goes in +`buf.md` and in each protobuf package following the guidelines in +https://docs.buf.build/bsr/documentation. + +## SDK x Buf + +| Cosmos SDK Version | Buf Commit Version | +| ------------------ | ------------------------------------------------------------------------------------------------------------- | +| Prior v0.46.0 | [Unavailable](https://github.com/bufbuild/buf/issues/1415) | +| v0.46.x | [8cb30a2c4de74dc9bd8d260b1e75e176](https://buf.build/cosmos/cosmos-sdk/docs/8cb30a2c4de74dc9bd8d260b1e75e176) | +| v0.47.x | [v0.47.0](https://buf.build/cosmos/cosmos-sdk/docs/v0.47.0) | +| v0.50.x | [v0.50.0](https://buf.build/cosmos/cosmos-sdk/docs/v0.50.0) | +| Next | [latest on buf](https://buf.build/cosmos/cosmos-sdk/commits/main) | + +## Generate + +To get the Cosmos SDK proto given a commit, run: + +```bash +buf export buf.build/cosmos/cosmos-sdk:${commit} --output . +``` diff --git a/proto/amino/amino.proto b/proto/amino/amino.proto new file mode 100644 index 0000000..fb099b8 --- /dev/null +++ b/proto/amino/amino.proto @@ -0,0 +1,84 @@ +syntax = "proto3"; + +package amino; + +import "google/protobuf/descriptor.proto"; + +// TODO(fdymylja): once we fully migrate to protov2 the go_package needs to be updated. +// We need this right now because gogoproto codegen needs to import the extension. +option go_package = "github.com/cosmos/cosmos-sdk/types/tx/amino"; + +extend google.protobuf.MessageOptions { + // name is the string used when registering a concrete + // type into the Amino type registry, via the Amino codec's + // `RegisterConcrete()` method. This string MUST be at most 39 + // characters long, or else the message will be rejected by the + // Ledger hardware device. + string name = 11110001; + + // encoding describes the encoding format used by Amino for the given + // message. The field type is chosen to be a string for + // flexibility, but it should ideally be short and expected to be + // machine-readable, for example "base64" or "utf8_json". We + // highly recommend to use underscores for word separation instead of spaces. + // + // If left empty, then the Amino encoding is expected to be the same as the + // Protobuf one. + // + // This annotation should not be confused with the `encoding` + // one which operates on the field level. + string message_encoding = 11110002; +} + +extend google.protobuf.FieldOptions { + // encoding describes the encoding format used by Amino for + // the given field. The field type is chosen to be a string for + // flexibility, but it should ideally be short and expected to be + // machine-readable, for example "base64" or "utf8_json". We + // highly recommend to use underscores for word separation instead of spaces. + // + // If left empty, then the Amino encoding is expected to be the same as the + // Protobuf one. + // + // This annotation should not be confused with the + // `message_encoding` one which operates on the message level. + string encoding = 11110003; + + // field_name sets a different field name (i.e. key name) in + // the amino JSON object for the given field. + // + // Example: + // + // message Foo { + // string bar = 1 [(amino.field_name) = "baz"]; + // } + // + // Then the Amino encoding of Foo will be: + // `{"baz":"some value"}` + string field_name = 11110004; + + // dont_omitempty sets the field in the JSON object even if + // its value is empty, i.e. equal to the Golang zero value. To learn what + // the zero values are, see https://go.dev/ref/spec#The_zero_value. + // + // Fields default to `omitempty`, which is the default behavior when this + // annotation is unset. When set to true, then the field value in the + // JSON object will be set, i.e. not `undefined`. + // + // Example: + // + // message Foo { + // string bar = 1; + // string baz = 2 [(amino.dont_omitempty) = true]; + // } + // + // f := Foo{}; + // out := AminoJSONEncoder(&f); + // out == {"baz":""} + bool dont_omitempty = 11110005; + + // oneof_name sets the type name for the given field oneof field. This is used + // by the Amino JSON encoder to encode the type of the oneof field, and must be the same string in + // the RegisterConcrete() method usage used to register the concrete type. + string oneof_name = 11110006; +} \ No newline at end of file diff --git a/proto/buf.gen.gogo.yaml b/proto/buf.gen.gogo.yaml new file mode 100644 index 0000000..9c8ba0a --- /dev/null +++ b/proto/buf.gen.gogo.yaml @@ -0,0 +1,8 @@ +version: v1 +plugins: + - name: gocosmos + out: .. + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types + - name: grpc-gateway + out: .. + opt: logtostderr=true,allow_colon_final_segments=true diff --git a/proto/buf.gen.pulsar.yaml b/proto/buf.gen.pulsar.yaml new file mode 100644 index 0000000..41cfbe2 --- /dev/null +++ b/proto/buf.gen.pulsar.yaml @@ -0,0 +1,20 @@ +version: v1 +managed: + enabled: true + go_package_prefix: + default: cosmossdk.io/api + except: + - buf.build/googleapis/googleapis + - buf.build/cosmos/gogo-proto + - buf.build/cosmos/cosmos-proto + override: +plugins: + - name: go-pulsar + out: ../api + opt: paths=source_relative + - name: go-grpc + out: ../api + opt: paths=source_relative + - name: go-cosmos-orm + out: ../api + opt: paths=source_relative diff --git a/proto/buf.gen.swagger.yaml b/proto/buf.gen.swagger.yaml new file mode 100644 index 0000000..d0f7535 --- /dev/null +++ b/proto/buf.gen.swagger.yaml @@ -0,0 +1,5 @@ +version: v1 +plugins: + - name: swagger + out: ../tmp-swagger-gen + opt: logtostderr=true,fqn_for_swagger_name=true,simple_operation_ids=true diff --git a/proto/buf.lock b/proto/buf.lock index 3d4ba2f..a4e9f3a 100644 --- a/proto/buf.lock +++ b/proto/buf.lock @@ -5,15 +5,24 @@ deps: owner: cosmos repository: cosmos-proto commit: 1935555c206d4afb9e94615dfd0fad31 + digest: shake256:c74d91a3ac7ae07d579e90eee33abf9b29664047ac8816500cf22c081fec0d72d62c89ce0bebafc1f6fec7aa5315be72606717740ca95007248425102c365377 - remote: buf.build owner: cosmos repository: cosmos-sdk - commit: 8cb30a2c4de74dc9bd8d260b1e75e176 + commit: 5a6ab7bc14314acaa912d5e53aef1c2f + digest: shake256:02c00c73493720055f9b57553a35b5550023a3c1914123b247956288a78fb913aff70e66552777ae14d759467e119079d484af081264a5dd607a94d9fbc8116b - remote: buf.build owner: cosmos repository: gogo-proto - commit: 6652e3443c3b4504bb3bf82e73a7e409 + commit: 34d970b699f84aa382f3c29773a60836 + digest: shake256:3d3bee5229ba579e7d19ffe6e140986a228b48a8c7fe74348f308537ab95e9135210e81812489d42cd8941d33ff71f11583174ccc5972e86e6112924b6ce9f04 + - remote: buf.build + owner: cosmos + repository: ics23 + commit: 55085f7c710a45f58fa09947208eb70b + digest: shake256:9bf0bc495b5a11c88d163d39ef521bc4b00bc1374a05758c91d82821bdc61f09e8c2c51dda8452529bf80137f34d852561eacbe9550a59015d51cecb0dacb628 - remote: buf.build owner: googleapis repository: googleapis commit: 8d7204855ec14631a499bd7393ce1970 + digest: shake256:40bf4112960cad01281930beed85829910768e32e80e986791596853eccd42c0cbd9d96690b918f658020d2d427e16f8b6514e2ac7f4a10306fd32e77be44329 diff --git a/proto/buf.md b/proto/buf.md index 11a0542..807dd35 100644 --- a/proto/buf.md +++ b/proto/buf.md @@ -1,3 +1,19 @@ # Protobufs -This is the public protocol buffers API for [Wasmd](https://github.com/CosmWasm/wasmd). \ No newline at end of file +This is the public protocol buffers API for [Wasmd](https://github.com/CosmWasm/wasmd). + +## Download + +The `buf` CLI comes with an export command. Use `buf export -h` for details + +#### Examples: + +Download cosmwasm protos for a commit: +```bash +buf export buf.build/cosmwasm/wasmd:${commit} --output ./tmp +``` + +Download all project protos: +```bash +buf export . --output ./tmp +``` \ No newline at end of file diff --git a/proto/buf.yaml b/proto/buf.yaml index 9c12bd2..39d957d 100644 --- a/proto/buf.yaml +++ b/proto/buf.yaml @@ -1,14 +1,11 @@ -# Generated by "buf config migrate-v1beta1". Edit as necessary, and -# remove this comment when you're finished. -# -# This module represents the "proto" root found in -# the previous configuration. version: v1 name: buf.build/cosmwasm/wasmd deps: - - buf.build/cosmos/cosmos-proto - - buf.build/cosmos/cosmos-sdk:8cb30a2c4de74dc9bd8d260b1e75e176 #v0.46.x - - buf.build/cosmos/gogo-proto + - buf.build/cosmos/cosmos-sdk:v0.50.0 + - buf.build/cosmos/cosmos-proto:1935555c206d4afb9e94615dfd0fad31 + - buf.build/cosmos/gogo-proto:a14993478f40695898ed8a86931094b6656e8a5d + - buf.build/googleapis/googleapis:8d7204855ec14631a499bd7393ce1970 + - buf.build/cosmos/ics23:b1abd8678aab07165efd453c96796a179eb3131f breaking: use: - FILE diff --git a/proto/capability/v1/capability.proto b/proto/capability/v1/capability.proto new file mode 100644 index 0000000..31136cc --- /dev/null +++ b/proto/capability/v1/capability.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; + +package capability.v1; + +import "gogoproto/gogo.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/ibc-go/modules/capability/types"; + +// Capability defines an implementation of an object capability. The index +// provided to a Capability must be globally unique. +message Capability { + option (gogoproto.goproto_stringer) = false; + + uint64 index = 1; +} + +// Owner defines a single capability owner. An owner is defined by the name of +// capability and the module name. +message Owner { + option (gogoproto.goproto_stringer) = false; + option (gogoproto.goproto_getters) = false; + + string module = 1; + string name = 2; +} + +// CapabilityOwners defines a set of owners of a single Capability. The set of +// owners must be unique. +message CapabilityOwners { + repeated Owner owners = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} diff --git a/proto/capability/v1/genesis.proto b/proto/capability/v1/genesis.proto new file mode 100644 index 0000000..f345f6b --- /dev/null +++ b/proto/capability/v1/genesis.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; + +package capability.v1; + +import "gogoproto/gogo.proto"; +import "capability/v1/capability.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/ibc-go/modules/capability/types"; + +// GenesisOwners defines the capability owners with their corresponding index. +message GenesisOwners { + // index is the index of the capability owner. + uint64 index = 1; + + // index_owners are the owners at the given index. + CapabilityOwners index_owners = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// GenesisState defines the capability module's genesis state. +message GenesisState { + // index is the capability global index. + uint64 index = 1; + + // owners represents a map from index to owners of the capability index + // index key is string to allow amino marshalling. + repeated GenesisOwners owners = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} diff --git a/proto/confio/proofs.proto b/proto/confio/proofs.proto deleted file mode 100644 index da43503..0000000 --- a/proto/confio/proofs.proto +++ /dev/null @@ -1,234 +0,0 @@ -syntax = "proto3"; - -package ics23; -option go_package = "github.com/confio/ics23/go"; - -enum HashOp { - // NO_HASH is the default if no data passed. Note this is an illegal argument some places. - NO_HASH = 0; - SHA256 = 1; - SHA512 = 2; - KECCAK = 3; - RIPEMD160 = 4; - BITCOIN = 5; // ripemd160(sha256(x)) -} - -/** -LengthOp defines how to process the key and value of the LeafOp -to include length information. After encoding the length with the given -algorithm, the length will be prepended to the key and value bytes. -(Each one with it's own encoded length) -*/ -enum LengthOp { - // NO_PREFIX don't include any length info - NO_PREFIX = 0; - // VAR_PROTO uses protobuf (and go-amino) varint encoding of the length - VAR_PROTO = 1; - // VAR_RLP uses rlp int encoding of the length - VAR_RLP = 2; - // FIXED32_BIG uses big-endian encoding of the length as a 32 bit integer - FIXED32_BIG = 3; - // FIXED32_LITTLE uses little-endian encoding of the length as a 32 bit integer - FIXED32_LITTLE = 4; - // FIXED64_BIG uses big-endian encoding of the length as a 64 bit integer - FIXED64_BIG = 5; - // FIXED64_LITTLE uses little-endian encoding of the length as a 64 bit integer - FIXED64_LITTLE = 6; - // REQUIRE_32_BYTES is like NONE, but will fail if the input is not exactly 32 bytes (sha256 output) - REQUIRE_32_BYTES = 7; - // REQUIRE_64_BYTES is like NONE, but will fail if the input is not exactly 64 bytes (sha512 output) - REQUIRE_64_BYTES = 8; -} - -/** -ExistenceProof takes a key and a value and a set of steps to perform on it. -The result of peforming all these steps will provide a "root hash", which can -be compared to the value in a header. - -Since it is computationally infeasible to produce a hash collission for any of the used -cryptographic hash functions, if someone can provide a series of operations to transform -a given key and value into a root hash that matches some trusted root, these key and values -must be in the referenced merkle tree. - -The only possible issue is maliablity in LeafOp, such as providing extra prefix data, -which should be controlled by a spec. Eg. with lengthOp as NONE, - prefix = FOO, key = BAR, value = CHOICE -and - prefix = F, key = OOBAR, value = CHOICE -would produce the same value. - -With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field -in the ProofSpec is valuable to prevent this mutability. And why all trees should -length-prefix the data before hashing it. -*/ -message ExistenceProof { - bytes key = 1; - bytes value = 2; - LeafOp leaf = 3; - repeated InnerOp path = 4; -} - -/* -NonExistenceProof takes a proof of two neighbors, one left of the desired key, -one right of the desired key. If both proofs are valid AND they are neighbors, -then there is no valid proof for the given key. -*/ -message NonExistenceProof { - bytes key = 1; // TODO: remove this as unnecessary??? we prove a range - ExistenceProof left = 2; - ExistenceProof right = 3; -} - -/* -CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages -*/ -message CommitmentProof { - oneof proof { - ExistenceProof exist = 1; - NonExistenceProof nonexist = 2; - BatchProof batch = 3; - CompressedBatchProof compressed = 4; - } -} - -/** -LeafOp represents the raw key-value data we wish to prove, and -must be flexible to represent the internal transformation from -the original key-value pairs into the basis hash, for many existing -merkle trees. - -key and value are passed in. So that the signature of this operation is: - leafOp(key, value) -> output - -To process this, first prehash the keys and values if needed (ANY means no hash in this case): - hkey = prehashKey(key) - hvalue = prehashValue(value) - -Then combine the bytes, and hash it - output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) -*/ -message LeafOp { - HashOp hash = 1; - HashOp prehash_key = 2; - HashOp prehash_value = 3; - LengthOp length = 4; - // prefix is a fixed bytes that may optionally be included at the beginning to differentiate - // a leaf node from an inner node. - bytes prefix = 5; -} - -/** -InnerOp represents a merkle-proof step that is not a leaf. -It represents concatenating two children and hashing them to provide the next result. - -The result of the previous step is passed in, so the signature of this op is: - innerOp(child) -> output - -The result of applying InnerOp should be: - output = op.hash(op.prefix || child || op.suffix) - - where the || operator is concatenation of binary data, -and child is the result of hashing all the tree below this step. - -Any special data, like prepending child with the length, or prepending the entire operation with -some value to differentiate from leaf nodes, should be included in prefix and suffix. -If either of prefix or suffix is empty, we just treat it as an empty string -*/ -message InnerOp { - HashOp hash = 1; - bytes prefix = 2; - bytes suffix = 3; -} - - -/** -ProofSpec defines what the expected parameters are for a given proof type. -This can be stored in the client and used to validate any incoming proofs. - - verify(ProofSpec, Proof) -> Proof | Error - -As demonstrated in tests, if we don't fix the algorithm used to calculate the -LeafHash for a given tree, there are many possible key-value pairs that can -generate a given hash (by interpretting the preimage differently). -We need this for proper security, requires client knows a priori what -tree format server uses. But not in code, rather a configuration object. -*/ -message ProofSpec { - // any field in the ExistenceProof must be the same as in this spec. - // except Prefix, which is just the first bytes of prefix (spec can be longer) - LeafOp leaf_spec = 1; - InnerSpec inner_spec = 2; - // max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) - int32 max_depth = 3; - // min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) - int32 min_depth = 4; -} - -/* -InnerSpec contains all store-specific structure info to determine if two proofs from a -given store are neighbors. - -This enables: - - isLeftMost(spec: InnerSpec, op: InnerOp) - isRightMost(spec: InnerSpec, op: InnerOp) - isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp) -*/ -message InnerSpec { - // Child order is the ordering of the children node, must count from 0 - // iavl tree is [0, 1] (left then right) - // merk is [0, 2, 1] (left, right, here) - repeated int32 child_order = 1; - int32 child_size = 2; - int32 min_prefix_length = 3; - int32 max_prefix_length = 4; - // empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0) - bytes empty_child = 5; - // hash is the algorithm that must be used for each InnerOp - HashOp hash = 6; -} - -/* -BatchProof is a group of multiple proof types than can be compressed -*/ -message BatchProof { - repeated BatchEntry entries = 1; -} - -// Use BatchEntry not CommitmentProof, to avoid recursion -message BatchEntry { - oneof proof { - ExistenceProof exist = 1; - NonExistenceProof nonexist = 2; - } -} - - -/****** all items here are compressed forms *******/ - -message CompressedBatchProof { - repeated CompressedBatchEntry entries = 1; - repeated InnerOp lookup_inners = 2; -} - -// Use BatchEntry not CommitmentProof, to avoid recursion -message CompressedBatchEntry { - oneof proof { - CompressedExistenceProof exist = 1; - CompressedNonExistenceProof nonexist = 2; - } -} - -message CompressedExistenceProof { - bytes key = 1; - bytes value = 2; - LeafOp leaf = 3; - // these are indexes into the lookup_inners table in CompressedBatchProof - repeated int32 path = 4; -} - -message CompressedNonExistenceProof { - bytes key = 1; // TODO: remove this as unnecessary??? we prove a range - CompressedExistenceProof left = 2; - CompressedExistenceProof right = 3; -} diff --git a/proto/cosmos/app/runtime/v1alpha1/module.proto b/proto/cosmos/app/runtime/v1alpha1/module.proto new file mode 100644 index 0000000..c026121 --- /dev/null +++ b/proto/cosmos/app/runtime/v1alpha1/module.proto @@ -0,0 +1,65 @@ +syntax = "proto3"; + +package cosmos.app.runtime.v1alpha1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object for the runtime module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/runtime" + use_package: {name: "cosmos.app.v1alpha1"} + }; + + // app_name is the name of the app. + string app_name = 1; + + // begin_blockers specifies the module names of begin blockers + // to call in the order in which they should be called. If this is left empty + // no begin blocker will be registered. + repeated string begin_blockers = 2; + + // end_blockers specifies the module names of the end blockers + // to call in the order in which they should be called. If this is left empty + // no end blocker will be registered. + repeated string end_blockers = 3; + + // init_genesis specifies the module names of init genesis functions + // to call in the order in which they should be called. If this is left empty + // no init genesis function will be registered. + repeated string init_genesis = 4; + + // export_genesis specifies the order in which to export module genesis data. + // If this is left empty, the init_genesis order will be used for export genesis + // if it is specified. + repeated string export_genesis = 5; + + // override_store_keys is an optional list of overrides for the module store keys + // to be used in keeper construction. + repeated StoreKeyConfig override_store_keys = 6; + + // order_migrations defines the order in which module migrations are performed. + // If this is left empty, it uses the default migration order. + // https://pkg.go.dev/github.com/cosmos/cosmos-sdk@v0.47.0-alpha2/types/module#DefaultMigrationsOrder + repeated string order_migrations = 7; + + // precommiters specifies the module names of the precommiters + // to call in the order in which they should be called. If this is left empty + // no precommit function will be registered. + repeated string precommiters = 8; + + // prepare_check_staters specifies the module names of the prepare_check_staters + // to call in the order in which they should be called. If this is left empty + // no preparecheckstate function will be registered. + repeated string prepare_check_staters = 9; +} + +// StoreKeyConfig may be supplied to override the default module store key, which +// is the module name. +message StoreKeyConfig { + // name of the module to override the store key of + string module_name = 1; + + // the kv store key to use instead of the module name. + string kv_store_key = 2; +} diff --git a/proto/cosmos/app/v1alpha1/config.proto b/proto/cosmos/app/v1alpha1/config.proto new file mode 100644 index 0000000..ee3e706 --- /dev/null +++ b/proto/cosmos/app/v1alpha1/config.proto @@ -0,0 +1,55 @@ +syntax = "proto3"; + +package cosmos.app.v1alpha1; + +import "google/protobuf/any.proto"; + +// Config represents the configuration for a Cosmos SDK ABCI app. +// It is intended that all state machine logic including the version of +// baseapp and tx handlers (and possibly even Tendermint) that an app needs +// can be described in a config object. For compatibility, the framework should +// allow a mixture of declarative and imperative app wiring, however, apps +// that strive for the maximum ease of maintainability should be able to describe +// their state machine with a config object alone. +message Config { + // modules are the module configurations for the app. + repeated ModuleConfig modules = 1; + + // golang_bindings specifies explicit interface to implementation type bindings which + // depinject uses to resolve interface inputs to provider functions. The scope of this + // field's configuration is global (not module specific). + repeated GolangBinding golang_bindings = 2; +} + +// ModuleConfig is a module configuration for an app. +message ModuleConfig { + // name is the unique name of the module within the app. It should be a name + // that persists between different versions of a module so that modules + // can be smoothly upgraded to new versions. + // + // For example, for the module cosmos.bank.module.v1.Module, we may chose + // to simply name the module "bank" in the app. When we upgrade to + // cosmos.bank.module.v2.Module, the app-specific name "bank" stays the same + // and the framework knows that the v2 module should receive all the same state + // that the v1 module had. Note: modules should provide info on which versions + // they can migrate from in the ModuleDescriptor.can_migration_from field. + string name = 1; + + // config is the config object for the module. Module config messages should + // define a ModuleDescriptor using the cosmos.app.v1alpha1.is_module extension. + google.protobuf.Any config = 2; + + // golang_bindings specifies explicit interface to implementation type bindings which + // depinject uses to resolve interface inputs to provider functions. The scope of this + // field's configuration is module specific. + repeated GolangBinding golang_bindings = 3; +} + +// GolangBinding is an explicit interface type to implementing type binding for dependency injection. +message GolangBinding { + // interface_type is the interface type which will be bound to a specific implementation type + string interface_type = 1; + + // implementation is the implementing type which will be supplied when an input of type interface is requested + string implementation = 2; +} \ No newline at end of file diff --git a/proto/cosmos/app/v1alpha1/module.proto b/proto/cosmos/app/v1alpha1/module.proto new file mode 100644 index 0000000..e541378 --- /dev/null +++ b/proto/cosmos/app/v1alpha1/module.proto @@ -0,0 +1,91 @@ +syntax = "proto3"; + +package cosmos.app.v1alpha1; + +import "google/protobuf/descriptor.proto"; + +extend google.protobuf.MessageOptions { + // module indicates that this proto type is a config object for an app module + // and optionally provides other descriptive information about the module. + // It is recommended that a new module config object and go module is versioned + // for every state machine breaking version of a module. The recommended + // pattern for doing this is to put module config objects in a separate proto + // package from the API they expose. Ex: the cosmos.group.v1 API would be + // exposed by module configs cosmos.group.module.v1, cosmos.group.module.v2, etc. + ModuleDescriptor module = 57193479; +} + +// ModuleDescriptor describes an app module. +message ModuleDescriptor { + // go_import names the package that should be imported by an app to load the + // module in the runtime module registry. It is required to make debugging + // of configuration errors easier for users. + string go_import = 1; + + // use_package refers to a protobuf package that this module + // uses and exposes to the world. In an app, only one module should "use" + // or own a single protobuf package. It is assumed that the module uses + // all of the .proto files in a single package. + repeated PackageReference use_package = 2; + + // can_migrate_from defines which module versions this module can migrate + // state from. The framework will check that one module version is able to + // migrate from a previous module version before attempting to update its + // config. It is assumed that modules can transitively migrate from earlier + // versions. For instance if v3 declares it can migrate from v2, and v2 + // declares it can migrate from v1, the framework knows how to migrate + // from v1 to v3, assuming all 3 module versions are registered at runtime. + repeated MigrateFromInfo can_migrate_from = 3; +} + +// PackageReference is a reference to a protobuf package used by a module. +message PackageReference { + // name is the fully-qualified name of the package. + string name = 1; + + // revision is the optional revision of the package that is being used. + // Protobuf packages used in Cosmos should generally have a major version + // as the last part of the package name, ex. foo.bar.baz.v1. + // The revision of a package can be thought of as the minor version of a + // package which has additional backwards compatible definitions that weren't + // present in a previous version. + // + // A package should indicate its revision with a source code comment + // above the package declaration in one of its files containing the + // text "Revision N" where N is an integer revision. All packages start + // at revision 0 the first time they are released in a module. + // + // When a new version of a module is released and items are added to existing + // .proto files, these definitions should contain comments of the form + // "Since: Revision N" where N is an integer revision. + // + // When the module runtime starts up, it will check the pinned proto + // image and panic if there are runtime protobuf definitions that are not + // in the pinned descriptor which do not have + // a "Since Revision N" comment or have a "Since Revision N" comment where + // N is <= to the revision specified here. This indicates that the protobuf + // files have been updated, but the pinned file descriptor hasn't. + // + // If there are items in the pinned file descriptor with a revision + // greater than the value indicated here, this will also cause a panic + // as it may mean that the pinned descriptor for a legacy module has been + // improperly updated or that there is some other versioning discrepancy. + // Runtime protobuf definitions will also be checked for compatibility + // with pinned file descriptors to make sure there are no incompatible changes. + // + // This behavior ensures that: + // * pinned proto images are up-to-date + // * protobuf files are carefully annotated with revision comments which + // are important good client UX + // * protobuf files are changed in backwards and forwards compatible ways + uint32 revision = 2; +} + +// MigrateFromInfo is information on a module version that a newer module +// can migrate from. +message MigrateFromInfo { + + // module is the fully-qualified protobuf name of the module config object + // for the previous module version, ex: "cosmos.group.module.v1.Module". + string module = 1; +} diff --git a/proto/cosmos/app/v1alpha1/query.proto b/proto/cosmos/app/v1alpha1/query.proto new file mode 100644 index 0000000..efec9c8 --- /dev/null +++ b/proto/cosmos/app/v1alpha1/query.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; + +package cosmos.app.v1alpha1; + +import "cosmos/app/v1alpha1/config.proto"; + +// Query is the app module query service. +service Query { + + // Config returns the current app config. + rpc Config(QueryConfigRequest) returns (QueryConfigResponse) {} +} + +// QueryConfigRequest is the Query/Config request type. +message QueryConfigRequest {} + +// QueryConfigRequest is the Query/Config response type. +message QueryConfigResponse { + + // config is the current app config. + Config config = 1; +} diff --git a/proto/cosmos/auth/v1beta1/auth.proto b/proto/cosmos/auth/v1beta1/auth.proto index 72e1d9e..ebc18b6 100644 --- a/proto/cosmos/auth/v1beta1/auth.proto +++ b/proto/cosmos/auth/v1beta1/auth.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package cosmos.auth.v1beta1; +import "amino/amino.proto"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; @@ -11,40 +12,52 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; // for basic account functionality. Any custom account type should extend this // type for additional functionality (e.g. vesting). message BaseAccount { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.equal) = false; + option (amino.name) = "cosmos-sdk/BaseAccount"; + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = false; - option (cosmos_proto.implements_interface) = "AccountI"; + option (cosmos_proto.implements_interface) = "cosmos.auth.v1beta1.AccountI"; - string address = 1; - google.protobuf.Any pub_key = 2 - [(gogoproto.jsontag) = "public_key,omitempty", (gogoproto.moretags) = "yaml:\"public_key\""]; - uint64 account_number = 3 [(gogoproto.moretags) = "yaml:\"account_number\""]; + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + google.protobuf.Any pub_key = 2 [(gogoproto.jsontag) = "public_key,omitempty", (amino.field_name) = "public_key"]; + + uint64 account_number = 3; uint64 sequence = 4; } // ModuleAccount defines an account for modules that holds coins on a pool. message ModuleAccount { + option (amino.name) = "cosmos-sdk/ModuleAccount"; + option (amino.message_encoding) = "module_account"; option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - option (cosmos_proto.implements_interface) = "ModuleAccountI"; + option (cosmos_proto.implements_interface) = "cosmos.auth.v1beta1.ModuleAccountI"; - BaseAccount base_account = 1 [(gogoproto.embed) = true, (gogoproto.moretags) = "yaml:\"base_account\""]; + BaseAccount base_account = 1 [(gogoproto.embed) = true]; string name = 2; repeated string permissions = 3; } +// ModuleCredential represents a unclaimable pubkey for base accounts controlled by modules. +// +// Since: cosmos-sdk 0.47 +message ModuleCredential { + option (amino.name) = "cosmos-sdk/GroupAccountCredential"; + // module_name is the name of the module used for address derivation (passed into address.Module). + string module_name = 1; + // derivation_keys is for deriving a module account address (passed into address.Module) + // adding more keys creates sub-account addresses (passed into address.Derive) + repeated bytes derivation_keys = 2; +} + // Params defines the parameters for the auth module. message Params { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - uint64 max_memo_characters = 1 [(gogoproto.moretags) = "yaml:\"max_memo_characters\""]; - uint64 tx_sig_limit = 2 [(gogoproto.moretags) = "yaml:\"tx_sig_limit\""]; - uint64 tx_size_cost_per_byte = 3 [(gogoproto.moretags) = "yaml:\"tx_size_cost_per_byte\""]; - uint64 sig_verify_cost_ed25519 = 4 - [(gogoproto.customname) = "SigVerifyCostED25519", (gogoproto.moretags) = "yaml:\"sig_verify_cost_ed25519\""]; - uint64 sig_verify_cost_secp256k1 = 5 - [(gogoproto.customname) = "SigVerifyCostSecp256k1", (gogoproto.moretags) = "yaml:\"sig_verify_cost_secp256k1\""]; + option (amino.name) = "cosmos-sdk/x/auth/Params"; + option (gogoproto.equal) = true; + + uint64 max_memo_characters = 1; + uint64 tx_sig_limit = 2; + uint64 tx_size_cost_per_byte = 3; + uint64 sig_verify_cost_ed25519 = 4 [(gogoproto.customname) = "SigVerifyCostED25519"]; + uint64 sig_verify_cost_secp256k1 = 5 [(gogoproto.customname) = "SigVerifyCostSecp256k1"]; } diff --git a/proto/cosmos/auth/v1beta1/genesis.proto b/proto/cosmos/auth/v1beta1/genesis.proto index c88b94e..d1aa66e 100644 --- a/proto/cosmos/auth/v1beta1/genesis.proto +++ b/proto/cosmos/auth/v1beta1/genesis.proto @@ -4,13 +4,14 @@ package cosmos.auth.v1beta1; import "google/protobuf/any.proto"; import "gogoproto/gogo.proto"; import "cosmos/auth/v1beta1/auth.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; // GenesisState defines the auth module's genesis state. message GenesisState { - // params defines all the paramaters of the module. - Params params = 1 [(gogoproto.nullable) = false]; + // params defines all the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // accounts are the accounts present at genesis. repeated google.protobuf.Any accounts = 2; diff --git a/proto/cosmos/auth/v1beta1/query.proto b/proto/cosmos/auth/v1beta1/query.proto index 79799a4..804f2ff 100644 --- a/proto/cosmos/auth/v1beta1/query.proto +++ b/proto/cosmos/auth/v1beta1/query.proto @@ -7,31 +7,84 @@ import "google/protobuf/any.proto"; import "google/api/annotations.proto"; import "cosmos/auth/v1beta1/auth.proto"; import "cosmos_proto/cosmos.proto"; +import "cosmos/query/v1/query.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; // Query defines the gRPC querier service. service Query { - // Accounts returns all the existing accounts + // Accounts returns all the existing accounts. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. // // Since: cosmos-sdk 0.43 rpc Accounts(QueryAccountsRequest) returns (QueryAccountsResponse) { - option (google.api.http).get = "/cosmos/auth/v1beta1/accounts"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/auth/v1beta1/accounts"; } // Account returns account details based on address. rpc Account(QueryAccountRequest) returns (QueryAccountResponse) { - option (google.api.http).get = "/cosmos/auth/v1beta1/accounts/{address}"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/auth/v1beta1/accounts/{address}"; + } + + // AccountAddressByID returns account address based on account number. + // + // Since: cosmos-sdk 0.46.2 + rpc AccountAddressByID(QueryAccountAddressByIDRequest) returns (QueryAccountAddressByIDResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/auth/v1beta1/address_by_id/{id}"; } // Params queries all parameters. rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/auth/v1beta1/params"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/auth/v1beta1/params"; + } + + // ModuleAccounts returns all the existing module accounts. + // + // Since: cosmos-sdk 0.46 + rpc ModuleAccounts(QueryModuleAccountsRequest) returns (QueryModuleAccountsResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/auth/v1beta1/module_accounts"; } // ModuleAccountByName returns the module account info by module name rpc ModuleAccountByName(QueryModuleAccountByNameRequest) returns (QueryModuleAccountByNameResponse) { - option (google.api.http).get = "/cosmos/auth/v1beta1/module_accounts/{name}"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/auth/v1beta1/module_accounts/{name}"; + } + + // Bech32Prefix queries bech32Prefix + // + // Since: cosmos-sdk 0.46 + rpc Bech32Prefix(Bech32PrefixRequest) returns (Bech32PrefixResponse) { + option (google.api.http).get = "/cosmos/auth/v1beta1/bech32"; + } + + // AddressBytesToString converts Account Address bytes to string + // + // Since: cosmos-sdk 0.46 + rpc AddressBytesToString(AddressBytesToStringRequest) returns (AddressBytesToStringResponse) { + option (google.api.http).get = "/cosmos/auth/v1beta1/bech32/{address_bytes}"; + } + + // AddressStringToBytes converts Address string to bytes + // + // Since: cosmos-sdk 0.46 + rpc AddressStringToBytes(AddressStringToBytesRequest) returns (AddressStringToBytesResponse) { + option (google.api.http).get = "/cosmos/auth/v1beta1/bech32/{address_string}"; + } + + // AccountInfo queries account info which is common to all account types. + // + // Since: cosmos-sdk 0.47 + rpc AccountInfo(QueryAccountInfoRequest) returns (QueryAccountInfoResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/auth/v1beta1/account_info/{address}"; } } @@ -48,7 +101,7 @@ message QueryAccountsRequest { // Since: cosmos-sdk 0.43 message QueryAccountsResponse { // accounts are the existing accounts - repeated google.protobuf.Any accounts = 1 [(cosmos_proto.accepts_interface) = "AccountI"]; + repeated google.protobuf.Any accounts = 1 [(cosmos_proto.accepts_interface) = "cosmos.auth.v1beta1.AccountI"]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -60,13 +113,13 @@ message QueryAccountRequest { option (gogoproto.goproto_getters) = false; // address defines the address to query for. - string address = 1; + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } // QueryAccountResponse is the response type for the Query/Account RPC method. message QueryAccountResponse { // account defines the account of the corresponding address. - google.protobuf.Any account = 1 [(cosmos_proto.accepts_interface) = "AccountI"]; + google.protobuf.Any account = 1 [(cosmos_proto.accepts_interface) = "cosmos.auth.v1beta1.AccountI"]; } // QueryParamsRequest is the request type for the Query/Params RPC method. @@ -78,6 +131,18 @@ message QueryParamsResponse { Params params = 1 [(gogoproto.nullable) = false]; } +// QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method. +// +// Since: cosmos-sdk 0.46 +message QueryModuleAccountsRequest {} + +// QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. +// +// Since: cosmos-sdk 0.46 +message QueryModuleAccountsResponse { + repeated google.protobuf.Any accounts = 1 [(cosmos_proto.accepts_interface) = "cosmos.auth.v1beta1.ModuleAccountI"]; +} + // QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method. message QueryModuleAccountByNameRequest { string name = 1; @@ -85,5 +150,87 @@ message QueryModuleAccountByNameRequest { // QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method. message QueryModuleAccountByNameResponse { - google.protobuf.Any account = 1 [(cosmos_proto.accepts_interface) = "ModuleAccountI"]; -} \ No newline at end of file + google.protobuf.Any account = 1 [(cosmos_proto.accepts_interface) = "cosmos.auth.v1beta1.ModuleAccountI"]; +} + +// Bech32PrefixRequest is the request type for Bech32Prefix rpc method. +// +// Since: cosmos-sdk 0.46 +message Bech32PrefixRequest {} + +// Bech32PrefixResponse is the response type for Bech32Prefix rpc method. +// +// Since: cosmos-sdk 0.46 +message Bech32PrefixResponse { + string bech32_prefix = 1; +} + +// AddressBytesToStringRequest is the request type for AddressString rpc method. +// +// Since: cosmos-sdk 0.46 +message AddressBytesToStringRequest { + bytes address_bytes = 1; +} + +// AddressBytesToStringResponse is the response type for AddressString rpc method. +// +// Since: cosmos-sdk 0.46 +message AddressBytesToStringResponse { + string address_string = 1; +} + +// AddressStringToBytesRequest is the request type for AccountBytes rpc method. +// +// Since: cosmos-sdk 0.46 +message AddressStringToBytesRequest { + string address_string = 1; +} + +// AddressStringToBytesResponse is the response type for AddressBytes rpc method. +// +// Since: cosmos-sdk 0.46 +message AddressStringToBytesResponse { + bytes address_bytes = 1; +} + +// QueryAccountAddressByIDRequest is the request type for AccountAddressByID rpc method +// +// Since: cosmos-sdk 0.46.2 +message QueryAccountAddressByIDRequest { + // Deprecated, use account_id instead + // + // id is the account number of the address to be queried. This field + // should have been an uint64 (like all account numbers), and will be + // updated to uint64 in a future version of the auth query. + int64 id = 1 [deprecated = true]; + + // account_id is the account number of the address to be queried. + // + // Since: cosmos-sdk 0.47 + uint64 account_id = 2; +} + +// QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method +// +// Since: cosmos-sdk 0.46.2 +message QueryAccountAddressByIDResponse { + string account_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryAccountInfoRequest is the Query/AccountInfo request type. +// +// Since: cosmos-sdk 0.47 +message QueryAccountInfoRequest { + + // address is the account address string. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryAccountInfoResponse is the Query/AccountInfo response type. +// +// Since: cosmos-sdk 0.47 +message QueryAccountInfoResponse { + + // info is the account info which is represented by BaseAccount. + BaseAccount info = 1; +} diff --git a/proto/cosmos/auth/v1beta1/tx.proto b/proto/cosmos/auth/v1beta1/tx.proto new file mode 100644 index 0000000..1edee03 --- /dev/null +++ b/proto/cosmos/auth/v1beta1/tx.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; +package cosmos.auth.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; +import "cosmos/auth/v1beta1/auth.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; + +// Msg defines the x/auth Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // UpdateParams defines a (governance) operation for updating the x/auth module + // parameters. The authority defaults to the x/gov module account. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/x/auth/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/auth parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} diff --git a/proto/cosmos/authz/v1beta1/authz.proto b/proto/cosmos/authz/v1beta1/authz.proto index 05b1fee..3fee736 100644 --- a/proto/cosmos/authz/v1beta1/authz.proto +++ b/proto/cosmos/authz/v1beta1/authz.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package cosmos.authz.v1beta1; +import "amino/amino.proto"; import "cosmos_proto/cosmos.proto"; import "google/protobuf/timestamp.proto"; import "gogoproto/gogo.proto"; @@ -13,7 +14,8 @@ option (gogoproto.goproto_getters_all) = false; // GenericAuthorization gives the grantee unrestricted permissions to execute // the provided method on behalf of the granter's account. message GenericAuthorization { - option (cosmos_proto.implements_interface) = "Authorization"; + option (amino.name) = "cosmos-sdk/GenericAuthorization"; + option (cosmos_proto.implements_interface) = "cosmos.authz.v1beta1.Authorization"; // Msg, identified by it's type URL, to grant unrestricted permissions to execute string msg = 1; @@ -22,18 +24,25 @@ message GenericAuthorization { // Grant gives permissions to execute // the provide method with expiration time. message Grant { - google.protobuf.Any authorization = 1 [(cosmos_proto.accepts_interface) = "Authorization"]; - google.protobuf.Timestamp expiration = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Any authorization = 1 [(cosmos_proto.accepts_interface) = "cosmos.authz.v1beta1.Authorization"]; + // time when the grant will expire and will be pruned. If null, then the grant + // doesn't have a time expiration (other conditions in `authorization` + // may apply to invalidate the grant) + google.protobuf.Timestamp expiration = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = true]; } // GrantAuthorization extends a grant with both the addresses of the grantee and granter. // It is used in genesis.proto and query.proto -// -// Since: cosmos-sdk 0.45.2 message GrantAuthorization { - string granter = 1; - string grantee = 2; + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - google.protobuf.Any authorization = 3 [(cosmos_proto.accepts_interface) = "Authorization"]; - google.protobuf.Timestamp expiration = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Any authorization = 3 [(cosmos_proto.accepts_interface) = "cosmos.authz.v1beta1.Authorization"]; + google.protobuf.Timestamp expiration = 4 [(gogoproto.stdtime) = true]; +} + +// GrantQueueItem contains the list of TypeURL of a sdk.Msg. +message GrantQueueItem { + // msg_type_urls contains the list of TypeURL of a sdk.Msg. + repeated string msg_type_urls = 1; } diff --git a/proto/cosmos/authz/v1beta1/event.proto b/proto/cosmos/authz/v1beta1/event.proto index 7a3cf7c..0476649 100644 --- a/proto/cosmos/authz/v1beta1/event.proto +++ b/proto/cosmos/authz/v1beta1/event.proto @@ -2,6 +2,8 @@ syntax = "proto3"; package cosmos.authz.v1beta1; +import "cosmos_proto/cosmos.proto"; + option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; // EventGrant is emitted on Msg/Grant @@ -9,9 +11,9 @@ message EventGrant { // Msg type URL for which an autorization is granted string msg_type_url = 2; // Granter account address - string granter = 3; + string granter = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // Grantee account address - string grantee = 4; + string grantee = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } // EventRevoke is emitted on Msg/Revoke @@ -19,7 +21,7 @@ message EventRevoke { // Msg type URL for which an autorization is revoked string msg_type_url = 2; // Granter account address - string granter = 3; + string granter = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // Grantee account address - string grantee = 4; + string grantee = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } diff --git a/proto/cosmos/authz/v1beta1/genesis.proto b/proto/cosmos/authz/v1beta1/genesis.proto index 310f626..9fefff4 100644 --- a/proto/cosmos/authz/v1beta1/genesis.proto +++ b/proto/cosmos/authz/v1beta1/genesis.proto @@ -4,10 +4,11 @@ package cosmos.authz.v1beta1; import "gogoproto/gogo.proto"; import "cosmos/authz/v1beta1/authz.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; // GenesisState defines the authz module's genesis state. message GenesisState { - repeated GrantAuthorization authorization = 1 [(gogoproto.nullable) = false]; + repeated GrantAuthorization authorization = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } diff --git a/proto/cosmos/authz/v1beta1/query.proto b/proto/cosmos/authz/v1beta1/query.proto index f668309..fcd5681 100644 --- a/proto/cosmos/authz/v1beta1/query.proto +++ b/proto/cosmos/authz/v1beta1/query.proto @@ -5,6 +5,7 @@ package cosmos.authz.v1beta1; import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; import "cosmos/authz/v1beta1/authz.proto"; +import "cosmos_proto/cosmos.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; @@ -17,14 +18,14 @@ service Query { // GranterGrants returns list of `GrantAuthorization`, granted by granter. // - // Since: cosmos-sdk 0.45.2 + // Since: cosmos-sdk 0.46 rpc GranterGrants(QueryGranterGrantsRequest) returns (QueryGranterGrantsResponse) { option (google.api.http).get = "/cosmos/authz/v1beta1/grants/granter/{granter}"; } // GranteeGrants returns a list of `GrantAuthorization` by grantee. // - // Since: cosmos-sdk 0.45.2 + // Since: cosmos-sdk 0.46 rpc GranteeGrants(QueryGranteeGrantsRequest) returns (QueryGranteeGrantsResponse) { option (google.api.http).get = "/cosmos/authz/v1beta1/grants/grantee/{grantee}"; } @@ -32,8 +33,8 @@ service Query { // QueryGrantsRequest is the request type for the Query/Grants RPC method. message QueryGrantsRequest { - string granter = 1; - string grantee = 2; + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // Optional, msg_type_url, when set, will query only grants matching given msg type. string msg_type_url = 3; // pagination defines an pagination for the request. @@ -50,7 +51,7 @@ message QueryGrantsResponse { // QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. message QueryGranterGrantsRequest { - string granter = 1; + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // pagination defines an pagination for the request. cosmos.base.query.v1beta1.PageRequest pagination = 2; @@ -64,9 +65,9 @@ message QueryGranterGrantsResponse { cosmos.base.query.v1beta1.PageResponse pagination = 2; } -// QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. +// QueryGranteeGrantsRequest is the request type for the Query/GranteeGrants RPC method. message QueryGranteeGrantsRequest { - string grantee = 1; + string grantee = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // pagination defines an pagination for the request. cosmos.base.query.v1beta1.PageRequest pagination = 2; diff --git a/proto/cosmos/authz/v1beta1/tx.proto b/proto/cosmos/authz/v1beta1/tx.proto index 457f0d6..a1abff0 100644 --- a/proto/cosmos/authz/v1beta1/tx.proto +++ b/proto/cosmos/authz/v1beta1/tx.proto @@ -4,16 +4,18 @@ package cosmos.authz.v1beta1; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; -import "google/protobuf/timestamp.proto"; import "google/protobuf/any.proto"; -import "cosmos/base/abci/v1beta1/abci.proto"; import "cosmos/authz/v1beta1/authz.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; option (gogoproto.goproto_getters_all) = false; // Msg defines the authz Msg service. service Msg { + option (cosmos.msg.v1.service) = true; + // Grant grants the provided authorization to the grantee on the granter's // account with the provided expiration time. If there is already a grant // for the given (granter, grantee, Authorization) triple, then the grant @@ -33,36 +35,45 @@ service Msg { // MsgGrant is a request type for Grant method. It declares authorization to the grantee // on behalf of the granter with the provided expiration time. message MsgGrant { - string granter = 1; - string grantee = 2; + option (cosmos.msg.v1.signer) = "granter"; + option (amino.name) = "cosmos-sdk/MsgGrant"; - cosmos.authz.v1beta1.Grant grant = 3 [(gogoproto.nullable) = false]; -} + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; -// MsgExecResponse defines the Msg/MsgExecResponse response type. -message MsgExecResponse { - repeated bytes results = 1; + cosmos.authz.v1beta1.Grant grant = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } +// MsgGrantResponse defines the Msg/MsgGrant response type. +message MsgGrantResponse {} + // MsgExec attempts to execute the provided messages using // authorizations granted to the grantee. Each message should have only // one signer corresponding to the granter of the authorization. message MsgExec { - string grantee = 1; - // Authorization Msg requests to execute. Each msg must implement Authorization interface + option (cosmos.msg.v1.signer) = "grantee"; + option (amino.name) = "cosmos-sdk/MsgExec"; + + string grantee = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Execute Msg. // The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) // triple and validate it. - repeated google.protobuf.Any msgs = 2 [(cosmos_proto.accepts_interface) = "sdk.Msg, authz.Authorization"]; + repeated google.protobuf.Any msgs = 2 [(cosmos_proto.accepts_interface) = "cosmos.base.v1beta1.Msg"]; } -// MsgGrantResponse defines the Msg/MsgGrant response type. -message MsgGrantResponse {} +// MsgExecResponse defines the Msg/MsgExecResponse response type. +message MsgExecResponse { + repeated bytes results = 1; +} // MsgRevoke revokes any authorization with the provided sdk.Msg type on the // granter's account with that has been granted to the grantee. message MsgRevoke { - string granter = 1; - string grantee = 2; + option (cosmos.msg.v1.signer) = "granter"; + option (amino.name) = "cosmos-sdk/MsgRevoke"; + + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; string msg_type_url = 3; } diff --git a/proto/cosmos/autocli/v1/options.proto b/proto/cosmos/autocli/v1/options.proto new file mode 100644 index 0000000..b023490 --- /dev/null +++ b/proto/cosmos/autocli/v1/options.proto @@ -0,0 +1,124 @@ +syntax = "proto3"; + +package cosmos.autocli.v1; + +option go_package = "cosmossdk.io/api/cosmos/base/cli/v1;cliv1"; + +// ModuleOptions describes the CLI options for a Cosmos SDK module. +message ModuleOptions { + // tx describes the tx commands for the module. + ServiceCommandDescriptor tx = 1; + + // query describes the queries commands for the module. + ServiceCommandDescriptor query = 2; +} + +// ServiceCommandDescriptor describes a CLI command based on a protobuf service. +message ServiceCommandDescriptor { + + // service is the fully qualified name of the protobuf service to build + // the command from. It can be left empty if sub_commands are used instead + // which may be the case if a module provides multiple tx and/or query services. + string service = 1; + + // rpc_command_options are options for commands generated from rpc methods. + // If no options are specified for a given rpc method on the service, a + // command will be generated for that method with the default options. + repeated RpcCommandOptions rpc_command_options = 2; + + // sub_commands is a map of optional sub-commands for this command based on + // different protobuf services. The map key is used as the name of the + // sub-command. + map sub_commands = 3; +} + +// RpcCommandOptions specifies options for commands generated from protobuf +// rpc methods. +message RpcCommandOptions { + // rpc_method is short name of the protobuf rpc method that this command is + // generated from. + string rpc_method = 1; + + // use is the one-line usage method. It also allows specifying an alternate + // name for the command as the first word of the usage text. + // + // By default the name of an rpc command is the kebab-case short name of the + // rpc method. + string use = 2; + + // long is the long message shown in the 'help ' output. + string long = 3; + + // short is the short description shown in the 'help' output. + string short = 4; + + // example is examples of how to use the command. + string example = 5; + + // alias is an array of aliases that can be used instead of the first word in Use. + repeated string alias = 6; + + // suggest_for is an array of command names for which this command will be suggested - + // similar to aliases but only suggests. + repeated string suggest_for = 7; + + // deprecated defines, if this command is deprecated and should print this string when used. + string deprecated = 8; + + // version defines the version for this command. If this value is non-empty and the command does not + // define a "version" flag, a "version" boolean flag will be added to the command and, if specified, + // will print content of the "Version" variable. A shorthand "v" flag will also be added if the + // command does not define one. + string version = 9; + + // flag_options are options for flags generated from rpc request fields. + // By default all request fields are configured as flags. They can + // also be configured as positional args instead using positional_args. + map flag_options = 10; + + // positional_args specifies positional arguments for the command. + repeated PositionalArgDescriptor positional_args = 11; + + // skip specifies whether to skip this rpc method when generating commands. + bool skip = 12; +} + +// FlagOptions are options for flags generated from rpc request fields. +// By default, all request fields are configured as flags based on the +// kebab-case name of the field. Fields can be turned into positional arguments +// instead by using RpcCommandOptions.positional_args. +message FlagOptions { + + // name is an alternate name to use for the field flag. + string name = 1; + + // shorthand is a one-letter abbreviated flag. + string shorthand = 2; + + // usage is the help message. + string usage = 3; + + // default_value is the default value as text. + string default_value = 4; + + // deprecated is the usage text to show if this flag is deprecated. + string deprecated = 6; + + // shorthand_deprecated is the usage text to show if the shorthand of this flag is deprecated. + string shorthand_deprecated = 7; + + // hidden hides the flag from help/usage text + bool hidden = 8; +} + +// PositionalArgDescriptor describes a positional argument. +message PositionalArgDescriptor { + // proto_field specifies the proto field to use as the positional arg. Any + // fields used as positional args will not have a flag generated. + string proto_field = 1; + + // varargs makes a positional parameter a varargs parameter. This can only be + // applied to last positional parameter and the proto_field must a repeated + // field. + bool varargs = 2; +} diff --git a/proto/cosmos/autocli/v1/query.proto b/proto/cosmos/autocli/v1/query.proto new file mode 100644 index 0000000..a998978 --- /dev/null +++ b/proto/cosmos/autocli/v1/query.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; + +package cosmos.autocli.v1; + +import "cosmos/autocli/v1/options.proto"; +import "cosmos/query/v1/query.proto"; + +option go_package = "cosmossdk.io/api/cosmos/base/cli/v1;cliv1"; + +// RemoteInfoService provides clients with the information they need +// to build dynamically CLI clients for remote chains. +service Query { + // AppOptions returns the autocli options for all of the modules in an app. + rpc AppOptions(AppOptionsRequest) returns (AppOptionsResponse) { + // NOTE: autocli options SHOULD NOT be part of consensus and module_query_safe + // should be kept as false. + option (cosmos.query.v1.module_query_safe) = false; + } +} + +// AppOptionsRequest is the RemoteInfoService/AppOptions request type. +message AppOptionsRequest {} + +// AppOptionsResponse is the RemoteInfoService/AppOptions response type. +message AppOptionsResponse { + // module_options is a map of module name to autocli module options. + map module_options = 1; +} diff --git a/proto/cosmos/bank/v1beta1/authz.proto b/proto/cosmos/bank/v1beta1/authz.proto index 4f58b15..d42c619 100644 --- a/proto/cosmos/bank/v1beta1/authz.proto +++ b/proto/cosmos/bank/v1beta1/authz.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package cosmos.bank.v1beta1; +import "amino/amino.proto"; import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/base/v1beta1/coin.proto"; @@ -12,8 +13,19 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; // // Since: cosmos-sdk 0.43 message SendAuthorization { - option (cosmos_proto.implements_interface) = "Authorization"; + option (cosmos_proto.implements_interface) = "cosmos.authz.v1beta1.Authorization"; + option (amino.name) = "cosmos-sdk/SendAuthorization"; - repeated cosmos.base.v1beta1.Coin spend_limit = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin spend_limit = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + // allow_list specifies an optional list of addresses to whom the grantee can send tokens on behalf of the + // granter. If omitted, any recipient is allowed. + // + // Since: cosmos-sdk 0.47 + repeated string allow_list = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } diff --git a/proto/cosmos/bank/v1beta1/bank.proto b/proto/cosmos/bank/v1beta1/bank.proto index df91008..cbf6a41 100644 --- a/proto/cosmos/bank/v1beta1/bank.proto +++ b/proto/cosmos/bank/v1beta1/bank.proto @@ -4,33 +4,45 @@ package cosmos.bank.v1beta1; import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; // Params defines the parameters for the bank module. message Params { - option (gogoproto.goproto_stringer) = false; - repeated SendEnabled send_enabled = 1 [(gogoproto.moretags) = "yaml:\"send_enabled,omitempty\""]; - bool default_send_enabled = 2 [(gogoproto.moretags) = "yaml:\"default_send_enabled,omitempty\""]; + option (amino.name) = "cosmos-sdk/x/bank/Params"; + // Deprecated: Use of SendEnabled in params is deprecated. + // For genesis, use the newly added send_enabled field in the genesis object. + // Storage, lookup, and manipulation of this information is now in the keeper. + // + // As of cosmos-sdk 0.47, this only exists for backwards compatibility of genesis files. + repeated SendEnabled send_enabled = 1 [deprecated = true]; + bool default_send_enabled = 2; } // SendEnabled maps coin denom to a send_enabled status (whether a denom is // sendable). message SendEnabled { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - string denom = 1; - bool enabled = 2; + option (gogoproto.equal) = true; + string denom = 1; + bool enabled = 2; } // Input models transaction input. message Input { + option (cosmos.msg.v1.signer) = "address"; + option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - string address = 1; - repeated cosmos.base.v1beta1.Coin coins = 2 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated cosmos.base.v1beta1.Coin coins = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; } // Output models transaction outputs. @@ -38,9 +50,13 @@ message Output { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - string address = 1; - repeated cosmos.base.v1beta1.Coin coins = 2 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated cosmos.base.v1beta1.Coin coins = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; } // Supply represents a struct that passively keeps track of the total supply @@ -52,10 +68,14 @@ message Supply { option (gogoproto.equal) = true; option (gogoproto.goproto_getters) = false; - option (cosmos_proto.implements_interface) = "*github.com/cosmos/cosmos-sdk/x/bank/legacy/v040.SupplyI"; + option (cosmos_proto.implements_interface) = "cosmos.bank.v1beta1.SupplyI"; - repeated cosmos.base.v1beta1.Coin total = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin total = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; } // DenomUnit represents a struct that describes a given @@ -65,7 +85,7 @@ message DenomUnit { string denom = 1; // exponent represents power of 10 exponent that one must // raise the base_denom to in order to equal the given DenomUnit's denom - // 1 denom = 1^exponent base_denom + // 1 denom = 10^exponent base_denom // (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with // exponent = 6, thus: 1 atom = 10^6 uatom). uint32 exponent = 2; @@ -93,4 +113,13 @@ message Metadata { // // Since: cosmos-sdk 0.43 string symbol = 6; + // URI to a document (on or off-chain) that contains additional information. Optional. + // + // Since: cosmos-sdk 0.46 + string uri = 7 [(gogoproto.customname) = "URI"]; + // URIHash is a sha256 hash of a document pointed by URI. It's used to verify that + // the document didn't change. Optional. + // + // Since: cosmos-sdk 0.46 + string uri_hash = 8 [(gogoproto.customname) = "URIHash"]; } diff --git a/proto/cosmos/bank/v1beta1/genesis.proto b/proto/cosmos/bank/v1beta1/genesis.proto index 8fd7329..caf05a9 100644 --- a/proto/cosmos/bank/v1beta1/genesis.proto +++ b/proto/cosmos/bank/v1beta1/genesis.proto @@ -4,24 +4,35 @@ package cosmos.bank.v1beta1; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmos/bank/v1beta1/bank.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; // GenesisState defines the bank module's genesis state. message GenesisState { - // params defines all the paramaters of the module. - Params params = 1 [(gogoproto.nullable) = false]; + // params defines all the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // balances is an array containing the balances of all the accounts. - repeated Balance balances = 2 [(gogoproto.nullable) = false]; + repeated Balance balances = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // supply represents the total supply. If it is left empty, then supply will be calculated based on the provided // balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. - repeated cosmos.base.v1beta1.Coin supply = 3 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; - - // denom_metadata defines the metadata of the differents coins. - repeated Metadata denom_metadata = 4 [(gogoproto.moretags) = "yaml:\"denom_metadata\"", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.Coin supply = 3 [ + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; + + // denom_metadata defines the metadata of the different coins. + repeated Metadata denom_metadata = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // send_enabled defines the denoms where send is enabled or disabled. + // + // Since: cosmos-sdk 0.47 + repeated SendEnabled send_enabled = 5 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // Balance defines an account address and balance pair used in the bank module's @@ -31,9 +42,13 @@ message Balance { option (gogoproto.goproto_getters) = false; // address is the address of the balance holder. - string address = 1; + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // coins defines the different coins this balance holds. - repeated cosmos.base.v1beta1.Coin coins = 2 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.Coin coins = 2 [ + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; } diff --git a/proto/cosmos/bank/v1beta1/query.proto b/proto/cosmos/bank/v1beta1/query.proto index a567e07..5b21a30 100644 --- a/proto/cosmos/bank/v1beta1/query.proto +++ b/proto/cosmos/bank/v1beta1/query.proto @@ -6,6 +6,9 @@ import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmos/bank/v1beta1/bank.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/query/v1/query.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; @@ -13,43 +16,117 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; service Query { // Balance queries the balance of a single coin for a single account. rpc Balance(QueryBalanceRequest) returns (QueryBalanceResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/balances/{address}/by_denom"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/balances/{address}/by_denom"; } // AllBalances queries the balance of all coins for a single account. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. rpc AllBalances(QueryAllBalancesRequest) returns (QueryAllBalancesResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/balances/{address}"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/balances/{address}"; } - // SpendableBalances queries the spenable balance of all coins for a single + // SpendableBalances queries the spendable balance of all coins for a single // account. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + // + // Since: cosmos-sdk 0.46 rpc SpendableBalances(QuerySpendableBalancesRequest) returns (QuerySpendableBalancesResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/spendable_balances/{address}"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/spendable_balances/{address}"; + } + + // SpendableBalanceByDenom queries the spendable balance of a single denom for + // a single account. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + // + // Since: cosmos-sdk 0.47 + rpc SpendableBalanceByDenom(QuerySpendableBalanceByDenomRequest) returns (QuerySpendableBalanceByDenomResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/spendable_balances/{address}/by_denom"; } // TotalSupply queries the total supply of all coins. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. rpc TotalSupply(QueryTotalSupplyRequest) returns (QueryTotalSupplyResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/supply"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/supply"; } // SupplyOf queries the supply of a single coin. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. rpc SupplyOf(QuerySupplyOfRequest) returns (QuerySupplyOfResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/supply/{denom}"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/supply/by_denom"; } // Params queries the parameters of x/bank module. rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/params"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/params"; } - // DenomsMetadata queries the client metadata of a given coin denomination. + // DenomMetadata queries the client metadata of a given coin denomination. rpc DenomMetadata(QueryDenomMetadataRequest) returns (QueryDenomMetadataResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata/{denom}"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata/{denom}"; } - // DenomsMetadata queries the client metadata for all registered coin denominations. + // DenomMetadataByQueryString queries the client metadata of a given coin denomination. + rpc DenomMetadataByQueryString(QueryDenomMetadataByQueryStringRequest) + returns (QueryDenomMetadataByQueryStringResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata_by_query_string"; + } + // DenomsMetadata queries the client metadata for all registered coin + // denominations. rpc DenomsMetadata(QueryDenomsMetadataRequest) returns (QueryDenomsMetadataResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata"; + } + + // DenomOwners queries for all account addresses that own a particular token + // denomination. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + // + // Since: cosmos-sdk 0.46 + rpc DenomOwners(QueryDenomOwnersRequest) returns (QueryDenomOwnersResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/denom_owners/{denom}"; + } + + // DenomOwnersByQuery queries for all account addresses that own a particular token + // denomination. + // + // Since: cosmos-sdk 0.50.3 + rpc DenomOwnersByQuery(QueryDenomOwnersByQueryRequest) returns (QueryDenomOwnersByQueryResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/denom_owners_by_query"; + } + + // SendEnabled queries for SendEnabled entries. + // + // This query only returns denominations that have specific SendEnabled settings. + // Any denomination that does not have a specific setting will use the default + // params.default_send_enabled, and will not be returned by this query. + // + // Since: cosmos-sdk 0.47 + rpc SendEnabled(QuerySendEnabledRequest) returns (QuerySendEnabledResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/bank/v1beta1/send_enabled"; } } @@ -59,7 +136,7 @@ message QueryBalanceRequest { option (gogoproto.goproto_getters) = false; // address is the address to query balances for. - string address = 1; + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // denom is the coin denom to query balances for. string denom = 2; @@ -77,18 +154,27 @@ message QueryAllBalancesRequest { option (gogoproto.goproto_getters) = false; // address is the address to query balances for. - string address = 1; + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // pagination defines an optional pagination for the request. cosmos.base.query.v1beta1.PageRequest pagination = 2; + + // resolve_denom is the flag to resolve the denom into a human-readable form from the metadata. + // + // Since: cosmos-sdk 0.50 + bool resolve_denom = 3; } // QueryAllBalancesResponse is the response type for the Query/AllBalances RPC // method. message QueryAllBalancesResponse { // balances is the balances of all the coins. - repeated cosmos.base.v1beta1.Coin balances = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin balances = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -96,12 +182,14 @@ message QueryAllBalancesResponse { // QuerySpendableBalancesRequest defines the gRPC request structure for querying // an account's spendable balances. +// +// Since: cosmos-sdk 0.46 message QuerySpendableBalancesRequest { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; // address is the address to query spendable balances for. - string address = 1; + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // pagination defines an optional pagination for the request. cosmos.base.query.v1beta1.PageRequest pagination = 2; @@ -109,15 +197,45 @@ message QuerySpendableBalancesRequest { // QuerySpendableBalancesResponse defines the gRPC response structure for querying // an account's spendable balances. +// +// Since: cosmos-sdk 0.46 message QuerySpendableBalancesResponse { // balances is the spendable balances of all the coins. - repeated cosmos.base.v1beta1.Coin balances = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin balances = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; } +// QuerySpendableBalanceByDenomRequest defines the gRPC request structure for +// querying an account's spendable balance for a specific denom. +// +// Since: cosmos-sdk 0.47 +message QuerySpendableBalanceByDenomRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the address to query balances for. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // denom is the coin denom to query balances for. + string denom = 2; +} + +// QuerySpendableBalanceByDenomResponse defines the gRPC response structure for +// querying an account's spendable balance for a specific denom. +// +// Since: cosmos-sdk 0.47 +message QuerySpendableBalanceByDenomResponse { + // balance is the balance of the coin. + cosmos.base.v1beta1.Coin balance = 1; +} + // QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC // method. message QueryTotalSupplyRequest { @@ -134,8 +252,12 @@ message QueryTotalSupplyRequest { // method message QueryTotalSupplyResponse { // supply is the supply of the coins - repeated cosmos.base.v1beta1.Coin supply = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin supply = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; // pagination defines the pagination in the response. // @@ -152,7 +274,7 @@ message QuerySupplyOfRequest { // QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. message QuerySupplyOfResponse { // amount is the supply of the coin. - cosmos.base.v1beta1.Coin amount = 1 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.Coin amount = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QueryParamsRequest defines the request type for querying x/bank parameters. @@ -160,7 +282,8 @@ message QueryParamsRequest {} // QueryParamsResponse defines the response type for querying x/bank parameters. message QueryParamsResponse { - Params params = 1 [(gogoproto.nullable) = false]; + // params provides the parameters of the bank module. + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. @@ -173,7 +296,7 @@ message QueryDenomsMetadataRequest { // method. message QueryDenomsMetadataResponse { // metadata provides the client information for all the registered tokens. - repeated Metadata metadatas = 1 [(gogoproto.nullable) = false]; + repeated Metadata metadatas = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -189,5 +312,97 @@ message QueryDenomMetadataRequest { // method. message QueryDenomMetadataResponse { // metadata describes and provides all the client information for the requested token. - Metadata metadata = 1 [(gogoproto.nullable) = false]; + Metadata metadata = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryDenomMetadataByQueryStringRequest is the request type for the Query/DenomMetadata RPC method. +// Identical with QueryDenomMetadataRequest but receives denom as query string. +message QueryDenomMetadataByQueryStringRequest { + // denom is the coin denom to query the metadata for. + string denom = 1; +} + +// QueryDenomMetadataByQueryStringResponse is the response type for the Query/DenomMetadata RPC +// method. Identical with QueryDenomMetadataResponse but receives denom as query string in request. +message QueryDenomMetadataByQueryStringResponse { + // metadata describes and provides all the client information for the requested token. + Metadata metadata = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, +// which queries for a paginated set of all account holders of a particular +// denomination. +message QueryDenomOwnersRequest { + // denom defines the coin denomination to query all account holders for. + string denom = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// DenomOwner defines structure representing an account that owns or holds a +// particular denominated token. It contains the account address and account +// balance of the denominated token. +// +// Since: cosmos-sdk 0.46 +message DenomOwner { + // address defines the address that owns a particular denomination. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // balance is the balance of the denominated coin for an account. + cosmos.base.v1beta1.Coin balance = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. +// +// Since: cosmos-sdk 0.46 +message QueryDenomOwnersResponse { + repeated DenomOwner denom_owners = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryDenomOwnersByQueryRequest defines the request type for the DenomOwnersByQuery RPC query, +// which queries for a paginated set of all account holders of a particular +// denomination. +// +// Since: cosmos-sdk 0.50.3 +message QueryDenomOwnersByQueryRequest { + // denom defines the coin denomination to query all account holders for. + string denom = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryDenomOwnersByQueryResponse defines the RPC response of a DenomOwnersByQuery RPC query. +// +// Since: cosmos-sdk 0.50.3 +message QueryDenomOwnersByQueryResponse { + repeated DenomOwner denom_owners = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. +// +// Since: cosmos-sdk 0.47 +message QuerySendEnabledRequest { + // denoms is the specific denoms you want look up. Leave empty to get all entries. + repeated string denoms = 1; + // pagination defines an optional pagination for the request. This field is + // only read if the denoms field is empty. + cosmos.base.query.v1beta1.PageRequest pagination = 99; +} + +// QuerySendEnabledResponse defines the RPC response of a SendEnable query. +// +// Since: cosmos-sdk 0.47 +message QuerySendEnabledResponse { + repeated SendEnabled send_enabled = 1; + // pagination defines the pagination in the response. This field is only + // populated if the denoms field in the request is empty. + cosmos.base.query.v1beta1.PageResponse pagination = 99; } diff --git a/proto/cosmos/bank/v1beta1/tx.proto b/proto/cosmos/bank/v1beta1/tx.proto index 26b2ab4..a4e8fae 100644 --- a/proto/cosmos/bank/v1beta1/tx.proto +++ b/proto/cosmos/bank/v1beta1/tx.proto @@ -4,27 +4,53 @@ package cosmos.bank.v1beta1; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmos/bank/v1beta1/bank.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; // Msg defines the bank Msg service. service Msg { + option (cosmos.msg.v1.service) = true; + // Send defines a method for sending coins from one account to another account. rpc Send(MsgSend) returns (MsgSendResponse); // MultiSend defines a method for sending coins from some accounts to other accounts. rpc MultiSend(MsgMultiSend) returns (MsgMultiSendResponse); + + // UpdateParams defines a governance operation for updating the x/bank module parameters. + // The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + + // SetSendEnabled is a governance operation for setting the SendEnabled flag + // on any number of Denoms. Only the entries to add or update should be + // included. Entries that already exist in the store, but that aren't + // included in this message, will be left unchanged. + // + // Since: cosmos-sdk 0.47 + rpc SetSendEnabled(MsgSetSendEnabled) returns (MsgSetSendEnabledResponse); } // MsgSend represents a message to send coins from one account to another. message MsgSend { + option (cosmos.msg.v1.signer) = "from_address"; + option (amino.name) = "cosmos-sdk/MsgSend"; + option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - string from_address = 1 [(gogoproto.moretags) = "yaml:\"from_address\""]; - string to_address = 2 [(gogoproto.moretags) = "yaml:\"to_address\""]; - repeated cosmos.base.v1beta1.Coin amount = 3 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + string from_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string to_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated cosmos.base.v1beta1.Coin amount = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; } // MsgSendResponse defines the Msg/Send response type. @@ -32,11 +58,67 @@ message MsgSendResponse {} // MsgMultiSend represents an arbitrary multi-in, multi-out send message. message MsgMultiSend { + option (cosmos.msg.v1.signer) = "inputs"; + option (amino.name) = "cosmos-sdk/MsgMultiSend"; + option (gogoproto.equal) = false; - repeated Input inputs = 1 [(gogoproto.nullable) = false]; - repeated Output outputs = 2 [(gogoproto.nullable) = false]; + // Inputs, despite being `repeated`, only allows one sender input. This is + // checked in MsgMultiSend's ValidateBasic. + repeated Input inputs = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + repeated Output outputs = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // MsgMultiSendResponse defines the Msg/MultiSend response type. message MsgMultiSendResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + option (amino.name) = "cosmos-sdk/x/bank/MsgUpdateParams"; + + // params defines the x/bank parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} + +// MsgSetSendEnabled is the Msg/SetSendEnabled request type. +// +// Only entries to add/update/delete need to be included. +// Existing SendEnabled entries that are not included in this +// message are left unchanged. +// +// Since: cosmos-sdk 0.47 +message MsgSetSendEnabled { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/MsgSetSendEnabled"; + + // authority is the address that controls the module. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // send_enabled is the list of entries to add or update. + repeated SendEnabled send_enabled = 2; + + // use_default_for is a list of denoms that should use the params.default_send_enabled value. + // Denoms listed here will have their SendEnabled entries deleted. + // If a denom is included that doesn't have a SendEnabled entry, + // it will be ignored. + repeated string use_default_for = 3; +} + +// MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. +// +// Since: cosmos-sdk 0.47 +message MsgSetSendEnabledResponse {} diff --git a/proto/cosmos/base/abci/v1beta1/abci.proto b/proto/cosmos/base/abci/v1beta1/abci.proto index e24ae7b..9e3b4e5 100644 --- a/proto/cosmos/base/abci/v1beta1/abci.proto +++ b/proto/cosmos/base/abci/v1beta1/abci.proto @@ -3,6 +3,7 @@ package cosmos.base.abci.v1beta1; import "gogoproto/gogo.proto"; import "tendermint/abci/types.proto"; +import "tendermint/types/block.proto"; import "google/protobuf/any.proto"; option go_package = "github.com/cosmos/cosmos-sdk/types"; @@ -41,7 +42,7 @@ message TxResponse { string timestamp = 12; // Events defines all the events emitted by processing a transaction. Note, // these events include those emitted by processing all the messages and those - // emitted from the ante handler. Whereas Logs contains the events, with + // emitted from the ante. Whereas Logs contains the events, with // additional metadata, emitted only by processing the messages. // // Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 @@ -52,7 +53,7 @@ message TxResponse { message ABCIMessageLog { option (gogoproto.stringer) = true; - uint32 msg_index = 1; + uint32 msg_index = 1 [(gogoproto.jsontag) = "msg_index"]; string log = 2; // Events contains a slice of Event objects that were emitted during some @@ -79,10 +80,10 @@ message Attribute { // GasInfo defines tx execution gas context. message GasInfo { // GasWanted is the maximum units of work we allow this tx to perform. - uint64 gas_wanted = 1 [(gogoproto.moretags) = "yaml:\"gas_wanted\""]; + uint64 gas_wanted = 1; // GasUsed is the amount of gas actually consumed. - uint64 gas_used = 2 [(gogoproto.moretags) = "yaml:\"gas_used\""]; + uint64 gas_used = 2; } // Result is the union of ResponseFormat and ResponseCheckTx. @@ -91,7 +92,9 @@ message Result { // Data is any data returned from message or handler execution. It MUST be // length prefixed in order to separate data from multiple message executions. - bytes data = 1; + // Deprecated. This field is still populated, but prefer msg_response instead + // because it also contains the Msg response typeURL. + bytes data = 1 [deprecated = true]; // Log contains the log information from message or handler execution. string log = 2; @@ -99,6 +102,11 @@ message Result { // Events contains a slice of Event objects that were emitted during message // or handler execution. repeated tendermint.abci.Event events = 3 [(gogoproto.nullable) = false]; + + // msg_responses contains the Msg handler responses type packed in Anys. + // + // Since: cosmos-sdk 0.46 + repeated google.protobuf.Any msg_responses = 4; } // SimulationResponse defines the response generated when a transaction is @@ -111,6 +119,7 @@ message SimulationResponse { // MsgData defines the data returned in a Result object during message // execution. message MsgData { + option deprecated = true; option (gogoproto.stringer) = true; string msg_type = 1; @@ -122,7 +131,13 @@ message MsgData { message TxMsgData { option (gogoproto.stringer) = true; - repeated MsgData data = 1; + // data field is deprecated and not populated. + repeated MsgData data = 1 [deprecated = true]; + + // msg_responses contains the Msg handler responses packed into Anys. + // + // Since: cosmos-sdk 0.46 + repeated google.protobuf.Any msg_responses = 2; } // SearchTxsResult defines a structure for querying txs pageable @@ -130,15 +145,33 @@ message SearchTxsResult { option (gogoproto.stringer) = true; // Count of all txs - uint64 total_count = 1 [(gogoproto.moretags) = "yaml:\"total_count\"", (gogoproto.jsontag) = "total_count"]; + uint64 total_count = 1; // Count of txs in current page uint64 count = 2; // Index of current page, start from 1 - uint64 page_number = 3 [(gogoproto.moretags) = "yaml:\"page_number\"", (gogoproto.jsontag) = "page_number"]; + uint64 page_number = 3; // Count of total pages - uint64 page_total = 4 [(gogoproto.moretags) = "yaml:\"page_total\"", (gogoproto.jsontag) = "page_total"]; + uint64 page_total = 4; // Max count txs per page uint64 limit = 5; // List of txs in current page repeated TxResponse txs = 6; } + +// SearchBlocksResult defines a structure for querying blocks pageable +message SearchBlocksResult { + option (gogoproto.stringer) = true; + + // Count of all blocks + int64 total_count = 1; + // Count of blocks in current page + int64 count = 2; + // Index of current page, start from 1 + int64 page_number = 3; + // Count of total pages + int64 page_total = 4; + // Max count blocks per page + int64 limit = 5; + // List of blocks in current page + repeated tendermint.types.Block blocks = 6; +} diff --git a/proto/cosmos/base/node/v1beta1/query.proto b/proto/cosmos/base/node/v1beta1/query.proto index 8070f7b..95df568 100644 --- a/proto/cosmos/base/node/v1beta1/query.proto +++ b/proto/cosmos/base/node/v1beta1/query.proto @@ -2,6 +2,8 @@ syntax = "proto3"; package cosmos.base.node.v1beta1; import "google/api/annotations.proto"; +import "google/protobuf/timestamp.proto"; +import "gogoproto/gogo.proto"; option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/node"; @@ -11,6 +13,10 @@ service Service { rpc Config(ConfigRequest) returns (ConfigResponse) { option (google.api.http).get = "/cosmos/base/node/v1beta1/config"; } + // Status queries for the node status. + rpc Status(StatusRequest) returns (StatusResponse) { + option (google.api.http).get = "/cosmos/base/node/v1beta1/status"; + } } // ConfigRequest defines the request structure for the Config gRPC query. @@ -18,5 +24,20 @@ message ConfigRequest {} // ConfigResponse defines the response structure for the Config gRPC query. message ConfigResponse { - string minimum_gas_price = 1; + string minimum_gas_price = 1; + string pruning_keep_recent = 2; + string pruning_interval = 3; + uint64 halt_height = 4; +} + +// StateRequest defines the request structure for the status of a node. +message StatusRequest {} + +// StateResponse defines the response structure for the status of a node. +message StatusResponse { + uint64 earliest_store_height = 1; // earliest block height available in the store + uint64 height = 2; // current block height + google.protobuf.Timestamp timestamp = 3 [(gogoproto.stdtime) = true]; // block height timestamp + bytes app_hash = 4; // app hash of the current block + bytes validator_hash = 5; // validator hash provided by the consensus header } diff --git a/proto/cosmos/base/query/v1beta1/pagination.proto b/proto/cosmos/base/query/v1beta1/pagination.proto index cd5eb06..0a36814 100644 --- a/proto/cosmos/base/query/v1beta1/pagination.proto +++ b/proto/cosmos/base/query/v1beta1/pagination.proto @@ -46,7 +46,8 @@ message PageRequest { // } message PageResponse { // next_key is the key to be passed to PageRequest.key to - // query the next page most efficiently + // query the next page most efficiently. It will be empty if + // there are no more results. bytes next_key = 1; // total is total number of results available if PageRequest.count_total diff --git a/proto/cosmos/base/tendermint/v1beta1/query.proto b/proto/cosmos/base/tendermint/v1beta1/query.proto index 98542d2..6de6f2c 100644 --- a/proto/cosmos/base/tendermint/v1beta1/query.proto +++ b/proto/cosmos/base/tendermint/v1beta1/query.proto @@ -5,11 +5,14 @@ import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "google/api/annotations.proto"; import "tendermint/p2p/types.proto"; -import "tendermint/types/block.proto"; import "tendermint/types/types.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos/base/tendermint/v1beta1/types.proto"; +import "cosmos_proto/cosmos.proto"; +import "tendermint/types/block.proto"; +import "amino/amino.proto"; -option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/tmservice"; +option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice"; // Service defines the gRPC querier service for tendermint queries. service Service { @@ -17,14 +20,17 @@ service Service { rpc GetNodeInfo(GetNodeInfoRequest) returns (GetNodeInfoResponse) { option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/node_info"; } + // GetSyncing queries node syncing. rpc GetSyncing(GetSyncingRequest) returns (GetSyncingResponse) { option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/syncing"; } + // GetLatestBlock returns the latest block. rpc GetLatestBlock(GetLatestBlockRequest) returns (GetLatestBlockResponse) { option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/blocks/latest"; } + // GetBlockByHeight queries block for given height. rpc GetBlockByHeight(GetBlockByHeightRequest) returns (GetBlockByHeightResponse) { option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/blocks/{height}"; @@ -34,10 +40,20 @@ service Service { rpc GetLatestValidatorSet(GetLatestValidatorSetRequest) returns (GetLatestValidatorSetResponse) { option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/validatorsets/latest"; } + // GetValidatorSetByHeight queries validator-set at a given height. rpc GetValidatorSetByHeight(GetValidatorSetByHeightRequest) returns (GetValidatorSetByHeightResponse) { option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/validatorsets/{height}"; } + + // ABCIQuery defines a query handler that supports ABCI queries directly to the + // application, bypassing Tendermint completely. The ABCI query must contain + // a valid and supported path, including app, custom, p2p, and store. + // + // Since: cosmos-sdk 0.46 + rpc ABCIQuery(ABCIQueryRequest) returns (ABCIQueryResponse) { + option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/abci_query"; + } } // GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. @@ -71,7 +87,7 @@ message GetLatestValidatorSetResponse { // Validator is the type for the validator-set. message Validator { - string address = 1; + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; google.protobuf.Any pub_key = 2; int64 voting_power = 3; int64 proposer_priority = 4; @@ -85,7 +101,12 @@ message GetBlockByHeightRequest { // GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. message GetBlockByHeightResponse { .tendermint.types.BlockID block_id = 1; - .tendermint.types.Block block = 2; + + // Deprecated: please use `sdk_block` instead + .tendermint.types.Block block = 2; + + // Since: cosmos-sdk 0.47 + Block sdk_block = 3; } // GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. @@ -94,7 +115,12 @@ message GetLatestBlockRequest {} // GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. message GetLatestBlockResponse { .tendermint.types.BlockID block_id = 1; - .tendermint.types.Block block = 2; + + // Deprecated: please use `sdk_block` instead + .tendermint.types.Block block = 2; + + // Since: cosmos-sdk 0.47 + Block sdk_block = 3; } // GetSyncingRequest is the request type for the Query/GetSyncing RPC method. @@ -108,7 +134,7 @@ message GetSyncingResponse { // GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. message GetNodeInfoRequest {} -// GetNodeInfoResponse is the request type for the Query/GetNodeInfo RPC method. +// GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC method. message GetNodeInfoResponse { .tendermint.p2p.DefaultNodeInfo default_node_info = 1; VersionInfo application_version = 2; @@ -136,3 +162,47 @@ message Module { // checksum string sum = 3; } + +// ABCIQueryRequest defines the request structure for the ABCIQuery gRPC query. +message ABCIQueryRequest { + bytes data = 1; + string path = 2; + int64 height = 3; + bool prove = 4; +} + +// ABCIQueryResponse defines the response structure for the ABCIQuery gRPC query. +// +// Note: This type is a duplicate of the ResponseQuery proto type defined in +// Tendermint. +message ABCIQueryResponse { + uint32 code = 1; + // DEPRECATED: use "value" instead + reserved 2; + string log = 3; // nondeterministic + string info = 4; // nondeterministic + int64 index = 5; + bytes key = 6; + bytes value = 7; + ProofOps proof_ops = 8; + int64 height = 9; + string codespace = 10; +} + +// ProofOp defines an operation used for calculating Merkle root. The data could +// be arbitrary format, providing necessary data for example neighbouring node +// hash. +// +// Note: This type is a duplicate of the ProofOp proto type defined in Tendermint. +message ProofOp { + string type = 1; + bytes key = 2; + bytes data = 3; +} + +// ProofOps is Merkle proof defined by the list of ProofOps. +// +// Note: This type is a duplicate of the ProofOps proto type defined in Tendermint. +message ProofOps { + repeated ProofOp ops = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} diff --git a/proto/cosmos/base/tendermint/v1beta1/types.proto b/proto/cosmos/base/tendermint/v1beta1/types.proto new file mode 100644 index 0000000..624ff41 --- /dev/null +++ b/proto/cosmos/base/tendermint/v1beta1/types.proto @@ -0,0 +1,52 @@ +syntax = "proto3"; +package cosmos.base.tendermint.v1beta1; + +import "gogoproto/gogo.proto"; +import "tendermint/types/types.proto"; +import "tendermint/types/evidence.proto"; +import "tendermint/version/types.proto"; +import "google/protobuf/timestamp.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice"; + +// Block is tendermint type Block, with the Header proposer address +// field converted to bech32 string. +message Block { + Header header = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + .tendermint.types.Data data = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + .tendermint.types.EvidenceList evidence = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + .tendermint.types.Commit last_commit = 4; +} + +// Header defines the structure of a Tendermint block header. +message Header { + // basic block info + .tendermint.version.Consensus version = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + string chain_id = 2 [(gogoproto.customname) = "ChainID"]; + int64 height = 3; + google.protobuf.Timestamp time = 4 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; + + // prev block info + .tendermint.types.BlockID last_block_id = 5 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // hashes of block data + bytes last_commit_hash = 6; // commit from validators from the last block + bytes data_hash = 7; // transactions + + // hashes from the app output from the prev block + bytes validators_hash = 8; // validators for the current block + bytes next_validators_hash = 9; // validators for the next block + bytes consensus_hash = 10; // consensus params for current block + bytes app_hash = 11; // state after txs from the previous block + bytes last_results_hash = 12; // root hash of all results from the txs from the previous block + + // consensus info + bytes evidence_hash = 13; // evidence included in the block + + // proposer_address is the original block proposer address, formatted as a Bech32 string. + // In Tendermint, this type is `bytes`, but in the SDK, we convert it to a Bech32 string + // for better UX. + string proposer_address = 14; // original proposer of the block +} diff --git a/proto/cosmos/base/v1beta1/coin.proto b/proto/cosmos/base/v1beta1/coin.proto index fab7528..1447d64 100644 --- a/proto/cosmos/base/v1beta1/coin.proto +++ b/proto/cosmos/base/v1beta1/coin.proto @@ -2,6 +2,8 @@ syntax = "proto3"; package cosmos.base.v1beta1; import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/types"; option (gogoproto.goproto_stringer_all) = false; @@ -15,7 +17,12 @@ message Coin { option (gogoproto.equal) = true; string denom = 1; - string amount = 2 [(gogoproto.customtype) = "Int", (gogoproto.nullable) = false]; + string amount = 2 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; } // DecCoin defines a token with a denomination and a decimal amount. @@ -26,15 +33,29 @@ message DecCoin { option (gogoproto.equal) = true; string denom = 1; - string amount = 2 [(gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; + string amount = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; } // IntProto defines a Protobuf wrapper around an Int object. +// Deprecated: Prefer to use math.Int directly. It supports binary Marshal and Unmarshal. message IntProto { - string int = 1 [(gogoproto.customtype) = "Int", (gogoproto.nullable) = false]; + string int = 1 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; } // DecProto defines a Protobuf wrapper around a Dec object. +// Deprecated: Prefer to use math.LegacyDec directly. It supports binary Marshal and Unmarshal. message DecProto { - string dec = 1 [(gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; + string dec = 1 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; } diff --git a/proto/cosmos/circuit/v1/query.proto b/proto/cosmos/circuit/v1/query.proto new file mode 100644 index 0000000..0115d33 --- /dev/null +++ b/proto/cosmos/circuit/v1/query.proto @@ -0,0 +1,61 @@ +syntax = "proto3"; +package cosmos.circuit.v1; + +option go_package = "cosmossdk.io/x/circuit/types"; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos/circuit/v1/types.proto"; +import "google/api/annotations.proto"; +import "cosmos/query/v1/query.proto"; + +// Query defines the circuit gRPC querier service. +service Query { + // Account returns account permissions. + rpc Account(QueryAccountRequest) returns (AccountResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/circuit/v1/accounts/{address}"; + } + + // Account returns account permissions. + rpc Accounts(QueryAccountsRequest) returns (AccountsResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/circuit/v1/accounts"; + } + + // DisabledList returns a list of disabled message urls + rpc DisabledList(QueryDisabledListRequest) returns (DisabledListResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/circuit/v1/disable_list"; + } +} + +// QueryAccountRequest is the request type for the Query/Account RPC method. +message QueryAccountRequest { + string address = 1; +} + +// AccountResponse is the response type for the Query/Account RPC method. +message AccountResponse { + Permissions permission = 1; +} + +// QueryAccountsRequest is the request type for the Query/Accounts RPC method. +message QueryAccountsRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// AccountsResponse is the response type for the Query/Accounts RPC method. +message AccountsResponse { + repeated GenesisAccountPermissions accounts = 1; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryDisableListRequest is the request type for the Query/DisabledList RPC method. +message QueryDisabledListRequest {} + +// DisabledListResponse is the response type for the Query/DisabledList RPC method. +message DisabledListResponse { + repeated string disabled_list = 1; +} diff --git a/proto/cosmos/circuit/v1/tx.proto b/proto/cosmos/circuit/v1/tx.proto new file mode 100644 index 0000000..71f708b --- /dev/null +++ b/proto/cosmos/circuit/v1/tx.proto @@ -0,0 +1,83 @@ +syntax = "proto3"; +package cosmos.circuit.v1; + +option go_package = "cosmossdk.io/x/circuit/types"; + +import "cosmos/msg/v1/msg.proto"; +import "cosmos/circuit/v1/types.proto"; + +// Msg defines the circuit Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // AuthorizeCircuitBreaker allows a super-admin to grant (or revoke) another + // account's circuit breaker permissions. + rpc AuthorizeCircuitBreaker(MsgAuthorizeCircuitBreaker) returns (MsgAuthorizeCircuitBreakerResponse); + + // TripCircuitBreaker pauses processing of Msg's in the state machine. + rpc TripCircuitBreaker(MsgTripCircuitBreaker) returns (MsgTripCircuitBreakerResponse); + + // ResetCircuitBreaker resumes processing of Msg's in the state machine that + // have been been paused using TripCircuitBreaker. + rpc ResetCircuitBreaker(MsgResetCircuitBreaker) returns (MsgResetCircuitBreakerResponse); +} + +// MsgAuthorizeCircuitBreaker defines the Msg/AuthorizeCircuitBreaker request type. +message MsgAuthorizeCircuitBreaker { + option (cosmos.msg.v1.signer) = "granter"; + + // granter is the granter of the circuit breaker permissions and must have + // LEVEL_SUPER_ADMIN. + string granter = 1; + + // grantee is the account authorized with the provided permissions. + string grantee = 2; + + // permissions are the circuit breaker permissions that the grantee receives. + // These will overwrite any existing permissions. LEVEL_NONE_UNSPECIFIED can + // be specified to revoke all permissions. + Permissions permissions = 3; +} + +// MsgAuthorizeCircuitBreakerResponse defines the Msg/AuthorizeCircuitBreaker response type. +message MsgAuthorizeCircuitBreakerResponse { + bool success = 1; +} + +// MsgTripCircuitBreaker defines the Msg/TripCircuitBreaker request type. +message MsgTripCircuitBreaker { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the account authorized to trip the circuit breaker. + string authority = 1; + + // msg_type_urls specifies a list of type URLs to immediately stop processing. + // IF IT IS LEFT EMPTY, ALL MSG PROCESSING WILL STOP IMMEDIATELY. + // This value is validated against the authority's permissions and if the + // authority does not have permissions to trip the specified msg type URLs + // (or all URLs), the operation will fail. + repeated string msg_type_urls = 2; +} + +// MsgTripCircuitBreakerResponse defines the Msg/TripCircuitBreaker response type. +message MsgTripCircuitBreakerResponse { + bool success = 1; +} + +// MsgResetCircuitBreaker defines the Msg/ResetCircuitBreaker request type. +message MsgResetCircuitBreaker { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the account authorized to trip or reset the circuit breaker. + string authority = 1; + + // msg_type_urls specifies a list of Msg type URLs to resume processing. If + // it is left empty all Msg processing for type URLs that the account is + // authorized to trip will resume. + repeated string msg_type_urls = 3; +} + +// MsgResetCircuitBreakerResponse defines the Msg/ResetCircuitBreaker response type. +message MsgResetCircuitBreakerResponse { + bool success = 1; +} diff --git a/proto/cosmos/circuit/v1/types.proto b/proto/cosmos/circuit/v1/types.proto new file mode 100644 index 0000000..1bd8d9d --- /dev/null +++ b/proto/cosmos/circuit/v1/types.proto @@ -0,0 +1,49 @@ +syntax = "proto3"; +package cosmos.circuit.v1; + +option go_package = "cosmossdk.io/x/circuit/types"; + +// Permissions are the permissions that an account has to trip +// or reset the circuit breaker. +message Permissions { + // level is the level of permissions granted to this account. + Level level = 1; + + // limit_type_urls is used with LEVEL_SOME_MSGS to limit the lists of Msg type + // URLs that the account can trip. It is an error to use limit_type_urls with + // a level other than LEVEL_SOME_MSGS. + repeated string limit_type_urls = 2; + + // Level is the permission level. + enum Level { + // LEVEL_NONE_UNSPECIFIED indicates that the account will have no circuit + // breaker permissions. + LEVEL_NONE_UNSPECIFIED = 0; + + // LEVEL_SOME_MSGS indicates that the account will have permission to + // trip or reset the circuit breaker for some Msg type URLs. If this level + // is chosen, a non-empty list of Msg type URLs must be provided in + // limit_type_urls. + LEVEL_SOME_MSGS = 1; + + // LEVEL_ALL_MSGS indicates that the account can trip or reset the circuit + // breaker for Msg's of all type URLs. + LEVEL_ALL_MSGS = 2; + + // LEVEL_SUPER_ADMIN indicates that the account can take all circuit breaker + // actions and can grant permissions to other accounts. + LEVEL_SUPER_ADMIN = 3; + } +} + +// GenesisAccountPermissions is the account permissions for the circuit breaker in genesis +message GenesisAccountPermissions { + string address = 1; + Permissions permissions = 2; +} + +// GenesisState is the state that must be provided at genesis. +message GenesisState { + repeated GenesisAccountPermissions account_permissions = 1; + repeated string disabled_type_urls = 2; +} diff --git a/proto/cosmos/consensus/v1/query.proto b/proto/cosmos/consensus/v1/query.proto new file mode 100644 index 0000000..84648d9 --- /dev/null +++ b/proto/cosmos/consensus/v1/query.proto @@ -0,0 +1,27 @@ +// Since: cosmos-sdk 0.47 +syntax = "proto3"; +package cosmos.consensus.v1; + +import "google/api/annotations.proto"; +import "tendermint/types/params.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/consensus/types"; + +// Query defines the gRPC querier service. +service Query { + // Params queries the parameters of x/consensus module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/consensus/v1/params"; + } +} + +// QueryParamsRequest defines the request type for querying x/consensus parameters. +message QueryParamsRequest {} + +// QueryParamsResponse defines the response type for querying x/consensus parameters. +message QueryParamsResponse { + // params are the tendermint consensus params stored in the consensus module. + // Please note that `params.version` is not populated in this response, it is + // tracked separately in the x/upgrade module. + tendermint.types.ConsensusParams params = 1; +} diff --git a/proto/cosmos/consensus/v1/tx.proto b/proto/cosmos/consensus/v1/tx.proto new file mode 100644 index 0000000..4323de7 --- /dev/null +++ b/proto/cosmos/consensus/v1/tx.proto @@ -0,0 +1,46 @@ +// Since: cosmos-sdk 0.47 +syntax = "proto3"; +package cosmos.consensus.v1; + +import "amino/amino.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "tendermint/types/params.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/consensus/types"; + +// Msg defines the consensus Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // UpdateParams defines a governance operation for updating the x/consensus module parameters. + // The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/x/consensus/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/consensus parameters to update. + // VersionsParams is not included in this Msg because it is tracked + // separarately in x/upgrade. + // + // NOTE: All parameters must be supplied. + tendermint.types.BlockParams block = 2; + tendermint.types.EvidenceParams evidence = 3; + tendermint.types.ValidatorParams validator = 4; + + // Since: cosmos-sdk 0.50 + tendermint.types.ABCIParams abci = 5; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +message MsgUpdateParamsResponse {} diff --git a/proto/cosmos/crisis/v1beta1/genesis.proto b/proto/cosmos/crisis/v1beta1/genesis.proto index 5b0ff7e..b0ddb9b 100644 --- a/proto/cosmos/crisis/v1beta1/genesis.proto +++ b/proto/cosmos/crisis/v1beta1/genesis.proto @@ -5,11 +5,11 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/crisis/types"; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "amino/amino.proto"; // GenesisState defines the crisis module's genesis state. message GenesisState { // constant_fee is the fee used to verify the invariant in the crisis // module. - cosmos.base.v1beta1.Coin constant_fee = 3 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"constant_fee\""]; + cosmos.base.v1beta1.Coin constant_fee = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } diff --git a/proto/cosmos/crisis/v1beta1/tx.proto b/proto/cosmos/crisis/v1beta1/tx.proto index 26457ad..4fcf5bf 100644 --- a/proto/cosmos/crisis/v1beta1/tx.proto +++ b/proto/cosmos/crisis/v1beta1/tx.proto @@ -4,22 +4,62 @@ package cosmos.crisis.v1beta1; option go_package = "github.com/cosmos/cosmos-sdk/x/crisis/types"; import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; +import "cosmos/base/v1beta1/coin.proto"; // Msg defines the bank Msg service. service Msg { - // VerifyInvariant defines a method to verify a particular invariance. + option (cosmos.msg.v1.service) = true; + + // VerifyInvariant defines a method to verify a particular invariant. rpc VerifyInvariant(MsgVerifyInvariant) returns (MsgVerifyInvariantResponse); + + // UpdateParams defines a governance operation for updating the x/crisis module + // parameters. The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } // MsgVerifyInvariant represents a message to verify a particular invariance. message MsgVerifyInvariant { + option (cosmos.msg.v1.signer) = "sender"; + option (amino.name) = "cosmos-sdk/MsgVerifyInvariant"; + option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - string sender = 1; - string invariant_module_name = 2 [(gogoproto.moretags) = "yaml:\"invariant_module_name\""]; - string invariant_route = 3 [(gogoproto.moretags) = "yaml:\"invariant_route\""]; + // sender is the account address of private key to send coins to fee collector account. + string sender = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // name of the invariant module. + string invariant_module_name = 2; + + // invariant_route is the msg's invariant route. + string invariant_route = 3; } // MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. message MsgVerifyInvariantResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/x/crisis/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // constant_fee defines the x/crisis parameter. + cosmos.base.v1beta1.Coin constant_fee = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} diff --git a/proto/cosmos/crypto/ed25519/keys.proto b/proto/cosmos/crypto/ed25519/keys.proto index 6ffec34..3176807 100644 --- a/proto/cosmos/crypto/ed25519/keys.proto +++ b/proto/cosmos/crypto/ed25519/keys.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package cosmos.crypto.ed25519; +import "amino/amino.proto"; import "gogoproto/gogo.proto"; option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"; @@ -11,13 +12,28 @@ option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"; // ADR-28. Nevertheless, you will like to use ed25519 in app user level // then you must create a new proto message and follow ADR-28 for Address construction. message PubKey { + option (amino.name) = "tendermint/PubKeyEd25519"; + // The Amino encoding is simply the inner bytes field, and not the Amino + // encoding of the whole PubKey struct. + // + // Example (JSON): + // s := PubKey{Key: []byte{0x01}} + // out := AminoJSONEncoder(s) + // + // Then we have: + // out == `"MQ=="` + // out != `{"key":"MQ=="}` + option (amino.message_encoding) = "key_field"; option (gogoproto.goproto_stringer) = false; bytes key = 1 [(gogoproto.casttype) = "crypto/ed25519.PublicKey"]; } -// Deprecated: PrivKey defines a ed25519 private key. +// PrivKey defines a ed25519 private key. // NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context. message PrivKey { + option (amino.name) = "tendermint/PrivKeyEd25519"; + option (amino.message_encoding) = "key_field"; + bytes key = 1 [(gogoproto.casttype) = "crypto/ed25519.PrivateKey"]; } diff --git a/proto/cosmos/crypto/hd/v1/hd.proto b/proto/cosmos/crypto/hd/v1/hd.proto new file mode 100644 index 0000000..e25b70d --- /dev/null +++ b/proto/cosmos/crypto/hd/v1/hd.proto @@ -0,0 +1,27 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; +package cosmos.crypto.hd.v1; + +import "amino/amino.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/crypto/hd"; +option (gogoproto.goproto_getters_all) = false; + +// BIP44Params is used as path field in ledger item in Record. +message BIP44Params { + option (amino.name) = "crypto/keys/hd/BIP44Params"; + + option (gogoproto.goproto_stringer) = false; + // purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation + uint32 purpose = 1; + // coin_type is a constant that improves privacy + uint32 coin_type = 2; + // account splits the key space into independent user identities + uint32 account = 3; + // change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal + // chain. + bool change = 4; + // address_index is used as child index in BIP32 derivation + uint32 address_index = 5; +} diff --git a/proto/cosmos/crypto/keyring/v1/record.proto b/proto/cosmos/crypto/keyring/v1/record.proto new file mode 100644 index 0000000..e79ea7f --- /dev/null +++ b/proto/cosmos/crypto/keyring/v1/record.proto @@ -0,0 +1,48 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; +package cosmos.crypto.keyring.v1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "cosmos/crypto/hd/v1/hd.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/crypto/keyring"; +option (gogoproto.goproto_getters_all) = false; +option (gogoproto.gogoproto_import) = false; + +// Record is used for representing a key in the keyring. +message Record { + // name represents a name of Record + string name = 1; + // pub_key represents a public key in any format + google.protobuf.Any pub_key = 2; + + // Record contains one of the following items + oneof item { + // local stores the private key locally. + Local local = 3; + // ledger stores the information about a Ledger key. + Ledger ledger = 4; + // Multi does not store any other information. + Multi multi = 5; + // Offline does not store any other information. + Offline offline = 6; + } + + // Item is a keyring item stored in a keyring backend. + // Local item + message Local { + google.protobuf.Any priv_key = 1; + } + + // Ledger item + message Ledger { + hd.v1.BIP44Params path = 1; + } + + // Multi item + message Multi {} + + // Offline item + message Offline {} +} diff --git a/proto/cosmos/crypto/multisig/keys.proto b/proto/cosmos/crypto/multisig/keys.proto index f8398e8..fa0dec5 100644 --- a/proto/cosmos/crypto/multisig/keys.proto +++ b/proto/cosmos/crypto/multisig/keys.proto @@ -3,6 +3,7 @@ package cosmos.crypto.multisig; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/multisig"; @@ -10,9 +11,20 @@ option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/multisig"; // which nests multiple public keys and a threshold, // it uses legacy amino address rules. message LegacyAminoPubKey { + option (amino.name) = "tendermint/PubKeyMultisigThreshold"; + // The Amino encoding of a LegacyAminoPubkey is the legacy amino + // encoding of the `PubKeyMultisigThreshold` struct defined below: + // https://github.com/tendermint/tendermint/blob/v0.33.9/crypto/multisig/threshold_pubkey.go + // + // There are 2 differences with what a "normal" Amino encoding + // would output: + // 1. The `threshold` field is always a string (whereas Amino would + // by default marshal uint32 as a number). + // 2. The `public_keys` field is renamed to `pubkeys`, which is also + // reflected in the `amino.field_name` annotation. + option (amino.message_encoding) = "threshold_string"; option (gogoproto.goproto_getters) = false; - uint32 threshold = 1 [(gogoproto.moretags) = "yaml:\"threshold\""]; - repeated google.protobuf.Any public_keys = 2 - [(gogoproto.customname) = "PubKeys", (gogoproto.moretags) = "yaml:\"pubkeys\""]; + uint32 threshold = 1; + repeated google.protobuf.Any public_keys = 2 [(gogoproto.customname) = "PubKeys", (amino.field_name) = "pubkeys"]; } diff --git a/proto/cosmos/crypto/secp256k1/keys.proto b/proto/cosmos/crypto/secp256k1/keys.proto index a227257..e2358d6 100644 --- a/proto/cosmos/crypto/secp256k1/keys.proto +++ b/proto/cosmos/crypto/secp256k1/keys.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package cosmos.crypto.secp256k1; +import "amino/amino.proto"; import "gogoproto/gogo.proto"; option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"; @@ -11,6 +12,18 @@ option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"; // the x-coordinate. Otherwise the first byte is a 0x03. // This prefix is followed with the x-coordinate. message PubKey { + option (amino.name) = "tendermint/PubKeySecp256k1"; + // The Amino encoding is simply the inner bytes field, and not the Amino + // encoding of the whole PubKey struct. + // + // Example (JSON): + // s := PubKey{Key: []byte{0x01}} + // out := AminoJSONEncoder(s) + // + // Then we have: + // out == `"MQ=="` + // out != `{"key":"MQ=="}` + option (amino.message_encoding) = "key_field"; option (gogoproto.goproto_stringer) = false; bytes key = 1; @@ -18,5 +31,8 @@ message PubKey { // PrivKey defines a secp256k1 private key. message PrivKey { + option (amino.name) = "tendermint/PrivKeySecp256k1"; + option (amino.message_encoding) = "key_field"; + bytes key = 1; } diff --git a/proto/cosmos/distribution/v1beta1/distribution.proto b/proto/cosmos/distribution/v1beta1/distribution.proto index ae98ec0..0c20286 100644 --- a/proto/cosmos/distribution/v1beta1/distribution.proto +++ b/proto/cosmos/distribution/v1beta1/distribution.proto @@ -6,26 +6,41 @@ option (gogoproto.equal_all) = true; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; // Params defines the set of params for the distribution module. message Params { - option (gogoproto.goproto_stringer) = false; - string community_tax = 1 [ - (gogoproto.moretags) = "yaml:\"community_tax\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + option (amino.name) = "cosmos-sdk/x/distribution/Params"; + + string community_tax = 1 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (amino.dont_omitempty) = true, (gogoproto.nullable) = false ]; + + // Deprecated: The base_proposer_reward field is deprecated and is no longer used + // in the x/distribution module's reward mechanism. string base_proposer_reward = 2 [ - (gogoproto.moretags) = "yaml:\"base_proposer_reward\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + deprecated = true ]; + + // Deprecated: The bonus_proposer_reward field is deprecated and is no longer used + // in the x/distribution module's reward mechanism. string bonus_proposer_reward = 3 [ - (gogoproto.moretags) = "yaml:\"bonus_proposer_reward\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + deprecated = true ]; - bool withdraw_addr_enabled = 4 [(gogoproto.moretags) = "yaml:\"withdraw_addr_enabled\""]; + + bool withdraw_addr_enabled = 4; } // ValidatorHistoricalRewards represents historical rewards for a validator. @@ -42,36 +57,42 @@ message Params { // + one per validator for the zeroeth period, set on initialization message ValidatorHistoricalRewards { repeated cosmos.base.v1beta1.DecCoin cumulative_reward_ratio = 1 [ - (gogoproto.moretags) = "yaml:\"cumulative_reward_ratio\"", (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", - (gogoproto.nullable) = false + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true ]; - uint32 reference_count = 2 [(gogoproto.moretags) = "yaml:\"reference_count\""]; + uint32 reference_count = 2; } // ValidatorCurrentRewards represents current rewards and current // period for a validator kept as a running counter and incremented // each block as long as the validator's tokens remain constant. message ValidatorCurrentRewards { - repeated cosmos.base.v1beta1.DecCoin rewards = 1 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.DecCoin rewards = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; uint64 period = 2; } // ValidatorAccumulatedCommission represents accumulated commission // for a validator kept as a running counter, can be withdrawn at any time. message ValidatorAccumulatedCommission { - repeated cosmos.base.v1beta1.DecCoin commission = 1 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.DecCoin commission = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; } // ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards // for a validator inexpensive to track, allows simple sanity checks. message ValidatorOutstandingRewards { repeated cosmos.base.v1beta1.DecCoin rewards = 1 [ - (gogoproto.moretags) = "yaml:\"rewards\"", (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", - (gogoproto.nullable) = false + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true ]; } @@ -80,39 +101,51 @@ message ValidatorOutstandingRewards { // This is needed to calculate appropriate amount of staking tokens // for delegations which are withdrawn after a slash has occurred. message ValidatorSlashEvent { - uint64 validator_period = 1 [(gogoproto.moretags) = "yaml:\"validator_period\""]; - string fraction = 2 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + uint64 validator_period = 1; + string fraction = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; } // ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. message ValidatorSlashEvents { - option (gogoproto.goproto_stringer) = false; - repeated ValidatorSlashEvent validator_slash_events = 1 - [(gogoproto.moretags) = "yaml:\"validator_slash_events\"", (gogoproto.nullable) = false]; + repeated ValidatorSlashEvent validator_slash_events = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // FeePool is the global fee pool for distribution. message FeePool { repeated cosmos.base.v1beta1.DecCoin community_pool = 1 [ (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", - (gogoproto.moretags) = "yaml:\"community_pool\"" + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins" ]; } // CommunityPoolSpendProposal details a proposal for use of community funds, // together with how many coins are proposed to be spent, and to which // recipient account. +// +// Deprecated: Do not use. As of the Cosmos SDK release v0.47.x, there is no +// longer a need for an explicit CommunityPoolSpendProposal. To spend community +// pool funds, a simple MsgCommunityPoolSpend can be invoked from the x/gov +// module via a v1 governance proposal. message CommunityPoolSpendProposal { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; + option deprecated = true; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; string title = 1; string description = 2; string recipient = 3; - repeated cosmos.base.v1beta1.Coin amount = 4 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin amount = 4 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; } // DelegatorStartingInfo represents the starting info for a delegator reward @@ -122,36 +155,40 @@ message CommunityPoolSpendProposal { // the delegators within the validator may be left with less than a full token, // thus sdk.Dec is used. message DelegatorStartingInfo { - uint64 previous_period = 1 [(gogoproto.moretags) = "yaml:\"previous_period\""]; + uint64 previous_period = 1; string stake = 2 [ - (gogoproto.moretags) = "yaml:\"stake\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true ]; - uint64 height = 3 [(gogoproto.moretags) = "yaml:\"creation_height\"", (gogoproto.jsontag) = "creation_height"]; + uint64 height = 3 + [(gogoproto.jsontag) = "creation_height", (amino.field_name) = "creation_height", (amino.dont_omitempty) = true]; } // DelegationDelegatorReward represents the properties // of a delegator's delegation reward. message DelegationDelegatorReward { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = true; + option (gogoproto.goproto_getters) = false; - string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""]; + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; - repeated cosmos.base.v1beta1.DecCoin reward = 2 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.DecCoin reward = 2 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; } // CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal // with a deposit message CommunityPoolSpendProposalWithDeposit { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = true; - - string title = 1 [(gogoproto.moretags) = "yaml:\"title\""]; - string description = 2 [(gogoproto.moretags) = "yaml:\"description\""]; - string recipient = 3 [(gogoproto.moretags) = "yaml:\"recipient\""]; - string amount = 4 [(gogoproto.moretags) = "yaml:\"amount\""]; - string deposit = 5 [(gogoproto.moretags) = "yaml:\"deposit\""]; + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + string recipient = 3; + string amount = 4; + string deposit = 5; } diff --git a/proto/cosmos/distribution/v1beta1/genesis.proto b/proto/cosmos/distribution/v1beta1/genesis.proto index c0b17cd..5608bfb 100644 --- a/proto/cosmos/distribution/v1beta1/genesis.proto +++ b/proto/cosmos/distribution/v1beta1/genesis.proto @@ -7,6 +7,8 @@ option (gogoproto.equal_all) = true; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmos/distribution/v1beta1/distribution.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; // DelegatorWithdrawInfo is the address for where distributions rewards are // withdrawn to by default this struct is only used at genesis to feed in @@ -16,10 +18,10 @@ message DelegatorWithdrawInfo { option (gogoproto.goproto_getters) = false; // delegator_address is the address of the delegator. - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // withdraw_address is the address to withdraw the delegation rewards to. - string withdraw_address = 2 [(gogoproto.moretags) = "yaml:\"withdraw_address\""]; + string withdraw_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } // ValidatorOutstandingRewardsRecord is used for import/export via genesis json. @@ -28,13 +30,13 @@ message ValidatorOutstandingRewardsRecord { option (gogoproto.goproto_getters) = false; // validator_address is the address of the validator. - string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""]; + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; - // outstanding_rewards represents the oustanding rewards of a validator. + // outstanding_rewards represents the outstanding rewards of a validator. repeated cosmos.base.v1beta1.DecCoin outstanding_rewards = 2 [ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"outstanding_rewards\"" + (amino.dont_omitempty) = true ]; } @@ -45,11 +47,10 @@ message ValidatorAccumulatedCommissionRecord { option (gogoproto.goproto_getters) = false; // validator_address is the address of the validator. - string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""]; + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; // accumulated is the accumulated commission of a validator. - ValidatorAccumulatedCommission accumulated = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"accumulated\""]; + ValidatorAccumulatedCommission accumulated = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // ValidatorHistoricalRewardsRecord is used for import / export via genesis @@ -59,13 +60,13 @@ message ValidatorHistoricalRewardsRecord { option (gogoproto.goproto_getters) = false; // validator_address is the address of the validator. - string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""]; + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; // period defines the period the historical rewards apply to. uint64 period = 2; // rewards defines the historical rewards of a validator. - ValidatorHistoricalRewards rewards = 3 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"rewards\""]; + ValidatorHistoricalRewards rewards = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // ValidatorCurrentRewardsRecord is used for import / export via genesis json. @@ -74,10 +75,10 @@ message ValidatorCurrentRewardsRecord { option (gogoproto.goproto_getters) = false; // validator_address is the address of the validator. - string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""]; + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; // rewards defines the current rewards of a validator. - ValidatorCurrentRewards rewards = 2 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"rewards\""]; + ValidatorCurrentRewards rewards = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // DelegatorStartingInfoRecord used for import / export via genesis json. @@ -86,14 +87,13 @@ message DelegatorStartingInfoRecord { option (gogoproto.goproto_getters) = false; // delegator_address is the address of the delegator. - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // validator_address is the address of the validator. - string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; // starting_info defines the starting info of a delegator. - DelegatorStartingInfo starting_info = 3 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"starting_info\""]; + DelegatorStartingInfo starting_info = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // ValidatorSlashEventRecord is used for import / export via genesis json. @@ -102,13 +102,13 @@ message ValidatorSlashEventRecord { option (gogoproto.goproto_getters) = false; // validator_address is the address of the validator. - string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""]; - // height defines the block height at which the slash event occured. + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; + // height defines the block height at which the slash event occurred. uint64 height = 2; // period is the period of the slash event. uint64 period = 3; // validator_slash_event describes the slash event. - ValidatorSlashEvent validator_slash_event = 4 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"event\""]; + ValidatorSlashEvent validator_slash_event = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // GenesisState defines the distribution module's genesis state. @@ -116,40 +116,40 @@ message GenesisState { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - // params defines all the paramaters of the module. - Params params = 1 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"params\""]; + // params defines all the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // fee_pool defines the fee pool at genesis. - FeePool fee_pool = 2 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"fee_pool\""]; + FeePool fee_pool = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // fee_pool defines the delegator withdraw infos at genesis. repeated DelegatorWithdrawInfo delegator_withdraw_infos = 3 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"delegator_withdraw_infos\""]; + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // fee_pool defines the previous proposer at genesis. - string previous_proposer = 4 [(gogoproto.moretags) = "yaml:\"previous_proposer\""]; + string previous_proposer = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // fee_pool defines the outstanding rewards of all validators at genesis. repeated ValidatorOutstandingRewardsRecord outstanding_rewards = 5 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"outstanding_rewards\""]; + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - // fee_pool defines the accumulated commisions of all validators at genesis. + // fee_pool defines the accumulated commissions of all validators at genesis. repeated ValidatorAccumulatedCommissionRecord validator_accumulated_commissions = 6 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"validator_accumulated_commissions\""]; + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // fee_pool defines the historical rewards of all validators at genesis. repeated ValidatorHistoricalRewardsRecord validator_historical_rewards = 7 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"validator_historical_rewards\""]; + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // fee_pool defines the current rewards of all validators at genesis. repeated ValidatorCurrentRewardsRecord validator_current_rewards = 8 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"validator_current_rewards\""]; + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // fee_pool defines the delegator starting infos at genesis. repeated DelegatorStartingInfoRecord delegator_starting_infos = 9 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"delegator_starting_infos\""]; + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // fee_pool defines the validator slash events at genesis. repeated ValidatorSlashEventRecord validator_slash_events = 10 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"validator_slash_events\""]; + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } diff --git a/proto/cosmos/distribution/v1beta1/query.proto b/proto/cosmos/distribution/v1beta1/query.proto index 2991218..ffb8912 100644 --- a/proto/cosmos/distribution/v1beta1/query.proto +++ b/proto/cosmos/distribution/v1beta1/query.proto @@ -6,6 +6,8 @@ import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmos/distribution/v1beta1/distribution.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; @@ -16,6 +18,12 @@ service Query { option (google.api.http).get = "/cosmos/distribution/v1beta1/params"; } + // ValidatorDistributionInfo queries validator commission and self-delegation rewards for validator + rpc ValidatorDistributionInfo(QueryValidatorDistributionInfoRequest) + returns (QueryValidatorDistributionInfoResponse) { + option (google.api.http).get = "/cosmos/distribution/v1beta1/validators/{validator_address}"; + } + // ValidatorOutstandingRewards queries rewards of a validator address. rpc ValidatorOutstandingRewards(QueryValidatorOutstandingRewardsRequest) returns (QueryValidatorOutstandingRewardsResponse) { @@ -40,7 +48,7 @@ service Query { "{validator_address}"; } - // DelegationTotalRewards queries the total rewards accrued by a each + // DelegationTotalRewards queries the total rewards accrued by each // validator. rpc DelegationTotalRewards(QueryDelegationTotalRewardsRequest) returns (QueryDelegationTotalRewardsResponse) { option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards"; @@ -70,44 +78,64 @@ 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]; + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryValidatorDistributionInfoRequest is the request type for the Query/ValidatorDistributionInfo RPC method. +message QueryValidatorDistributionInfoRequest { + // validator_address defines the validator address to query for. + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; +} + +// QueryValidatorDistributionInfoResponse is the response type for the Query/ValidatorDistributionInfo RPC method. +message QueryValidatorDistributionInfoResponse { + // operator_address defines the validator operator address. + string operator_address = 1 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; + // self_bond_rewards defines the self delegations rewards. + repeated cosmos.base.v1beta1.DecCoin self_bond_rewards = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins" + ]; + // commission defines the commission the validator received. + repeated cosmos.base.v1beta1.DecCoin commission = 3 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; } // QueryValidatorOutstandingRewardsRequest is the request type for the // Query/ValidatorOutstandingRewards RPC method. message QueryValidatorOutstandingRewardsRequest { // validator_address defines the validator address to query for. - string validator_address = 1; + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; } // QueryValidatorOutstandingRewardsResponse is the response type for the // Query/ValidatorOutstandingRewards RPC method. message QueryValidatorOutstandingRewardsResponse { - ValidatorOutstandingRewards rewards = 1 [(gogoproto.nullable) = false]; + ValidatorOutstandingRewards rewards = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QueryValidatorCommissionRequest is the request type for the // Query/ValidatorCommission RPC method message QueryValidatorCommissionRequest { // validator_address defines the validator address to query for. - string validator_address = 1; + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; } // QueryValidatorCommissionResponse is the response type for the // Query/ValidatorCommission RPC method message QueryValidatorCommissionResponse { - // commission defines the commision the validator received. - ValidatorAccumulatedCommission commission = 1 [(gogoproto.nullable) = false]; + // commission defines the commission the validator received. + ValidatorAccumulatedCommission commission = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QueryValidatorSlashesRequest is the request type for the // Query/ValidatorSlashes RPC method message QueryValidatorSlashesRequest { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = true; + option (gogoproto.goproto_getters) = false; // validator_address defines the validator address to query for. - string validator_address = 1; + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; // starting_height defines the optional starting height to query the slashes. uint64 starting_height = 2; // starting_height defines the optional ending height to query the slashes. @@ -120,7 +148,7 @@ message QueryValidatorSlashesRequest { // Query/ValidatorSlashes RPC method. message QueryValidatorSlashesResponse { // slashes defines the slashes the validator received. - repeated ValidatorSlashEvent slashes = 1 [(gogoproto.nullable) = false]; + repeated ValidatorSlashEvent slashes = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -133,17 +161,20 @@ message QueryDelegationRewardsRequest { option (gogoproto.goproto_getters) = false; // delegator_address defines the delegator address to query for. - string delegator_address = 1; + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // validator_address defines the validator address to query for. - string validator_address = 2; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; } // QueryDelegationRewardsResponse is the response type for the // Query/DelegationRewards RPC method. message QueryDelegationRewardsResponse { // rewards defines the rewards accrued by a delegation. - repeated cosmos.base.v1beta1.DecCoin rewards = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"]; + repeated cosmos.base.v1beta1.DecCoin rewards = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins" + ]; } // QueryDelegationTotalRewardsRequest is the request type for the @@ -152,17 +183,20 @@ message QueryDelegationTotalRewardsRequest { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; // delegator_address defines the delegator address to query for. - string delegator_address = 1; + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } // QueryDelegationTotalRewardsResponse is the response type for the // Query/DelegationTotalRewards RPC method. message QueryDelegationTotalRewardsResponse { // rewards defines all the rewards accrued by a delegator. - repeated DelegationDelegatorReward rewards = 1 [(gogoproto.nullable) = false]; + repeated DelegationDelegatorReward rewards = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // total defines the sum of all the rewards. - repeated cosmos.base.v1beta1.DecCoin total = 2 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"]; + repeated cosmos.base.v1beta1.DecCoin total = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins" + ]; } // QueryDelegatorValidatorsRequest is the request type for the @@ -172,7 +206,7 @@ message QueryDelegatorValidatorsRequest { option (gogoproto.goproto_getters) = false; // delegator_address defines the delegator address to query for. - string delegator_address = 1; + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } // QueryDelegatorValidatorsResponse is the response type for the @@ -192,7 +226,7 @@ message QueryDelegatorWithdrawAddressRequest { option (gogoproto.goproto_getters) = false; // delegator_address defines the delegator address to query for. - string delegator_address = 1; + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } // QueryDelegatorWithdrawAddressResponse is the response type for the @@ -202,7 +236,7 @@ message QueryDelegatorWithdrawAddressResponse { option (gogoproto.goproto_getters) = false; // withdraw_address defines the delegator address to query for. - string withdraw_address = 1; + string withdraw_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } // QueryCommunityPoolRequest is the request type for the Query/CommunityPool RPC @@ -213,6 +247,9 @@ message QueryCommunityPoolRequest {} // RPC method. message QueryCommunityPoolResponse { // pool defines community pool's coins. - repeated cosmos.base.v1beta1.DecCoin pool = 1 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; + repeated cosmos.base.v1beta1.DecCoin pool = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; } diff --git a/proto/cosmos/distribution/v1beta1/tx.proto b/proto/cosmos/distribution/v1beta1/tx.proto index e6ce478..32318bd 100644 --- a/proto/cosmos/distribution/v1beta1/tx.proto +++ b/proto/cosmos/distribution/v1beta1/tx.proto @@ -6,9 +6,15 @@ option (gogoproto.equal_all) = true; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; +import "cosmos/distribution/v1beta1/distribution.proto"; // Msg defines the distribution Msg service. service Msg { + option (cosmos.msg.v1.service) = true; + // SetWithdrawAddress defines a method to change the withdraw address // for a delegator (or validator self-delegation). rpc SetWithdrawAddress(MsgSetWithdrawAddress) returns (MsgSetWithdrawAddressResponse); @@ -24,56 +30,186 @@ service Msg { // FundCommunityPool defines a method to allow an account to directly // fund the community pool. rpc FundCommunityPool(MsgFundCommunityPool) returns (MsgFundCommunityPoolResponse); + + // UpdateParams defines a governance operation for updating the x/distribution + // module parameters. The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + + // CommunityPoolSpend defines a governance operation for sending tokens from + // the community pool in the x/distribution module to another account, which + // could be the governance module itself. The authority is defined in the + // keeper. + // + // Since: cosmos-sdk 0.47 + rpc CommunityPoolSpend(MsgCommunityPoolSpend) returns (MsgCommunityPoolSpendResponse); + + // DepositValidatorRewardsPool defines a method to provide additional rewards + // to delegators to a specific validator. + // + // Since: cosmos-sdk 0.50 + rpc DepositValidatorRewardsPool(MsgDepositValidatorRewardsPool) returns (MsgDepositValidatorRewardsPoolResponse); } // MsgSetWithdrawAddress sets the withdraw address for // a delegator (or validator self-delegation). message MsgSetWithdrawAddress { + option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "cosmos-sdk/MsgModifyWithdrawAddress"; + option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - string withdraw_address = 2 [(gogoproto.moretags) = "yaml:\"withdraw_address\""]; + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string withdraw_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } -// MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. +// MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response +// type. message MsgSetWithdrawAddressResponse {} // MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator // from a single validator. message MsgWithdrawDelegatorReward { + option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "cosmos-sdk/MsgWithdrawDelegationReward"; + option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""]; + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; } -// MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. -message MsgWithdrawDelegatorRewardResponse {} +// MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward +// response type. +message MsgWithdrawDelegatorRewardResponse { + // Since: cosmos-sdk 0.46 + repeated cosmos.base.v1beta1.Coin amount = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} // MsgWithdrawValidatorCommission withdraws the full commission to the validator // address. message MsgWithdrawValidatorCommission { + option (cosmos.msg.v1.signer) = "validator_address"; + option (amino.name) = "cosmos-sdk/MsgWithdrawValCommission"; + option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""]; + string validator_address = 1 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; } -// MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. -message MsgWithdrawValidatorCommissionResponse {} +// MsgWithdrawValidatorCommissionResponse defines the +// Msg/WithdrawValidatorCommission response type. +message MsgWithdrawValidatorCommissionResponse { + // Since: cosmos-sdk 0.46 + repeated cosmos.base.v1beta1.Coin amount = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} // MsgFundCommunityPool allows an account to directly // fund the community pool. message MsgFundCommunityPool { + option (cosmos.msg.v1.signer) = "depositor"; + option (amino.name) = "cosmos-sdk/MsgFundCommunityPool"; + option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - repeated cosmos.base.v1beta1.Coin amount = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; - string depositor = 2; + repeated cosmos.base.v1beta1.Coin amount = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } // MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. message MsgFundCommunityPoolResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/distribution/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/distribution parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} + +// MsgCommunityPoolSpend defines a message for sending tokens from the community +// pool to another account. This message is typically executed via a governance +// proposal with the governance module being the executing authority. +// +// Since: cosmos-sdk 0.47 +message MsgCommunityPoolSpend { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/distr/MsgCommunityPoolSpend"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string recipient = 2; + repeated cosmos.base.v1beta1.Coin amount = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// MsgCommunityPoolSpendResponse defines the response to executing a +// MsgCommunityPoolSpend message. +// +// Since: cosmos-sdk 0.47 +message MsgCommunityPoolSpendResponse {} + +// DepositValidatorRewardsPool defines the request structure to provide +// additional rewards to delegators from a specific validator. +// +// Since: cosmos-sdk 0.50 +message MsgDepositValidatorRewardsPool { + option (amino.name) = "cosmos-sdk/distr/MsgDepositValRewards"; + option (cosmos.msg.v1.signer) = "depositor"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string depositor = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; + repeated cosmos.base.v1beta1.Coin amount = 3 [ + (gogoproto.nullable) = false, + (amino.encoding) = "legacy_coins", + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// MsgDepositValidatorRewardsPoolResponse defines the response to executing a +// MsgDepositValidatorRewardsPool message. +// +// Since: cosmos-sdk 0.50 +message MsgDepositValidatorRewardsPoolResponse {} diff --git a/proto/cosmos/evidence/v1beta1/evidence.proto b/proto/cosmos/evidence/v1beta1/evidence.proto index 14612c3..21b2c5d 100644 --- a/proto/cosmos/evidence/v1beta1/evidence.proto +++ b/proto/cosmos/evidence/v1beta1/evidence.proto @@ -1,21 +1,31 @@ syntax = "proto3"; package cosmos.evidence.v1beta1; -option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; +option go_package = "cosmossdk.io/x/evidence/types"; option (gogoproto.equal_all) = true; +import "amino/amino.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; +import "cosmos_proto/cosmos.proto"; // Equivocation implements the Evidence interface and defines evidence of double // signing misbehavior. message Equivocation { - option (gogoproto.goproto_stringer) = false; - option (gogoproto.goproto_getters) = false; - option (gogoproto.equal) = false; + option (amino.name) = "cosmos-sdk/Equivocation"; + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = false; - int64 height = 1; - google.protobuf.Timestamp time = 2 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - int64 power = 3; - string consensus_address = 4 [(gogoproto.moretags) = "yaml:\"consensus_address\""]; + // height is the equivocation height. + int64 height = 1; + + // time is the equivocation time. + google.protobuf.Timestamp time = 2 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; + + // power is the equivocation validator power. + int64 power = 3; + + // consensus_address is the equivocation validator consensus address. + string consensus_address = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } \ No newline at end of file diff --git a/proto/cosmos/evidence/v1beta1/genesis.proto b/proto/cosmos/evidence/v1beta1/genesis.proto index 199f446..33b354e 100644 --- a/proto/cosmos/evidence/v1beta1/genesis.proto +++ b/proto/cosmos/evidence/v1beta1/genesis.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package cosmos.evidence.v1beta1; -option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; +option go_package = "cosmossdk.io/x/evidence/types"; import "google/protobuf/any.proto"; diff --git a/proto/cosmos/evidence/v1beta1/query.proto b/proto/cosmos/evidence/v1beta1/query.proto index eda0054..f4af8ab 100644 --- a/proto/cosmos/evidence/v1beta1/query.proto +++ b/proto/cosmos/evidence/v1beta1/query.proto @@ -2,17 +2,16 @@ syntax = "proto3"; package cosmos.evidence.v1beta1; import "cosmos/base/query/v1beta1/pagination.proto"; -import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "google/api/annotations.proto"; -option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; +option go_package = "cosmossdk.io/x/evidence/types"; // Query defines the gRPC querier service. service Query { // Evidence queries evidence based on evidence hash. rpc Evidence(QueryEvidenceRequest) returns (QueryEvidenceResponse) { - option (google.api.http).get = "/cosmos/evidence/v1beta1/evidence/{evidence_hash}"; + option (google.api.http).get = "/cosmos/evidence/v1beta1/evidence/{hash}"; } // AllEvidence queries all evidence. @@ -24,7 +23,13 @@ service Query { // QueryEvidenceRequest is the request type for the Query/Evidence RPC method. message QueryEvidenceRequest { // evidence_hash defines the hash of the requested evidence. - bytes evidence_hash = 1 [(gogoproto.casttype) = "github.com/tendermint/tendermint/libs/bytes.HexBytes"]; + // Deprecated: Use hash, a HEX encoded string, instead. + bytes evidence_hash = 1 [deprecated = true]; + + // hash defines the evidence hash of the requested evidence. + // + // Since: cosmos-sdk 0.47 + string hash = 2; } // QueryEvidenceResponse is the response type for the Query/Evidence RPC method. diff --git a/proto/cosmos/evidence/v1beta1/tx.proto b/proto/cosmos/evidence/v1beta1/tx.proto index 38795f2..5eeaa6e 100644 --- a/proto/cosmos/evidence/v1beta1/tx.proto +++ b/proto/cosmos/evidence/v1beta1/tx.proto @@ -1,15 +1,19 @@ syntax = "proto3"; package cosmos.evidence.v1beta1; -option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; +option go_package = "cosmossdk.io/x/evidence/types"; option (gogoproto.equal_all) = true; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; // Msg defines the evidence Msg service. service Msg { + option (cosmos.msg.v1.service) = true; + // SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or // counterfactual signing. rpc SubmitEvidence(MsgSubmitEvidence) returns (MsgSubmitEvidenceResponse); @@ -18,11 +22,17 @@ service Msg { // MsgSubmitEvidence represents a message that supports submitting arbitrary // Evidence of misbehavior such as equivocation or counterfactual signing. message MsgSubmitEvidence { + option (cosmos.msg.v1.signer) = "submitter"; + option (amino.name) = "cosmos-sdk/MsgSubmitEvidence"; + option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - string submitter = 1; - google.protobuf.Any evidence = 2 [(cosmos_proto.accepts_interface) = "Evidence"]; + // submitter is the signer account address of evidence. + string submitter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // evidence defines the evidence of misbehavior. + google.protobuf.Any evidence = 2 [(cosmos_proto.accepts_interface) = "cosmos.evidence.v1beta1.Evidence"]; } // MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. diff --git a/proto/cosmos/feegrant/v1beta1/feegrant.proto b/proto/cosmos/feegrant/v1beta1/feegrant.proto index a86691f..a1c67ea 100644 --- a/proto/cosmos/feegrant/v1beta1/feegrant.proto +++ b/proto/cosmos/feegrant/v1beta1/feegrant.proto @@ -6,21 +6,27 @@ import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "amino/amino.proto"; import "google/protobuf/timestamp.proto"; import "google/protobuf/duration.proto"; -option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; +option go_package = "cosmossdk.io/x/feegrant"; -// BasicAllowance implements Allowance with a one-time grant of tokens +// BasicAllowance implements Allowance with a one-time grant of coins // that optionally expires. The grantee can use up to SpendLimit to cover fees. message BasicAllowance { - option (cosmos_proto.implements_interface) = "FeeAllowanceI"; + option (cosmos_proto.implements_interface) = "cosmos.feegrant.v1beta1.FeeAllowanceI"; + option (amino.name) = "cosmos-sdk/BasicAllowance"; - // spend_limit specifies the maximum amount of tokens that can be spent - // by this allowance and will be updated as tokens are spent. If it is + // spend_limit specifies the maximum amount of coins that can be spent + // by this allowance and will be updated as coins are spent. If it is // empty, there is no spend limit and any amount of coins can be spent. - repeated cosmos.base.v1beta1.Coin spend_limit = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin spend_limit = 1 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; // expiration specifies an optional time when this allowance expires google.protobuf.Timestamp expiration = 2 [(gogoproto.stdtime) = true]; @@ -29,37 +35,49 @@ message BasicAllowance { // PeriodicAllowance extends Allowance to allow for both a maximum cap, // as well as a limit per time period. message PeriodicAllowance { - option (cosmos_proto.implements_interface) = "FeeAllowanceI"; + option (cosmos_proto.implements_interface) = "cosmos.feegrant.v1beta1.FeeAllowanceI"; + option (amino.name) = "cosmos-sdk/PeriodicAllowance"; // basic specifies a struct of `BasicAllowance` - BasicAllowance basic = 1 [(gogoproto.nullable) = false]; + BasicAllowance basic = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // period specifies the time duration in which period_spend_limit coins can // be spent before that allowance is reset - google.protobuf.Duration period = 2 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; + google.protobuf.Duration period = 2 + [(gogoproto.stdduration) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // period_spend_limit specifies the maximum number of coins that can be spent // in the period - repeated cosmos.base.v1beta1.Coin period_spend_limit = 3 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin period_spend_limit = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; // period_can_spend is the number of coins left to be spent before the period_reset time - repeated cosmos.base.v1beta1.Coin period_can_spend = 4 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin period_can_spend = 4 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; // period_reset is the time at which this period resets and a new one begins, // it is calculated from the start time of the first transaction after the // last period ended - google.protobuf.Timestamp period_reset = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp period_reset = 5 + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // AllowedMsgAllowance creates allowance only for specified message types. message AllowedMsgAllowance { option (gogoproto.goproto_getters) = false; - option (cosmos_proto.implements_interface) = "FeeAllowanceI"; + option (cosmos_proto.implements_interface) = "cosmos.feegrant.v1beta1.FeeAllowanceI"; + option (amino.name) = "cosmos-sdk/AllowedMsgAllowance"; - // allowance can be any of basic and filtered fee allowance. - google.protobuf.Any allowance = 1 [(cosmos_proto.accepts_interface) = "FeeAllowanceI"]; + // allowance can be any of basic and periodic fee allowance. + google.protobuf.Any allowance = 1 [(cosmos_proto.accepts_interface) = "cosmos.feegrant.v1beta1.FeeAllowanceI"]; // allowed_messages are the messages for which the grantee has the access. repeated string allowed_messages = 2; @@ -68,11 +86,11 @@ message AllowedMsgAllowance { // Grant is stored in the KVStore to record a grant with full context message Grant { // granter is the address of the user granting an allowance of their funds. - string granter = 1; + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // grantee is the address of the user being granted an allowance of another user's funds. - string grantee = 2; + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // allowance can be any of basic and filtered fee allowance. - google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "FeeAllowanceI"]; + // allowance can be any of basic, periodic, allowed fee allowance. + google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "cosmos.feegrant.v1beta1.FeeAllowanceI"]; } diff --git a/proto/cosmos/feegrant/v1beta1/genesis.proto b/proto/cosmos/feegrant/v1beta1/genesis.proto index 5b1ac4c..ac7e57e 100644 --- a/proto/cosmos/feegrant/v1beta1/genesis.proto +++ b/proto/cosmos/feegrant/v1beta1/genesis.proto @@ -4,10 +4,11 @@ package cosmos.feegrant.v1beta1; import "gogoproto/gogo.proto"; import "cosmos/feegrant/v1beta1/feegrant.proto"; +import "amino/amino.proto"; -option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; +option go_package = "cosmossdk.io/x/feegrant"; // GenesisState contains a set of fee allowances, persisted from the store message GenesisState { - repeated Grant allowances = 1 [(gogoproto.nullable) = false]; + repeated Grant allowances = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } diff --git a/proto/cosmos/feegrant/v1beta1/query.proto b/proto/cosmos/feegrant/v1beta1/query.proto index 42d7a84..591537a 100644 --- a/proto/cosmos/feegrant/v1beta1/query.proto +++ b/proto/cosmos/feegrant/v1beta1/query.proto @@ -5,24 +5,26 @@ package cosmos.feegrant.v1beta1; import "cosmos/feegrant/v1beta1/feegrant.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; import "google/api/annotations.proto"; +import "cosmos_proto/cosmos.proto"; -option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; +option go_package = "cosmossdk.io/x/feegrant"; // Query defines the gRPC querier service. service Query { - // Allowance returns fee granted to the grantee by the granter. + // Allowance returns granted allwance to the grantee by the granter. rpc Allowance(QueryAllowanceRequest) returns (QueryAllowanceResponse) { option (google.api.http).get = "/cosmos/feegrant/v1beta1/allowance/{granter}/{grantee}"; } - // Allowances returns all the grants for address. + // Allowances returns all the grants for the given grantee address. rpc Allowances(QueryAllowancesRequest) returns (QueryAllowancesResponse) { option (google.api.http).get = "/cosmos/feegrant/v1beta1/allowances/{grantee}"; } // AllowancesByGranter returns all the grants given by an address - // Since v0.46 + // + // Since: cosmos-sdk 0.46 rpc AllowancesByGranter(QueryAllowancesByGranterRequest) returns (QueryAllowancesByGranterResponse) { option (google.api.http).get = "/cosmos/feegrant/v1beta1/issued/{granter}"; } @@ -31,10 +33,10 @@ service Query { // QueryAllowanceRequest is the request type for the Query/Allowance RPC method. message QueryAllowanceRequest { // granter is the address of the user granting an allowance of their funds. - string granter = 1; + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // grantee is the address of the user being granted an allowance of another user's funds. - string grantee = 2; + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } // QueryAllowanceResponse is the response type for the Query/Allowance RPC method. @@ -45,7 +47,7 @@ message QueryAllowanceResponse { // QueryAllowancesRequest is the request type for the Query/Allowances RPC method. message QueryAllowancesRequest { - string grantee = 1; + string grantee = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // pagination defines an pagination for the request. cosmos.base.query.v1beta1.PageRequest pagination = 2; @@ -61,14 +63,18 @@ message QueryAllowancesResponse { } // QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. +// +// Since: cosmos-sdk 0.46 message QueryAllowancesByGranterRequest { - string granter = 1; + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // pagination defines an pagination for the request. cosmos.base.query.v1beta1.PageRequest pagination = 2; } // QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. +// +// Since: cosmos-sdk 0.46 message QueryAllowancesByGranterResponse { // allowances that have been issued by the granter. repeated cosmos.feegrant.v1beta1.Grant allowances = 1; diff --git a/proto/cosmos/feegrant/v1beta1/tx.proto b/proto/cosmos/feegrant/v1beta1/tx.proto index 2d875e9..a45eec3 100644 --- a/proto/cosmos/feegrant/v1beta1/tx.proto +++ b/proto/cosmos/feegrant/v1beta1/tx.proto @@ -2,14 +2,16 @@ syntax = "proto3"; package cosmos.feegrant.v1beta1; -import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; -option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; +option go_package = "cosmossdk.io/x/feegrant"; // Msg defines the feegrant msg service. service Msg { + option (cosmos.msg.v1.service) = true; // GrantAllowance grants fee allowance to the grantee on the granter's // account with the provided expiration time. @@ -18,19 +20,27 @@ service Msg { // RevokeAllowance revokes any fee allowance of granter's account that // has been granted to the grantee. rpc RevokeAllowance(MsgRevokeAllowance) returns (MsgRevokeAllowanceResponse); + + // PruneAllowances prunes expired fee allowances, currently up to 75 at a time. + // + // Since cosmos-sdk 0.50 + rpc PruneAllowances(MsgPruneAllowances) returns (MsgPruneAllowancesResponse); } // MsgGrantAllowance adds permission for Grantee to spend up to Allowance // of fees from the account of Granter. message MsgGrantAllowance { + option (cosmos.msg.v1.signer) = "granter"; + option (amino.name) = "cosmos-sdk/MsgGrantAllowance"; + // granter is the address of the user granting an allowance of their funds. - string granter = 1; + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // grantee is the address of the user being granted an allowance of another user's funds. - string grantee = 2; + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // allowance can be any of basic and filtered fee allowance. - google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "FeeAllowanceI"]; + // allowance can be any of basic, periodic, allowed fee allowance. + google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "cosmos.feegrant.v1beta1.FeeAllowanceI"]; } // MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. @@ -38,12 +48,30 @@ message MsgGrantAllowanceResponse {} // MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. message MsgRevokeAllowance { + option (cosmos.msg.v1.signer) = "granter"; + option (amino.name) = "cosmos-sdk/MsgRevokeAllowance"; + // granter is the address of the user granting an allowance of their funds. - string granter = 1; + string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // grantee is the address of the user being granted an allowance of another user's funds. - string grantee = 2; + string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } // MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. message MsgRevokeAllowanceResponse {} + +// MsgPruneAllowances prunes expired fee allowances. +// +// Since cosmos-sdk 0.50 +message MsgPruneAllowances { + option (cosmos.msg.v1.signer) = "pruner"; + + // pruner is the address of the user pruning expired allowances. + string pruner = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgPruneAllowancesResponse defines the Msg/PruneAllowancesResponse response type. +// +// Since cosmos-sdk 0.50 +message MsgPruneAllowancesResponse {} \ No newline at end of file diff --git a/proto/cosmos/genutil/v1beta1/genesis.proto b/proto/cosmos/genutil/v1beta1/genesis.proto index a020779..dfd3494 100644 --- a/proto/cosmos/genutil/v1beta1/genesis.proto +++ b/proto/cosmos/genutil/v1beta1/genesis.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package cosmos.genutil.v1beta1; import "gogoproto/gogo.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/genutil/types"; @@ -9,8 +10,9 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/genutil/types"; message GenesisState { // gen_txs defines the genesis transactions. repeated bytes gen_txs = 1 [ - (gogoproto.casttype) = "encoding/json.RawMessage", - (gogoproto.jsontag) = "gentxs", - (gogoproto.moretags) = "yaml:\"gentxs\"" + (gogoproto.casttype) = "encoding/json.RawMessage", + (gogoproto.jsontag) = "gentxs", + (amino.field_name) = "gentxs", + (amino.dont_omitempty) = true ]; -} +} \ No newline at end of file diff --git a/proto/cosmos/gov/v1/genesis.proto b/proto/cosmos/gov/v1/genesis.proto new file mode 100644 index 0000000..1398b33 --- /dev/null +++ b/proto/cosmos/gov/v1/genesis.proto @@ -0,0 +1,40 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; + +package cosmos.gov.v1; + +import "cosmos/gov/v1/gov.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1"; + +// GenesisState defines the gov module's genesis state. +message GenesisState { + // starting_proposal_id is the ID of the starting proposal. + uint64 starting_proposal_id = 1; + // deposits defines all the deposits present at genesis. + repeated Deposit deposits = 2; + // votes defines all the votes present at genesis. + repeated Vote votes = 3; + // proposals defines all the proposals present at genesis. + repeated Proposal proposals = 4; + // Deprecated: Prefer to use `params` instead. + // deposit_params defines all the paramaters of related to deposit. + DepositParams deposit_params = 5 [deprecated = true]; + // Deprecated: Prefer to use `params` instead. + // voting_params defines all the paramaters of related to voting. + VotingParams voting_params = 6 [deprecated = true]; + // Deprecated: Prefer to use `params` instead. + // tally_params defines all the paramaters of related to tally. + TallyParams tally_params = 7 [deprecated = true]; + // params defines all the paramaters of x/gov module. + // + // Since: cosmos-sdk 0.47 + Params params = 8; + // The constitution allows builders to lay a foundation and define purpose. + // This is an immutable string set in genesis. + // There are no amendments, to go outside of scope, just fork. + // constitution is an immutable string in genesis for a chain builder to lay out their vision, ideas and ideals. + // + // Since: cosmos-sdk 0.50 + string constitution = 9; +} diff --git a/proto/cosmos/gov/v1/gov.proto b/proto/cosmos/gov/v1/gov.proto new file mode 100644 index 0000000..0ebfbc1 --- /dev/null +++ b/proto/cosmos/gov/v1/gov.proto @@ -0,0 +1,271 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; +package cosmos.gov.v1; + +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/duration.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1"; + +// VoteOption enumerates the valid vote options for a given governance proposal. +enum VoteOption { + // VOTE_OPTION_UNSPECIFIED defines a no-op vote option. + VOTE_OPTION_UNSPECIFIED = 0; + // VOTE_OPTION_YES defines a yes vote option. + VOTE_OPTION_YES = 1; + // VOTE_OPTION_ABSTAIN defines an abstain vote option. + VOTE_OPTION_ABSTAIN = 2; + // VOTE_OPTION_NO defines a no vote option. + VOTE_OPTION_NO = 3; + // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + VOTE_OPTION_NO_WITH_VETO = 4; +} + +// WeightedVoteOption defines a unit of vote for vote split. +message WeightedVoteOption { + // option defines the valid vote options, it must not contain duplicate vote options. + VoteOption option = 1; + + // weight is the vote weight associated with the vote option. + string weight = 2 [(cosmos_proto.scalar) = "cosmos.Dec"]; +} + +// Deposit defines an amount deposited by an account address to an active +// proposal. +message Deposit { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // depositor defines the deposit addresses from the proposals. + string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // amount to be deposited by depositor. + repeated cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// Proposal defines the core field members of a governance proposal. +message Proposal { + // id defines the unique id of the proposal. + uint64 id = 1; + + // messages are the arbitrary messages to be executed if the proposal passes. + repeated google.protobuf.Any messages = 2; + + // status defines the proposal status. + ProposalStatus status = 3; + + // final_tally_result is the final tally result of the proposal. When + // querying a proposal via gRPC, this field is not populated until the + // proposal's voting period has ended. + TallyResult final_tally_result = 4; + + // submit_time is the time of proposal submission. + google.protobuf.Timestamp submit_time = 5 [(gogoproto.stdtime) = true]; + + // deposit_end_time is the end time for deposition. + google.protobuf.Timestamp deposit_end_time = 6 [(gogoproto.stdtime) = true]; + + // total_deposit is the total deposit on the proposal. + repeated cosmos.base.v1beta1.Coin total_deposit = 7 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // voting_start_time is the starting time to vote on a proposal. + google.protobuf.Timestamp voting_start_time = 8 [(gogoproto.stdtime) = true]; + + // voting_end_time is the end time of voting on a proposal. + google.protobuf.Timestamp voting_end_time = 9 [(gogoproto.stdtime) = true]; + + // metadata is any arbitrary metadata attached to the proposal. + // the recommended format of the metadata is to be found here: + // https://docs.cosmos.network/v0.47/modules/gov#proposal-3 + string metadata = 10; + + // title is the title of the proposal + // + // Since: cosmos-sdk 0.47 + string title = 11; + + // summary is a short summary of the proposal + // + // Since: cosmos-sdk 0.47 + string summary = 12; + + // proposer is the address of the proposal sumbitter + // + // Since: cosmos-sdk 0.47 + string proposer = 13 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // expedited defines if the proposal is expedited + // + // Since: cosmos-sdk 0.50 + bool expedited = 14; + + // failed_reason defines the reason why the proposal failed + // + // Since: cosmos-sdk 0.50 + string failed_reason = 15; +} + +// ProposalStatus enumerates the valid statuses of a proposal. +enum ProposalStatus { + // PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. + PROPOSAL_STATUS_UNSPECIFIED = 0; + // PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + // period. + PROPOSAL_STATUS_DEPOSIT_PERIOD = 1; + // PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + // period. + PROPOSAL_STATUS_VOTING_PERIOD = 2; + // PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + // passed. + PROPOSAL_STATUS_PASSED = 3; + // PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + // been rejected. + PROPOSAL_STATUS_REJECTED = 4; + // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + // failed. + PROPOSAL_STATUS_FAILED = 5; +} + +// TallyResult defines a standard tally for a governance proposal. +message TallyResult { + // yes_count is the number of yes votes on a proposal. + string yes_count = 1 [(cosmos_proto.scalar) = "cosmos.Int"]; + // abstain_count is the number of abstain votes on a proposal. + string abstain_count = 2 [(cosmos_proto.scalar) = "cosmos.Int"]; + // no_count is the number of no votes on a proposal. + string no_count = 3 [(cosmos_proto.scalar) = "cosmos.Int"]; + // no_with_veto_count is the number of no with veto votes on a proposal. + string no_with_veto_count = 4 [(cosmos_proto.scalar) = "cosmos.Int"]; +} + +// Vote defines a vote on a governance proposal. +// A Vote consists of a proposal ID, the voter, and the vote option. +message Vote { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // voter is the voter address of the proposal. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + reserved 3; + + // options is the weighted vote options. + repeated WeightedVoteOption options = 4; + + // metadata is any arbitrary metadata attached to the vote. + // the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/gov#vote-5 + string metadata = 5; +} + +// DepositParams defines the params for deposits on governance proposals. +message DepositParams { + option deprecated = true; + + // Minimum deposit for a proposal to enter voting period. + repeated cosmos.base.v1beta1.Coin min_deposit = 1 + [(gogoproto.nullable) = false, (gogoproto.jsontag) = "min_deposit,omitempty"]; + + // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + // months. + google.protobuf.Duration max_deposit_period = 2 + [(gogoproto.stdduration) = true, (gogoproto.jsontag) = "max_deposit_period,omitempty"]; +} + +// VotingParams defines the params for voting on governance proposals. +message VotingParams { + option deprecated = true; + + // Duration of the voting period. + google.protobuf.Duration voting_period = 1 [(gogoproto.stdduration) = true]; +} + +// TallyParams defines the params for tallying votes on governance proposals. +message TallyParams { + option deprecated = true; + + // Minimum percentage of total stake needed to vote for a result to be + // considered valid. + string quorum = 1 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + string threshold = 2 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // Minimum value of Veto votes to Total votes ratio for proposal to be + // vetoed. Default value: 1/3. + string veto_threshold = 3 [(cosmos_proto.scalar) = "cosmos.Dec"]; +} + +// Params defines the parameters for the x/gov module. +// +// Since: cosmos-sdk 0.47 +message Params { + // Minimum deposit for a proposal to enter voting period. + repeated cosmos.base.v1beta1.Coin min_deposit = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + // months. + google.protobuf.Duration max_deposit_period = 2 [(gogoproto.stdduration) = true]; + + // Duration of the voting period. + google.protobuf.Duration voting_period = 3 [(gogoproto.stdduration) = true]; + + // Minimum percentage of total stake needed to vote for a result to be + // considered valid. + string quorum = 4 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + string threshold = 5 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // Minimum value of Veto votes to Total votes ratio for proposal to be + // vetoed. Default value: 1/3. + string veto_threshold = 6 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // The ratio representing the proportion of the deposit value that must be paid at proposal submission. + string min_initial_deposit_ratio = 7 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // The cancel ratio which will not be returned back to the depositors when a proposal is cancelled. + // + // Since: cosmos-sdk 0.50 + string proposal_cancel_ratio = 8 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // The address which will receive (proposal_cancel_ratio * deposit) proposal deposits. + // If empty, the (proposal_cancel_ratio * deposit) proposal deposits will be burned. + // + // Since: cosmos-sdk 0.50 + string proposal_cancel_dest = 9 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // Duration of the voting period of an expedited proposal. + // + // Since: cosmos-sdk 0.50 + google.protobuf.Duration expedited_voting_period = 10 [(gogoproto.stdduration) = true]; + + // Minimum proportion of Yes votes for proposal to pass. Default value: 0.67. + // + // Since: cosmos-sdk 0.50 + string expedited_threshold = 11 [(cosmos_proto.scalar) = "cosmos.Dec"]; + + // Minimum expedited deposit for a proposal to enter voting period. + repeated cosmos.base.v1beta1.Coin expedited_min_deposit = 12 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // burn deposits if a proposal does not meet quorum + bool burn_vote_quorum = 13; + + // burn deposits if the proposal does not enter voting period + bool burn_proposal_deposit_prevote = 14; + + // burn deposits if quorum with vote type no_veto is met + bool burn_vote_veto = 15; + + // The ratio representing the proportion of the deposit value minimum that must be met when making a deposit. + // Default value: 0.01. Meaning that for a chain with a min_deposit of 100stake, a deposit of 1stake would be + // required. + // + // Since: cosmos-sdk 0.50 + string min_deposit_ratio = 16 [(cosmos_proto.scalar) = "cosmos.Dec"]; +} diff --git a/proto/cosmos/gov/v1/query.proto b/proto/cosmos/gov/v1/query.proto new file mode 100644 index 0000000..006d12f --- /dev/null +++ b/proto/cosmos/gov/v1/query.proto @@ -0,0 +1,205 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; +package cosmos.gov.v1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "google/api/annotations.proto"; +import "cosmos/gov/v1/gov.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1"; + +// Query defines the gRPC querier service for gov module +service Query { + // Constitution queries the chain's constitution. + rpc Constitution(QueryConstitutionRequest) returns (QueryConstitutionResponse) { + option (google.api.http).get = "/cosmos/gov/v1/constitution"; + } + + // Proposal queries proposal details based on ProposalID. + rpc Proposal(QueryProposalRequest) returns (QueryProposalResponse) { + option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}"; + } + + // Proposals queries all proposals based on given status. + rpc Proposals(QueryProposalsRequest) returns (QueryProposalsResponse) { + option (google.api.http).get = "/cosmos/gov/v1/proposals"; + } + + // Vote queries voted information based on proposalID, voterAddr. + rpc Vote(QueryVoteRequest) returns (QueryVoteResponse) { + option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/votes/{voter}"; + } + + // Votes queries votes of a given proposal. + rpc Votes(QueryVotesRequest) returns (QueryVotesResponse) { + option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/votes"; + } + + // Params queries all parameters of the gov module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/gov/v1/params/{params_type}"; + } + + // Deposit queries single deposit information based on proposalID, depositAddr. + rpc Deposit(QueryDepositRequest) returns (QueryDepositResponse) { + option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/deposits/{depositor}"; + } + + // Deposits queries all deposits of a single proposal. + rpc Deposits(QueryDepositsRequest) returns (QueryDepositsResponse) { + option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/deposits"; + } + + // TallyResult queries the tally of a proposal vote. + rpc TallyResult(QueryTallyResultRequest) returns (QueryTallyResultResponse) { + option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/tally"; + } +} + +// QueryConstitutionRequest is the request type for the Query/Constitution RPC method +message QueryConstitutionRequest {} + +// QueryConstitutionResponse is the response type for the Query/Constitution RPC method +message QueryConstitutionResponse { + string constitution = 1; +} + +// QueryProposalRequest is the request type for the Query/Proposal RPC method. +message QueryProposalRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; +} + +// QueryProposalResponse is the response type for the Query/Proposal RPC method. +message QueryProposalResponse { + // proposal is the requested governance proposal. + Proposal proposal = 1; +} + +// QueryProposalsRequest is the request type for the Query/Proposals RPC method. +message QueryProposalsRequest { + // proposal_status defines the status of the proposals. + ProposalStatus proposal_status = 1; + + // voter defines the voter address for the proposals. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // depositor defines the deposit addresses from the proposals. + string depositor = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 4; +} + +// QueryProposalsResponse is the response type for the Query/Proposals RPC +// method. +message QueryProposalsResponse { + // proposals defines all the requested governance proposals. + repeated Proposal proposals = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryVoteRequest is the request type for the Query/Vote RPC method. +message QueryVoteRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // voter defines the voter address for the proposals. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryVoteResponse is the response type for the Query/Vote RPC method. +message QueryVoteResponse { + // vote defines the queried vote. + Vote vote = 1; +} + +// QueryVotesRequest is the request type for the Query/Votes RPC method. +message QueryVotesRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryVotesResponse is the response type for the Query/Votes RPC method. +message QueryVotesResponse { + // votes defines the queried votes. + repeated Vote votes = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest { + // params_type defines which parameters to query for, can be one of "voting", + // "tallying" or "deposit". + string params_type = 1; +} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // Deprecated: Prefer to use `params` instead. + // voting_params defines the parameters related to voting. + VotingParams voting_params = 1 [deprecated = true]; + // Deprecated: Prefer to use `params` instead. + // deposit_params defines the parameters related to deposit. + DepositParams deposit_params = 2 [deprecated = true]; + // Deprecated: Prefer to use `params` instead. + // tally_params defines the parameters related to tally. + TallyParams tally_params = 3 [deprecated = true]; + // params defines all the paramaters of x/gov module. + // + // Since: cosmos-sdk 0.47 + Params params = 4; +} + +// QueryDepositRequest is the request type for the Query/Deposit RPC method. +message QueryDepositRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // depositor defines the deposit addresses from the proposals. + string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryDepositResponse is the response type for the Query/Deposit RPC method. +message QueryDepositResponse { + // deposit defines the requested deposit. + Deposit deposit = 1; +} + +// QueryDepositsRequest is the request type for the Query/Deposits RPC method. +message QueryDepositsRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryDepositsResponse is the response type for the Query/Deposits RPC method. +message QueryDepositsResponse { + // deposits defines the requested deposits. + repeated Deposit deposits = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryTallyResultRequest is the request type for the Query/Tally RPC method. +message QueryTallyResultRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; +} + +// QueryTallyResultResponse is the response type for the Query/Tally RPC method. +message QueryTallyResultResponse { + // tally defines the requested tally. + TallyResult tally = 1; +} diff --git a/proto/cosmos/gov/v1/tx.proto b/proto/cosmos/gov/v1/tx.proto new file mode 100644 index 0000000..21920a5 --- /dev/null +++ b/proto/cosmos/gov/v1/tx.proto @@ -0,0 +1,213 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; +package cosmos.gov.v1; + +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/gov/v1/gov.proto"; +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/any.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1"; + +// Msg defines the gov Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // SubmitProposal defines a method to create new proposal given the messages. + rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse); + + // ExecLegacyContent defines a Msg to be in included in a MsgSubmitProposal + // to execute a legacy content-based proposal. + rpc ExecLegacyContent(MsgExecLegacyContent) returns (MsgExecLegacyContentResponse); + + // Vote defines a method to add a vote on a specific proposal. + rpc Vote(MsgVote) returns (MsgVoteResponse); + + // VoteWeighted defines a method to add a weighted vote on a specific proposal. + rpc VoteWeighted(MsgVoteWeighted) returns (MsgVoteWeightedResponse); + + // Deposit defines a method to add deposit on a specific proposal. + rpc Deposit(MsgDeposit) returns (MsgDepositResponse); + + // UpdateParams defines a governance operation for updating the x/gov module + // parameters. The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + + // CancelProposal defines a method to cancel governance proposal + // + // Since: cosmos-sdk 0.50 + rpc CancelProposal(MsgCancelProposal) returns (MsgCancelProposalResponse); +} + +// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary +// proposal Content. +message MsgSubmitProposal { + option (cosmos.msg.v1.signer) = "proposer"; + option (amino.name) = "cosmos-sdk/v1/MsgSubmitProposal"; + + // messages are the arbitrary messages to be executed if proposal passes. + repeated google.protobuf.Any messages = 1; + + // initial_deposit is the deposit value that must be paid at proposal submission. + repeated cosmos.base.v1beta1.Coin initial_deposit = 2 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins" + ]; + + // proposer is the account address of the proposer. + string proposer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // metadata is any arbitrary metadata attached to the proposal. + string metadata = 4; + + // title is the title of the proposal. + // + // Since: cosmos-sdk 0.47 + string title = 5; + + // summary is the summary of the proposal + // + // Since: cosmos-sdk 0.47 + string summary = 6; + + // expedited defines if the proposal is expedited or not + // + // Since: cosmos-sdk 0.50 + bool expedited = 7; +} + +// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. +message MsgSubmitProposalResponse { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; +} + +// MsgExecLegacyContent is used to wrap the legacy content field into a message. +// This ensures backwards compatibility with v1beta1.MsgSubmitProposal. +message MsgExecLegacyContent { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/v1/MsgExecLegacyContent"; + + // content is the proposal's content. + google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "cosmos.gov.v1beta1.Content"]; + // authority must be the gov module address. + string authority = 2; +} + +// MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. +message MsgExecLegacyContentResponse {} + +// MsgVote defines a message to cast a vote. +message MsgVote { + option (cosmos.msg.v1.signer) = "voter"; + option (amino.name) = "cosmos-sdk/v1/MsgVote"; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true]; + + // voter is the voter address for the proposal. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // option defines the vote option. + VoteOption option = 3; + + // metadata is any arbitrary metadata attached to the Vote. + string metadata = 4; +} + +// MsgVoteResponse defines the Msg/Vote response type. +message MsgVoteResponse {} + +// MsgVoteWeighted defines a message to cast a vote. +message MsgVoteWeighted { + option (cosmos.msg.v1.signer) = "voter"; + option (amino.name) = "cosmos-sdk/v1/MsgVoteWeighted"; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true]; + + // voter is the voter address for the proposal. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // options defines the weighted vote options. + repeated WeightedVoteOption options = 3; + + // metadata is any arbitrary metadata attached to the VoteWeighted. + string metadata = 4; +} + +// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. +message MsgVoteWeightedResponse {} + +// MsgDeposit defines a message to submit a deposit to an existing proposal. +message MsgDeposit { + option (cosmos.msg.v1.signer) = "depositor"; + option (amino.name) = "cosmos-sdk/v1/MsgDeposit"; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true]; + + // depositor defines the deposit addresses from the proposals. + string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // amount to be deposited by depositor. + repeated cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgDepositResponse defines the Msg/Deposit response type. +message MsgDepositResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/x/gov/v1/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/gov parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} + +// MsgCancelProposal is the Msg/CancelProposal request type. +// +// Since: cosmos-sdk 0.50 +message MsgCancelProposal { + option (cosmos.msg.v1.signer) = "proposer"; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; + // proposer is the account address of the proposer. + string proposer = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgCancelProposalResponse defines the response structure for executing a +// MsgCancelProposal message. +// +// Since: cosmos-sdk 0.50 +message MsgCancelProposalResponse { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id"]; + // canceled_time is the time when proposal is canceled. + google.protobuf.Timestamp canceled_time = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + // canceled_height defines the block height at which the proposal is canceled. + uint64 canceled_height = 3; +} diff --git a/proto/cosmos/gov/v1beta1/genesis.proto b/proto/cosmos/gov/v1beta1/genesis.proto index a999500..f0c679a 100644 --- a/proto/cosmos/gov/v1beta1/genesis.proto +++ b/proto/cosmos/gov/v1beta1/genesis.proto @@ -4,23 +4,27 @@ package cosmos.gov.v1beta1; import "gogoproto/gogo.proto"; import "cosmos/gov/v1beta1/gov.proto"; +import "amino/amino.proto"; -option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"; // GenesisState defines the gov module's genesis state. message GenesisState { // starting_proposal_id is the ID of the starting proposal. - uint64 starting_proposal_id = 1 [(gogoproto.moretags) = "yaml:\"starting_proposal_id\""]; + uint64 starting_proposal_id = 1; // deposits defines all the deposits present at genesis. - repeated Deposit deposits = 2 [(gogoproto.castrepeated) = "Deposits", (gogoproto.nullable) = false]; + repeated Deposit deposits = 2 + [(gogoproto.castrepeated) = "Deposits", (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // votes defines all the votes present at genesis. - repeated Vote votes = 3 [(gogoproto.castrepeated) = "Votes", (gogoproto.nullable) = false]; + repeated Vote votes = 3 + [(gogoproto.castrepeated) = "Votes", (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // proposals defines all the proposals present at genesis. - repeated Proposal proposals = 4 [(gogoproto.castrepeated) = "Proposals", (gogoproto.nullable) = false]; - // params defines all the paramaters of related to deposit. - DepositParams deposit_params = 5 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"deposit_params\""]; - // params defines all the paramaters of related to voting. - VotingParams voting_params = 6 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"voting_params\""]; - // params defines all the paramaters of related to tally. - TallyParams tally_params = 7 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"tally_params\""]; + repeated Proposal proposals = 4 + [(gogoproto.castrepeated) = "Proposals", (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // deposit_params defines all the parameters related to deposit. + DepositParams deposit_params = 5 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // voting_params defines all the parameters related to voting. + VotingParams voting_params = 6 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // tally_params defines all the parameters related to tally. + TallyParams tally_params = 7 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } diff --git a/proto/cosmos/gov/v1beta1/gov.proto b/proto/cosmos/gov/v1beta1/gov.proto index 01aebf9..99b9719 100644 --- a/proto/cosmos/gov/v1beta1/gov.proto +++ b/proto/cosmos/gov/v1beta1/gov.proto @@ -3,15 +3,15 @@ package cosmos.gov.v1beta1; import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; import "google/protobuf/timestamp.proto"; import "google/protobuf/any.proto"; import "google/protobuf/duration.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; -option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; -option (gogoproto.goproto_stringer_all) = false; -option (gogoproto.stringer_all) = false; -option (gogoproto.goproto_getters_all) = false; +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"; + +option (gogoproto.goproto_getters_all) = false; // VoteOption enumerates the valid vote options for a given governance proposal. enum VoteOption { @@ -33,22 +33,30 @@ enum VoteOption { // // Since: cosmos-sdk 0.43 message WeightedVoteOption { + // option defines the valid vote options, it must not contain duplicate vote options. VoteOption option = 1; - string weight = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"weight\"" + + // weight is the vote weight associated with the vote option. + string weight = 2 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (amino.dont_omitempty) = true, + (gogoproto.nullable) = false ]; } // TextProposal defines a standard text proposal whose changes need to be // manually updated in case of approval. message TextProposal { - option (cosmos_proto.implements_interface) = "Content"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + option (amino.name) = "cosmos-sdk/TextProposal"; option (gogoproto.equal) = true; - string title = 1; + // title of the proposal. + string title = 1; + + // description associated with the proposal. string description = 2; } @@ -58,41 +66,67 @@ message Deposit { option (gogoproto.goproto_getters) = false; option (gogoproto.equal) = false; - uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""]; - string depositor = 2; - repeated cosmos.base.v1beta1.Coin amount = 3 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // depositor defines the deposit addresses from the proposals. + string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // amount to be deposited by depositor. + repeated cosmos.base.v1beta1.Coin amount = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; } // Proposal defines the core field members of a governance proposal. message Proposal { option (gogoproto.equal) = true; - uint64 proposal_id = 1 [(gogoproto.jsontag) = "id", (gogoproto.moretags) = "yaml:\"id\""]; - google.protobuf.Any content = 2 [(cosmos_proto.accepts_interface) = "Content"]; - ProposalStatus status = 3 [(gogoproto.moretags) = "yaml:\"proposal_status\""]; - TallyResult final_tally_result = 4 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"final_tally_result\""]; + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // content is the proposal's content. + google.protobuf.Any content = 2 [(cosmos_proto.accepts_interface) = "cosmos.gov.v1beta1.Content"]; + + // status defines the proposal status. + ProposalStatus status = 3; + + // final_tally_result is the final tally result of the proposal. When + // querying a proposal via gRPC, this field is not populated until the + // proposal's voting period has ended. + TallyResult final_tally_result = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // submit_time is the time of proposal submission. google.protobuf.Timestamp submit_time = 5 - [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"submit_time\""]; + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // deposit_end_time is the end time for deposition. google.protobuf.Timestamp deposit_end_time = 6 - [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"deposit_end_time\""]; + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // total_deposit is the total deposit on the proposal. repeated cosmos.base.v1beta1.Coin total_deposit = 7 [ (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.moretags) = "yaml:\"total_deposit\"" + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" ]; + + // voting_start_time is the starting time to vote on a proposal. google.protobuf.Timestamp voting_start_time = 8 - [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"voting_start_time\""]; + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // voting_end_time is the end time of voting on a proposal. google.protobuf.Timestamp voting_end_time = 9 - [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"voting_end_time\""]; + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // ProposalStatus enumerates the valid statuses of a proposal. enum ProposalStatus { option (gogoproto.goproto_enum_prefix) = false; - // PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. + // PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. PROPOSAL_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "StatusNil"]; // PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit // period. @@ -115,86 +149,106 @@ enum ProposalStatus { message TallyResult { option (gogoproto.equal) = true; - string yes = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; - string abstain = 2 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; - string no = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + // yes is the number of yes votes on a proposal. + string yes = 1 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + + // abstain is the number of abstain votes on a proposal. + string abstain = 2 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + + // no is the number of no votes on a proposal. + string no = 3 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; + + // no_with_veto is the number of no with veto votes on a proposal. string no_with_veto = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"no_with_veto\"" + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false ]; } // Vote defines a vote on a governance proposal. // A Vote consists of a proposal ID, the voter, and the vote option. message Vote { - option (gogoproto.goproto_stringer) = false; - option (gogoproto.equal) = false; + option (gogoproto.equal) = false; - uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""]; - string voter = 2; + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1 [(gogoproto.jsontag) = "id", (amino.field_name) = "id", (amino.dont_omitempty) = true]; + + // voter is the voter address of the proposal. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // Deprecated: Prefer to use `options` instead. This field is set in queries // if and only if `len(options) == 1` and that option has weight 1. In all // other cases, this field will default to VOTE_OPTION_UNSPECIFIED. VoteOption option = 3 [deprecated = true]; + + // options is the weighted vote options. + // // Since: cosmos-sdk 0.43 - repeated WeightedVoteOption options = 4 [(gogoproto.nullable) = false]; + repeated WeightedVoteOption options = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // DepositParams defines the params for deposits on governance proposals. message DepositParams { - // Minimum deposit for a proposal to enter voting period. + // Minimum deposit for a proposal to enter voting period. repeated cosmos.base.v1beta1.Coin min_deposit = 1 [ (gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.moretags) = "yaml:\"min_deposit\"", (gogoproto.jsontag) = "min_deposit,omitempty" ]; - // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - // months. + // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + // months. google.protobuf.Duration max_deposit_period = 2 [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true, - (gogoproto.jsontag) = "max_deposit_period,omitempty", - (gogoproto.moretags) = "yaml:\"max_deposit_period\"" + (gogoproto.jsontag) = "max_deposit_period,omitempty" ]; } // VotingParams defines the params for voting on governance proposals. message VotingParams { - // Length of the voting period. - google.protobuf.Duration voting_period = 1 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.jsontag) = "voting_period,omitempty", - (gogoproto.moretags) = "yaml:\"voting_period\"" - ]; + // Duration of the voting period. + google.protobuf.Duration voting_period = 1 + [(gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.jsontag) = "voting_period,omitempty"]; } // TallyParams defines the params for tallying votes on governance proposals. message TallyParams { - // Minimum percentage of total stake needed to vote for a result to be - // considered valid. + // Minimum percentage of total stake needed to vote for a result to be + // considered valid. bytes quorum = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.jsontag) = "quorum,omitempty" ]; - // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. bytes threshold = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, (gogoproto.jsontag) = "threshold,omitempty" ]; - // Minimum value of Veto votes to Total votes ratio for proposal to be - // vetoed. Default value: 1/3. + // Minimum value of Veto votes to Total votes ratio for proposal to be + // vetoed. Default value: 1/3. bytes veto_threshold = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false, - (gogoproto.jsontag) = "veto_threshold,omitempty", - (gogoproto.moretags) = "yaml:\"veto_threshold\"" + (gogoproto.jsontag) = "veto_threshold,omitempty" ]; } diff --git a/proto/cosmos/gov/v1beta1/query.proto b/proto/cosmos/gov/v1beta1/query.proto index da62bdb..28352ed 100644 --- a/proto/cosmos/gov/v1beta1/query.proto +++ b/proto/cosmos/gov/v1beta1/query.proto @@ -5,8 +5,10 @@ import "cosmos/base/query/v1beta1/pagination.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/gov/v1beta1/gov.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; -option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"; // Query defines the gRPC querier service for gov module service Query { @@ -35,7 +37,7 @@ service Query { option (google.api.http).get = "/cosmos/gov/v1beta1/params/{params_type}"; } - // Deposit queries single deposit information based proposalID, depositAddr. + // Deposit queries single deposit information based on proposalID, depositor address. rpc Deposit(QueryDepositRequest) returns (QueryDepositResponse) { option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}"; } @@ -59,7 +61,7 @@ message QueryProposalRequest { // QueryProposalResponse is the response type for the Query/Proposal RPC method. message QueryProposalResponse { - Proposal proposal = 1 [(gogoproto.nullable) = false]; + Proposal proposal = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QueryProposalsRequest is the request type for the Query/Proposals RPC method. @@ -71,10 +73,10 @@ message QueryProposalsRequest { ProposalStatus proposal_status = 1; // voter defines the voter address for the proposals. - string voter = 2; + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // depositor defines the deposit addresses from the proposals. - string depositor = 3; + string depositor = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // pagination defines an optional pagination for the request. cosmos.base.query.v1beta1.PageRequest pagination = 4; @@ -83,7 +85,8 @@ message QueryProposalsRequest { // QueryProposalsResponse is the response type for the Query/Proposals RPC // method. message QueryProposalsResponse { - repeated Proposal proposals = 1 [(gogoproto.nullable) = false]; + // proposals defines all the requested governance proposals. + repeated Proposal proposals = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -97,14 +100,14 @@ message QueryVoteRequest { // proposal_id defines the unique id of the proposal. uint64 proposal_id = 1; - // voter defines the oter address for the proposals. - string voter = 2; + // voter defines the voter address for the proposals. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } // QueryVoteResponse is the response type for the Query/Vote RPC method. message QueryVoteResponse { - // vote defined the queried vote. - Vote vote = 1 [(gogoproto.nullable) = false]; + // vote defines the queried vote. + Vote vote = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QueryVotesRequest is the request type for the Query/Votes RPC method. @@ -118,8 +121,8 @@ message QueryVotesRequest { // QueryVotesResponse is the response type for the Query/Votes RPC method. message QueryVotesResponse { - // votes defined the queried votes. - repeated Vote votes = 1 [(gogoproto.nullable) = false]; + // votes defines the queried votes. + repeated Vote votes = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -135,11 +138,11 @@ message QueryParamsRequest { // QueryParamsResponse is the response type for the Query/Params RPC method. message QueryParamsResponse { // voting_params defines the parameters related to voting. - VotingParams voting_params = 1 [(gogoproto.nullable) = false]; + VotingParams voting_params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // deposit_params defines the parameters related to deposit. - DepositParams deposit_params = 2 [(gogoproto.nullable) = false]; + DepositParams deposit_params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // tally_params defines the parameters related to tally. - TallyParams tally_params = 3 [(gogoproto.nullable) = false]; + TallyParams tally_params = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QueryDepositRequest is the request type for the Query/Deposit RPC method. @@ -151,13 +154,13 @@ message QueryDepositRequest { uint64 proposal_id = 1; // depositor defines the deposit addresses from the proposals. - string depositor = 2; + string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } // QueryDepositResponse is the response type for the Query/Deposit RPC method. message QueryDepositResponse { // deposit defines the requested deposit. - Deposit deposit = 1 [(gogoproto.nullable) = false]; + Deposit deposit = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QueryDepositsRequest is the request type for the Query/Deposits RPC method. @@ -171,7 +174,8 @@ message QueryDepositsRequest { // QueryDepositsResponse is the response type for the Query/Deposits RPC method. message QueryDepositsResponse { - repeated Deposit deposits = 1 [(gogoproto.nullable) = false]; + // deposits defines the requested deposits. + repeated Deposit deposits = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -186,5 +190,5 @@ message QueryTallyResultRequest { // QueryTallyResultResponse is the response type for the Query/Tally RPC method. message QueryTallyResultResponse { // tally defines the requested tally. - TallyResult tally = 1 [(gogoproto.nullable) = false]; + TallyResult tally = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } diff --git a/proto/cosmos/gov/v1beta1/tx.proto b/proto/cosmos/gov/v1beta1/tx.proto index 36c0a95..9de763b 100644 --- a/proto/cosmos/gov/v1beta1/tx.proto +++ b/proto/cosmos/gov/v1beta1/tx.proto @@ -6,11 +6,15 @@ import "cosmos/gov/v1beta1/gov.proto"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; -option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; +option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"; -// Msg defines the bank Msg service. +// Msg defines the gov Msg service. service Msg { + option (cosmos.msg.v1.service) = true; + // SubmitProposal defines a method to create new proposal given a content. rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse); @@ -29,35 +33,49 @@ service Msg { // MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary // proposal Content. message MsgSubmitProposal { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "proposer"; + option (amino.name) = "cosmos-sdk/MsgSubmitProposal"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // content is the proposal's content. + google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "cosmos.gov.v1beta1.Content"]; - google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "Content"]; + // initial_deposit is the deposit value that must be paid at proposal submission. repeated cosmos.base.v1beta1.Coin initial_deposit = 2 [ (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.moretags) = "yaml:\"initial_deposit\"" + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" ]; - string proposer = 3; + + // proposer is the account address of the proposer. + string proposer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } // MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. message MsgSubmitProposalResponse { - uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (gogoproto.moretags) = "yaml:\"proposal_id\""]; + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true]; } // MsgVote defines a message to cast a vote. message MsgVote { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (gogoproto.moretags) = "yaml:\"proposal_id\""]; - string voter = 2; - VoteOption option = 3; + option (cosmos.msg.v1.signer) = "voter"; + option (amino.name) = "cosmos-sdk/MsgVote"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; + + // voter is the voter address for the proposal. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // option defines the vote option. + VoteOption option = 3; } // MsgVoteResponse defines the Msg/Vote response type. @@ -67,14 +85,20 @@ message MsgVoteResponse {} // // Since: cosmos-sdk 0.43 message MsgVoteWeighted { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""]; - string voter = 2; - repeated WeightedVoteOption options = 3 [(gogoproto.nullable) = false]; + option (cosmos.msg.v1.signer) = "voter"; + option (amino.name) = "cosmos-sdk/MsgVoteWeighted"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true]; + + // voter is the voter address for the proposal. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // options defines the weighted vote options. + repeated WeightedVoteOption options = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. @@ -84,15 +108,26 @@ message MsgVoteWeightedResponse {} // MsgDeposit defines a message to submit a deposit to an existing proposal. message MsgDeposit { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (gogoproto.moretags) = "yaml:\"proposal_id\""]; - string depositor = 2; - repeated cosmos.base.v1beta1.Coin amount = 3 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + option (cosmos.msg.v1.signer) = "depositor"; + option (amino.name) = "cosmos-sdk/MsgDeposit"; + + option (gogoproto.equal) = false; + option (gogoproto.stringer) = false; + option (gogoproto.goproto_getters) = false; + + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (amino.dont_omitempty) = true]; + + // depositor defines the deposit addresses from the proposals. + string depositor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // amount to be deposited by depositor. + repeated cosmos.base.v1beta1.Coin amount = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; } // MsgDepositResponse defines the Msg/Deposit response type. diff --git a/proto/cosmos/group/v1/events.proto b/proto/cosmos/group/v1/events.proto new file mode 100644 index 0000000..2b98ec9 --- /dev/null +++ b/proto/cosmos/group/v1/events.proto @@ -0,0 +1,94 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; + +package cosmos.group.v1; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/group/v1/types.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/group"; + +// EventCreateGroup is an event emitted when a group is created. +message EventCreateGroup { + + // group_id is the unique ID of the group. + uint64 group_id = 1; +} + +// EventUpdateGroup is an event emitted when a group is updated. +message EventUpdateGroup { + + // group_id is the unique ID of the group. + uint64 group_id = 1; +} + +// EventCreateGroupPolicy is an event emitted when a group policy is created. +message EventCreateGroupPolicy { + + // address is the account address of the group policy. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// EventUpdateGroupPolicy is an event emitted when a group policy is updated. +message EventUpdateGroupPolicy { + + // address is the account address of the group policy. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// EventSubmitProposal is an event emitted when a proposal is created. +message EventSubmitProposal { + + // proposal_id is the unique ID of the proposal. + uint64 proposal_id = 1; +} + +// EventWithdrawProposal is an event emitted when a proposal is withdrawn. +message EventWithdrawProposal { + + // proposal_id is the unique ID of the proposal. + uint64 proposal_id = 1; +} + +// EventVote is an event emitted when a voter votes on a proposal. +message EventVote { + + // proposal_id is the unique ID of the proposal. + uint64 proposal_id = 1; +} + +// EventExec is an event emitted when a proposal is executed. +message EventExec { + + // proposal_id is the unique ID of the proposal. + uint64 proposal_id = 1; + + // result is the proposal execution result. + ProposalExecutorResult result = 2; + + // logs contains error logs in case the execution result is FAILURE. + string logs = 3; +} + +// EventLeaveGroup is an event emitted when group member leaves the group. +message EventLeaveGroup { + + // group_id is the unique ID of the group. + uint64 group_id = 1; + + // address is the account address of the group member. + string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// EventProposalPruned is an event emitted when a proposal is pruned. +message EventProposalPruned { + + // proposal_id is the unique ID of the proposal. + uint64 proposal_id = 1; + + // status is the proposal status (UNSPECIFIED, SUBMITTED, ACCEPTED, REJECTED, ABORTED, WITHDRAWN). + ProposalStatus status = 2; + + // tally_result is the proposal tally result (when applicable). + TallyResult tally_result = 3; +} diff --git a/proto/cosmos/group/v1/genesis.proto b/proto/cosmos/group/v1/genesis.proto new file mode 100644 index 0000000..e4c895e --- /dev/null +++ b/proto/cosmos/group/v1/genesis.proto @@ -0,0 +1,39 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; + +package cosmos.group.v1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/group"; + +import "cosmos/group/v1/types.proto"; + +// GenesisState defines the group module's genesis state. +message GenesisState { + + // group_seq is the group table orm.Sequence, + // it is used to get the next group ID. + uint64 group_seq = 1; + + // groups is the list of groups info. + repeated GroupInfo groups = 2; + + // group_members is the list of groups members. + repeated GroupMember group_members = 3; + + // group_policy_seq is the group policy table orm.Sequence, + // it is used to generate the next group policy account address. + uint64 group_policy_seq = 4; + + // group_policies is the list of group policies info. + repeated GroupPolicyInfo group_policies = 5; + + // proposal_seq is the proposal table orm.Sequence, + // it is used to get the next proposal ID. + uint64 proposal_seq = 6; + + // proposals is the list of proposals. + repeated Proposal proposals = 7; + + // votes is the list of votes. + repeated Vote votes = 8; +} \ No newline at end of file diff --git a/proto/cosmos/group/v1/query.proto b/proto/cosmos/group/v1/query.proto new file mode 100644 index 0000000..80b0925 --- /dev/null +++ b/proto/cosmos/group/v1/query.proto @@ -0,0 +1,320 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; + +package cosmos.group.v1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/group/v1/types.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/group"; + +// Query is the cosmos.group.v1 Query service. +service Query { + + // GroupInfo queries group info based on group id. + rpc GroupInfo(QueryGroupInfoRequest) returns (QueryGroupInfoResponse) { + option (google.api.http).get = "/cosmos/group/v1/group_info/{group_id}"; + }; + + // GroupPolicyInfo queries group policy info based on account address of group policy. + rpc GroupPolicyInfo(QueryGroupPolicyInfoRequest) returns (QueryGroupPolicyInfoResponse) { + option (google.api.http).get = "/cosmos/group/v1/group_policy_info/{address}"; + }; + + // GroupMembers queries members of a group by group id. + rpc GroupMembers(QueryGroupMembersRequest) returns (QueryGroupMembersResponse) { + option (google.api.http).get = "/cosmos/group/v1/group_members/{group_id}"; + }; + + // GroupsByAdmin queries groups by admin address. + rpc GroupsByAdmin(QueryGroupsByAdminRequest) returns (QueryGroupsByAdminResponse) { + option (google.api.http).get = "/cosmos/group/v1/groups_by_admin/{admin}"; + }; + + // GroupPoliciesByGroup queries group policies by group id. + rpc GroupPoliciesByGroup(QueryGroupPoliciesByGroupRequest) returns (QueryGroupPoliciesByGroupResponse) { + option (google.api.http).get = "/cosmos/group/v1/group_policies_by_group/{group_id}"; + }; + + // GroupPoliciesByAdmin queries group policies by admin address. + rpc GroupPoliciesByAdmin(QueryGroupPoliciesByAdminRequest) returns (QueryGroupPoliciesByAdminResponse) { + option (google.api.http).get = "/cosmos/group/v1/group_policies_by_admin/{admin}"; + }; + + // Proposal queries a proposal based on proposal id. + rpc Proposal(QueryProposalRequest) returns (QueryProposalResponse) { + option (google.api.http).get = "/cosmos/group/v1/proposal/{proposal_id}"; + }; + + // ProposalsByGroupPolicy queries proposals based on account address of group policy. + rpc ProposalsByGroupPolicy(QueryProposalsByGroupPolicyRequest) returns (QueryProposalsByGroupPolicyResponse) { + option (google.api.http).get = "/cosmos/group/v1/proposals_by_group_policy/{address}"; + }; + + // VoteByProposalVoter queries a vote by proposal id and voter. + rpc VoteByProposalVoter(QueryVoteByProposalVoterRequest) returns (QueryVoteByProposalVoterResponse) { + option (google.api.http).get = "/cosmos/group/v1/vote_by_proposal_voter/{proposal_id}/{voter}"; + }; + + // VotesByProposal queries a vote by proposal id. + rpc VotesByProposal(QueryVotesByProposalRequest) returns (QueryVotesByProposalResponse) { + option (google.api.http).get = "/cosmos/group/v1/votes_by_proposal/{proposal_id}"; + }; + + // VotesByVoter queries a vote by voter. + rpc VotesByVoter(QueryVotesByVoterRequest) returns (QueryVotesByVoterResponse) { + option (google.api.http).get = "/cosmos/group/v1/votes_by_voter/{voter}"; + }; + + // GroupsByMember queries groups by member address. + rpc GroupsByMember(QueryGroupsByMemberRequest) returns (QueryGroupsByMemberResponse) { + option (google.api.http).get = "/cosmos/group/v1/groups_by_member/{address}"; + }; + + // TallyResult returns the tally result of a proposal. If the proposal is + // still in voting period, then this query computes the current tally state, + // which might not be final. On the other hand, if the proposal is final, + // then it simply returns the `final_tally_result` state stored in the + // proposal itself. + rpc TallyResult(QueryTallyResultRequest) returns (QueryTallyResultResponse) { + option (google.api.http).get = "/cosmos/group/v1/proposals/{proposal_id}/tally"; + }; + + // Groups queries all groups in state. + // + // Since: cosmos-sdk 0.47.1 + rpc Groups(QueryGroupsRequest) returns (QueryGroupsResponse) { + option (google.api.http).get = "/cosmos/group/v1/groups"; + }; +} + +// QueryGroupInfoRequest is the Query/GroupInfo request type. +message QueryGroupInfoRequest { + // group_id is the unique ID of the group. + uint64 group_id = 1; +} + +// QueryGroupInfoResponse is the Query/GroupInfo response type. +message QueryGroupInfoResponse { + // info is the GroupInfo of the group. + GroupInfo info = 1; +} + +// QueryGroupPolicyInfoRequest is the Query/GroupPolicyInfo request type. +message QueryGroupPolicyInfoRequest { + // address is the account address of the group policy. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryGroupPolicyInfoResponse is the Query/GroupPolicyInfo response type. +message QueryGroupPolicyInfoResponse { + // info is the GroupPolicyInfo of the group policy. + GroupPolicyInfo info = 1; +} + +// QueryGroupMembersRequest is the Query/GroupMembers request type. +message QueryGroupMembersRequest { + // group_id is the unique ID of the group. + uint64 group_id = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryGroupMembersResponse is the Query/GroupMembersResponse response type. +message QueryGroupMembersResponse { + // members are the members of the group with given group_id. + repeated GroupMember members = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryGroupsByAdminRequest is the Query/GroupsByAdmin request type. +message QueryGroupsByAdminRequest { + // admin is the account address of a group's admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryGroupsByAdminResponse is the Query/GroupsByAdminResponse response type. +message QueryGroupsByAdminResponse { + // groups are the groups info with the provided admin. + repeated GroupInfo groups = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryGroupPoliciesByGroupRequest is the Query/GroupPoliciesByGroup request type. +message QueryGroupPoliciesByGroupRequest { + // group_id is the unique ID of the group policy's group. + uint64 group_id = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryGroupPoliciesByGroupResponse is the Query/GroupPoliciesByGroup response type. +message QueryGroupPoliciesByGroupResponse { + // group_policies are the group policies info associated with the provided group. + repeated GroupPolicyInfo group_policies = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryGroupPoliciesByAdminRequest is the Query/GroupPoliciesByAdmin request type. +message QueryGroupPoliciesByAdminRequest { + // admin is the admin address of the group policy. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryGroupPoliciesByAdminResponse is the Query/GroupPoliciesByAdmin response type. +message QueryGroupPoliciesByAdminResponse { + // group_policies are the group policies info with provided admin. + repeated GroupPolicyInfo group_policies = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryProposalRequest is the Query/Proposal request type. +message QueryProposalRequest { + // proposal_id is the unique ID of a proposal. + uint64 proposal_id = 1; +} + +// QueryProposalResponse is the Query/Proposal response type. +message QueryProposalResponse { + // proposal is the proposal info. + Proposal proposal = 1; +} + +// QueryProposalsByGroupPolicyRequest is the Query/ProposalByGroupPolicy request type. +message QueryProposalsByGroupPolicyRequest { + // address is the account address of the group policy related to proposals. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryProposalsByGroupPolicyResponse is the Query/ProposalByGroupPolicy response type. +message QueryProposalsByGroupPolicyResponse { + // proposals are the proposals with given group policy. + repeated Proposal proposals = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryVoteByProposalVoterRequest is the Query/VoteByProposalVoter request type. +message QueryVoteByProposalVoterRequest { + // proposal_id is the unique ID of a proposal. + uint64 proposal_id = 1; + + // voter is a proposal voter account address. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryVoteByProposalVoterResponse is the Query/VoteByProposalVoter response type. +message QueryVoteByProposalVoterResponse { + // vote is the vote with given proposal_id and voter. + Vote vote = 1; +} + +// QueryVotesByProposalRequest is the Query/VotesByProposal request type. +message QueryVotesByProposalRequest { + // proposal_id is the unique ID of a proposal. + uint64 proposal_id = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryVotesByProposalResponse is the Query/VotesByProposal response type. +message QueryVotesByProposalResponse { + // votes are the list of votes for given proposal_id. + repeated Vote votes = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryVotesByVoterRequest is the Query/VotesByVoter request type. +message QueryVotesByVoterRequest { + // voter is a proposal voter account address. + string voter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryVotesByVoterResponse is the Query/VotesByVoter response type. +message QueryVotesByVoterResponse { + // votes are the list of votes by given voter. + repeated Vote votes = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryGroupsByMemberRequest is the Query/GroupsByMember request type. +message QueryGroupsByMemberRequest { + // address is the group member address. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryGroupsByMemberResponse is the Query/GroupsByMember response type. +message QueryGroupsByMemberResponse { + // groups are the groups info with the provided group member. + repeated GroupInfo groups = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryTallyResultRequest is the Query/TallyResult request type. +message QueryTallyResultRequest { + // proposal_id is the unique id of a proposal. + uint64 proposal_id = 1; +} + +// QueryTallyResultResponse is the Query/TallyResult response type. +message QueryTallyResultResponse { + // tally defines the requested tally. + TallyResult tally = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QueryGroupsRequest is the Query/Groups request type. +// +// Since: cosmos-sdk 0.47.1 +message QueryGroupsRequest { + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryGroupsResponse is the Query/Groups response type. +// +// Since: cosmos-sdk 0.47.1 +message QueryGroupsResponse { + // `groups` is all the groups present in state. + repeated GroupInfo groups = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/proto/cosmos/group/v1/tx.proto b/proto/cosmos/group/v1/tx.proto new file mode 100644 index 0000000..5a5f028 --- /dev/null +++ b/proto/cosmos/group/v1/tx.proto @@ -0,0 +1,394 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; + +package cosmos.group.v1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/group"; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/any.proto"; +import "cosmos/group/v1/types.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; + +// Msg is the cosmos.group.v1 Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // CreateGroup creates a new group with an admin account address, a list of members and some optional metadata. + rpc CreateGroup(MsgCreateGroup) returns (MsgCreateGroupResponse); + + // UpdateGroupMembers updates the group members with given group id and admin address. + rpc UpdateGroupMembers(MsgUpdateGroupMembers) returns (MsgUpdateGroupMembersResponse); + + // UpdateGroupAdmin updates the group admin with given group id and previous admin address. + rpc UpdateGroupAdmin(MsgUpdateGroupAdmin) returns (MsgUpdateGroupAdminResponse); + + // UpdateGroupMetadata updates the group metadata with given group id and admin address. + rpc UpdateGroupMetadata(MsgUpdateGroupMetadata) returns (MsgUpdateGroupMetadataResponse); + + // CreateGroupPolicy creates a new group policy using given DecisionPolicy. + rpc CreateGroupPolicy(MsgCreateGroupPolicy) returns (MsgCreateGroupPolicyResponse); + + // CreateGroupWithPolicy creates a new group with policy. + rpc CreateGroupWithPolicy(MsgCreateGroupWithPolicy) returns (MsgCreateGroupWithPolicyResponse); + + // UpdateGroupPolicyAdmin updates a group policy admin. + rpc UpdateGroupPolicyAdmin(MsgUpdateGroupPolicyAdmin) returns (MsgUpdateGroupPolicyAdminResponse); + + // UpdateGroupPolicyDecisionPolicy allows a group policy's decision policy to be updated. + rpc UpdateGroupPolicyDecisionPolicy(MsgUpdateGroupPolicyDecisionPolicy) + returns (MsgUpdateGroupPolicyDecisionPolicyResponse); + + // UpdateGroupPolicyMetadata updates a group policy metadata. + rpc UpdateGroupPolicyMetadata(MsgUpdateGroupPolicyMetadata) returns (MsgUpdateGroupPolicyMetadataResponse); + + // SubmitProposal submits a new proposal. + rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse); + + // WithdrawProposal withdraws a proposal. + rpc WithdrawProposal(MsgWithdrawProposal) returns (MsgWithdrawProposalResponse); + + // Vote allows a voter to vote on a proposal. + rpc Vote(MsgVote) returns (MsgVoteResponse); + + // Exec executes a proposal. + rpc Exec(MsgExec) returns (MsgExecResponse); + + // LeaveGroup allows a group member to leave the group. + rpc LeaveGroup(MsgLeaveGroup) returns (MsgLeaveGroupResponse); +} + +// +// Groups +// + +// MsgCreateGroup is the Msg/CreateGroup request type. +message MsgCreateGroup { + option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgCreateGroup"; + + // admin is the account address of the group admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // members defines the group members. + repeated MemberRequest members = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // metadata is any arbitrary metadata to attached to the group. + string metadata = 3; +} + +// MsgCreateGroupResponse is the Msg/CreateGroup response type. +message MsgCreateGroupResponse { + // group_id is the unique ID of the newly created group. + uint64 group_id = 1; +} + +// MsgUpdateGroupMembers is the Msg/UpdateGroupMembers request type. +message MsgUpdateGroupMembers { + option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgUpdateGroupMembers"; + + // admin is the account address of the group admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // group_id is the unique ID of the group. + uint64 group_id = 2; + + // member_updates is the list of members to update, + // set weight to 0 to remove a member. + repeated MemberRequest member_updates = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgUpdateGroupMembersResponse is the Msg/UpdateGroupMembers response type. +message MsgUpdateGroupMembersResponse {} + +// MsgUpdateGroupAdmin is the Msg/UpdateGroupAdmin request type. +message MsgUpdateGroupAdmin { + option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgUpdateGroupAdmin"; + + // admin is the current account address of the group admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // group_id is the unique ID of the group. + uint64 group_id = 2; + + // new_admin is the group new admin account address. + string new_admin = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgUpdateGroupAdminResponse is the Msg/UpdateGroupAdmin response type. +message MsgUpdateGroupAdminResponse {} + +// MsgUpdateGroupMetadata is the Msg/UpdateGroupMetadata request type. +message MsgUpdateGroupMetadata { + option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgUpdateGroupMetadata"; + + // admin is the account address of the group admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // group_id is the unique ID of the group. + uint64 group_id = 2; + + // metadata is the updated group's metadata. + string metadata = 3; +} + +// MsgUpdateGroupMetadataResponse is the Msg/UpdateGroupMetadata response type. +message MsgUpdateGroupMetadataResponse {} + +// +// Group Policies +// + +// MsgCreateGroupPolicy is the Msg/CreateGroupPolicy request type. +message MsgCreateGroupPolicy { + option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgCreateGroupPolicy"; + + option (gogoproto.goproto_getters) = false; + + // admin is the account address of the group admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // group_id is the unique ID of the group. + uint64 group_id = 2; + + // metadata is any arbitrary metadata attached to the group policy. + string metadata = 3; + + // decision_policy specifies the group policy's decision policy. + google.protobuf.Any decision_policy = 4 [(cosmos_proto.accepts_interface) = "cosmos.group.v1.DecisionPolicy"]; +} + +// MsgCreateGroupPolicyResponse is the Msg/CreateGroupPolicy response type. +message MsgCreateGroupPolicyResponse { + // address is the account address of the newly created group policy. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgUpdateGroupPolicyAdmin is the Msg/UpdateGroupPolicyAdmin request type. +message MsgUpdateGroupPolicyAdmin { + option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgUpdateGroupPolicyAdmin"; + + // admin is the account address of the group admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // group_policy_address is the account address of the group policy. + string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // new_admin is the new group policy admin. + string new_admin = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgUpdateGroupPolicyAdminResponse is the Msg/UpdateGroupPolicyAdmin response type. +message MsgUpdateGroupPolicyAdminResponse {} + +// MsgCreateGroupWithPolicy is the Msg/CreateGroupWithPolicy request type. +message MsgCreateGroupWithPolicy { + option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgCreateGroupWithPolicy"; + option (gogoproto.goproto_getters) = false; + + // admin is the account address of the group and group policy admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // members defines the group members. + repeated MemberRequest members = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // group_metadata is any arbitrary metadata attached to the group. + string group_metadata = 3; + + // group_policy_metadata is any arbitrary metadata attached to the group policy. + string group_policy_metadata = 4; + + // group_policy_as_admin is a boolean field, if set to true, the group policy account address will be used as group + // and group policy admin. + bool group_policy_as_admin = 5; + + // decision_policy specifies the group policy's decision policy. + google.protobuf.Any decision_policy = 6 [(cosmos_proto.accepts_interface) = "cosmos.group.v1.DecisionPolicy"]; +} + +// MsgCreateGroupWithPolicyResponse is the Msg/CreateGroupWithPolicy response type. +message MsgCreateGroupWithPolicyResponse { + // group_id is the unique ID of the newly created group with policy. + uint64 group_id = 1; + + // group_policy_address is the account address of the newly created group policy. + string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgUpdateGroupPolicyDecisionPolicy is the Msg/UpdateGroupPolicyDecisionPolicy request type. +message MsgUpdateGroupPolicyDecisionPolicy { + option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgUpdateGroupDecisionPolicy"; + + option (gogoproto.goproto_getters) = false; + + // admin is the account address of the group admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // group_policy_address is the account address of group policy. + string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // decision_policy is the updated group policy's decision policy. + google.protobuf.Any decision_policy = 3 [(cosmos_proto.accepts_interface) = "cosmos.group.v1.DecisionPolicy"]; +} + +// MsgUpdateGroupPolicyDecisionPolicyResponse is the Msg/UpdateGroupPolicyDecisionPolicy response type. +message MsgUpdateGroupPolicyDecisionPolicyResponse {} + +// MsgUpdateGroupPolicyMetadata is the Msg/UpdateGroupPolicyMetadata request type. +message MsgUpdateGroupPolicyMetadata { + option (cosmos.msg.v1.signer) = "admin"; + option (amino.name) = "cosmos-sdk/MsgUpdateGroupPolicyMetadata"; + + // admin is the account address of the group admin. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // group_policy_address is the account address of group policy. + string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // metadata is the group policy metadata to be updated. + string metadata = 3; +} + +// MsgUpdateGroupPolicyMetadataResponse is the Msg/UpdateGroupPolicyMetadata response type. +message MsgUpdateGroupPolicyMetadataResponse {} + +// +// Proposals and Voting +// + +// Exec defines modes of execution of a proposal on creation or on new vote. +enum Exec { + // An empty value means that there should be a separate + // MsgExec request for the proposal to execute. + EXEC_UNSPECIFIED = 0; + + // Try to execute the proposal immediately. + // If the proposal is not allowed per the DecisionPolicy, + // the proposal will still be open and could + // be executed at a later point. + EXEC_TRY = 1; +} + +// MsgSubmitProposal is the Msg/SubmitProposal request type. +message MsgSubmitProposal { + option (cosmos.msg.v1.signer) = "proposers"; + option (amino.name) = "cosmos-sdk/group/MsgSubmitProposal"; + + option (gogoproto.goproto_getters) = false; + + // group_policy_address is the account address of group policy. + string group_policy_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // proposers are the account addresses of the proposers. + // Proposers signatures will be counted as yes votes. + repeated string proposers = 2; + + // metadata is any arbitrary metadata attached to the proposal. + string metadata = 3; + + // messages is a list of `sdk.Msg`s that will be executed if the proposal passes. + repeated google.protobuf.Any messages = 4; + + // exec defines the mode of execution of the proposal, + // whether it should be executed immediately on creation or not. + // If so, proposers signatures are considered as Yes votes. + Exec exec = 5; + + // title is the title of the proposal. + // + // Since: cosmos-sdk 0.47 + string title = 6; + + // summary is the summary of the proposal. + // + // Since: cosmos-sdk 0.47 + string summary = 7; +} + +// MsgSubmitProposalResponse is the Msg/SubmitProposal response type. +message MsgSubmitProposalResponse { + // proposal is the unique ID of the proposal. + uint64 proposal_id = 1; +} + +// MsgWithdrawProposal is the Msg/WithdrawProposal request type. +message MsgWithdrawProposal { + option (cosmos.msg.v1.signer) = "address"; + option (amino.name) = "cosmos-sdk/group/MsgWithdrawProposal"; + + // proposal is the unique ID of the proposal. + uint64 proposal_id = 1; + + // address is the admin of the group policy or one of the proposer of the proposal. + string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgWithdrawProposalResponse is the Msg/WithdrawProposal response type. +message MsgWithdrawProposalResponse {} + +// MsgVote is the Msg/Vote request type. +message MsgVote { + option (cosmos.msg.v1.signer) = "voter"; + option (amino.name) = "cosmos-sdk/group/MsgVote"; + + // proposal is the unique ID of the proposal. + uint64 proposal_id = 1; + + // voter is the voter account address. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // option is the voter's choice on the proposal. + VoteOption option = 3; + + // metadata is any arbitrary metadata attached to the vote. + string metadata = 4; + + // exec defines whether the proposal should be executed + // immediately after voting or not. + Exec exec = 5; +} + +// MsgVoteResponse is the Msg/Vote response type. +message MsgVoteResponse {} + +// MsgExec is the Msg/Exec request type. +message MsgExec { + option (cosmos.msg.v1.signer) = "executor"; + option (amino.name) = "cosmos-sdk/group/MsgExec"; + + // proposal is the unique ID of the proposal. + uint64 proposal_id = 1; + + // executor is the account address used to execute the proposal. + string executor = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgExecResponse is the Msg/Exec request type. +message MsgExecResponse { + // result is the final result of the proposal execution. + ProposalExecutorResult result = 2; +} + +// MsgLeaveGroup is the Msg/LeaveGroup request type. +message MsgLeaveGroup { + option (cosmos.msg.v1.signer) = "address"; + option (amino.name) = "cosmos-sdk/group/MsgLeaveGroup"; + + // address is the account address of the group member. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // group_id is the unique ID of the group. + uint64 group_id = 2; +} + +// MsgLeaveGroupResponse is the Msg/LeaveGroup response type. +message MsgLeaveGroupResponse {} diff --git a/proto/cosmos/group/v1/types.proto b/proto/cosmos/group/v1/types.proto new file mode 100644 index 0000000..97af45f --- /dev/null +++ b/proto/cosmos/group/v1/types.proto @@ -0,0 +1,339 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; + +package cosmos.group.v1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/group"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/any.proto"; +import "amino/amino.proto"; + +// Member represents a group member with an account address, +// non-zero weight, metadata and added_at timestamp. +message Member { + // address is the member's account address. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // weight is the member's voting weight that should be greater than 0. + string weight = 2; + + // metadata is any arbitrary metadata attached to the member. + string metadata = 3; + + // added_at is a timestamp specifying when a member was added. + google.protobuf.Timestamp added_at = 4 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; +} + +// MemberRequest represents a group member to be used in Msg server requests. +// Contrary to `Member`, it doesn't have any `added_at` field +// since this field cannot be set as part of requests. +message MemberRequest { + // address is the member's account address. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // weight is the member's voting weight that should be greater than 0. + string weight = 2; + + // metadata is any arbitrary metadata attached to the member. + string metadata = 3; +} + +// ThresholdDecisionPolicy is a decision policy where a proposal passes when it +// satisfies the two following conditions: +// 1. The sum of all `YES` voter's weights is greater or equal than the defined +// `threshold`. +// 2. The voting and execution periods of the proposal respect the parameters +// given by `windows`. +message ThresholdDecisionPolicy { + option (cosmos_proto.implements_interface) = "cosmos.group.v1.DecisionPolicy"; + option (amino.name) = "cosmos-sdk/ThresholdDecisionPolicy"; + + // threshold is the minimum weighted sum of `YES` votes that must be met or + // exceeded for a proposal to succeed. + string threshold = 1; + + // windows defines the different windows for voting and execution. + DecisionPolicyWindows windows = 2; +} + +// PercentageDecisionPolicy is a decision policy where a proposal passes when +// it satisfies the two following conditions: +// 1. The percentage of all `YES` voters' weights out of the total group weight +// is greater or equal than the given `percentage`. +// 2. The voting and execution periods of the proposal respect the parameters +// given by `windows`. +message PercentageDecisionPolicy { + option (cosmos_proto.implements_interface) = "cosmos.group.v1.DecisionPolicy"; + option (amino.name) = "cosmos-sdk/PercentageDecisionPolicy"; + + // percentage is the minimum percentage of the weighted sum of `YES` votes must + // meet for a proposal to succeed. + string percentage = 1; + + // windows defines the different windows for voting and execution. + DecisionPolicyWindows windows = 2; +} + +// DecisionPolicyWindows defines the different windows for voting and execution. +message DecisionPolicyWindows { + // voting_period is the duration from submission of a proposal to the end of voting period + // Within this times votes can be submitted with MsgVote. + google.protobuf.Duration voting_period = 1 + [(gogoproto.stdduration) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // min_execution_period is the minimum duration after the proposal submission + // where members can start sending MsgExec. This means that the window for + // sending a MsgExec transaction is: + // `[ submission + min_execution_period ; submission + voting_period + max_execution_period]` + // where max_execution_period is a app-specific config, defined in the keeper. + // If not set, min_execution_period will default to 0. + // + // Please make sure to set a `min_execution_period` that is smaller than + // `voting_period + max_execution_period`, or else the above execution window + // is empty, meaning that all proposals created with this decision policy + // won't be able to be executed. + google.protobuf.Duration min_execution_period = 2 + [(gogoproto.stdduration) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// VoteOption enumerates the valid vote options for a given proposal. +enum VoteOption { + option (gogoproto.goproto_enum_prefix) = false; + + // VOTE_OPTION_UNSPECIFIED defines an unspecified vote option which will + // return an error. + VOTE_OPTION_UNSPECIFIED = 0; + // VOTE_OPTION_YES defines a yes vote option. + VOTE_OPTION_YES = 1; + // VOTE_OPTION_ABSTAIN defines an abstain vote option. + VOTE_OPTION_ABSTAIN = 2; + // VOTE_OPTION_NO defines a no vote option. + VOTE_OPTION_NO = 3; + // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + VOTE_OPTION_NO_WITH_VETO = 4; +} + +// +// State +// + +// GroupInfo represents the high-level on-chain information for a group. +message GroupInfo { + // id is the unique ID of the group. + uint64 id = 1; + + // admin is the account address of the group's admin. + string admin = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // metadata is any arbitrary metadata to attached to the group. + // the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/group#group-1 + string metadata = 3; + + // version is used to track changes to a group's membership structure that + // would break existing proposals. Whenever any members weight is changed, + // or any member is added or removed this version is incremented and will + // cause proposals based on older versions of this group to fail + uint64 version = 4; + + // total_weight is the sum of the group members' weights. + string total_weight = 5; + + // created_at is a timestamp specifying when a group was created. + google.protobuf.Timestamp created_at = 6 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; +} + +// GroupMember represents the relationship between a group and a member. +message GroupMember { + // group_id is the unique ID of the group. + uint64 group_id = 1; + + // member is the member data. + Member member = 2; +} + +// GroupPolicyInfo represents the high-level on-chain information for a group policy. +message GroupPolicyInfo { + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + + // address is the account address of group policy. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // group_id is the unique ID of the group. + uint64 group_id = 2; + + // admin is the account address of the group admin. + string admin = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // metadata is any arbitrary metadata attached to the group policy. + // the recommended format of the metadata is to be found here: + // https://docs.cosmos.network/v0.47/modules/group#decision-policy-1 + string metadata = 4; + + // version is used to track changes to a group's GroupPolicyInfo structure that + // would create a different result on a running proposal. + uint64 version = 5; + + // decision_policy specifies the group policy's decision policy. + google.protobuf.Any decision_policy = 6 [(cosmos_proto.accepts_interface) = "cosmos.group.v1.DecisionPolicy"]; + + // created_at is a timestamp specifying when a group policy was created. + google.protobuf.Timestamp created_at = 7 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; +} + +// Proposal defines a group proposal. Any member of a group can submit a proposal +// for a group policy to decide upon. +// A proposal consists of a set of `sdk.Msg`s that will be executed if the proposal +// passes as well as some optional metadata associated with the proposal. +message Proposal { + option (gogoproto.goproto_getters) = false; + + // id is the unique id of the proposal. + uint64 id = 1; + + // group_policy_address is the account address of group policy. + string group_policy_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // metadata is any arbitrary metadata attached to the proposal. + // the recommended format of the metadata is to be found here: + // https://docs.cosmos.network/v0.47/modules/group#proposal-4 + string metadata = 3; + + // proposers are the account addresses of the proposers. + repeated string proposers = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // submit_time is a timestamp specifying when a proposal was submitted. + google.protobuf.Timestamp submit_time = 5 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; + + // group_version tracks the version of the group at proposal submission. + // This field is here for informational purposes only. + uint64 group_version = 6; + + // group_policy_version tracks the version of the group policy at proposal submission. + // When a decision policy is changed, existing proposals from previous policy + // versions will become invalid with the `ABORTED` status. + // This field is here for informational purposes only. + uint64 group_policy_version = 7; + + // status represents the high level position in the life cycle of the proposal. Initial value is Submitted. + ProposalStatus status = 8; + + // final_tally_result contains the sums of all weighted votes for this + // proposal for each vote option. It is empty at submission, and only + // populated after tallying, at voting period end or at proposal execution, + // whichever happens first. + TallyResult final_tally_result = 9 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + + // voting_period_end is the timestamp before which voting must be done. + // Unless a successful MsgExec is called before (to execute a proposal whose + // tally is successful before the voting period ends), tallying will be done + // at this point, and the `final_tally_result`and `status` fields will be + // accordingly updated. + google.protobuf.Timestamp voting_period_end = 10 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; + + // executor_result is the final result of the proposal execution. Initial value is NotRun. + ProposalExecutorResult executor_result = 11; + + // messages is a list of `sdk.Msg`s that will be executed if the proposal passes. + repeated google.protobuf.Any messages = 12; + + // title is the title of the proposal + // + // Since: cosmos-sdk 0.47 + string title = 13; + + // summary is a short summary of the proposal + // + // Since: cosmos-sdk 0.47 + string summary = 14; +} + +// ProposalStatus defines proposal statuses. +enum ProposalStatus { + option (gogoproto.goproto_enum_prefix) = false; + + // An empty value is invalid and not allowed. + PROPOSAL_STATUS_UNSPECIFIED = 0; + + // Initial status of a proposal when submitted. + PROPOSAL_STATUS_SUBMITTED = 1; + + // Final status of a proposal when the final tally is done and the outcome + // passes the group policy's decision policy. + PROPOSAL_STATUS_ACCEPTED = 2; + + // Final status of a proposal when the final tally is done and the outcome + // is rejected by the group policy's decision policy. + PROPOSAL_STATUS_REJECTED = 3; + + // Final status of a proposal when the group policy is modified before the + // final tally. + PROPOSAL_STATUS_ABORTED = 4; + + // A proposal can be withdrawn before the voting start time by the owner. + // When this happens the final status is Withdrawn. + PROPOSAL_STATUS_WITHDRAWN = 5; +} + +// ProposalExecutorResult defines types of proposal executor results. +enum ProposalExecutorResult { + option (gogoproto.goproto_enum_prefix) = false; + + // An empty value is not allowed. + PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED = 0; + + // We have not yet run the executor. + PROPOSAL_EXECUTOR_RESULT_NOT_RUN = 1; + + // The executor was successful and proposed action updated state. + PROPOSAL_EXECUTOR_RESULT_SUCCESS = 2; + + // The executor returned an error and proposed action didn't update state. + PROPOSAL_EXECUTOR_RESULT_FAILURE = 3; +} + +// TallyResult represents the sum of weighted votes for each vote option. +message TallyResult { + option (gogoproto.goproto_getters) = false; + + // yes_count is the weighted sum of yes votes. + string yes_count = 1; + + // abstain_count is the weighted sum of abstainers. + string abstain_count = 2; + + // no_count is the weighted sum of no votes. + string no_count = 3; + + // no_with_veto_count is the weighted sum of veto. + string no_with_veto_count = 4; +} + +// Vote represents a vote for a proposal.string metadata +message Vote { + // proposal is the unique ID of the proposal. + uint64 proposal_id = 1; + + // voter is the account address of the voter. + string voter = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // option is the voter's choice on the proposal. + VoteOption option = 3; + + // metadata is any arbitrary metadata attached to the vote. + // the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/group#vote-2 + string metadata = 4; + + // submit_time is the timestamp when the vote was submitted. + google.protobuf.Timestamp submit_time = 5 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; +} diff --git a/proto/cosmos/ics23/v1/proofs.proto b/proto/cosmos/ics23/v1/proofs.proto new file mode 100644 index 0000000..df8bcce --- /dev/null +++ b/proto/cosmos/ics23/v1/proofs.proto @@ -0,0 +1,202 @@ +syntax = "proto3"; +package cosmos.ics23.v1; +option go_package = "github.com/cosmos/ics23"; +enum HashOp { + // NO_HASH is the default if no data passed. Note this is an illegal argument + // some places. + NO_HASH = 0; + SHA256 = 1; + SHA512 = 2; + KECCAK = 3; + RIPEMD160 = 4; + BITCOIN = 5; // ripemd160(sha256(x)) + SHA512_256 = 6; +} +/** +LengthOp defines how to process the key and value of the LeafOp +to include length information. After encoding the length with the given +algorithm, the length will be prepended to the key and value bytes. +(Each one with it's own encoded length) +*/ +enum LengthOp { + // NO_PREFIX don't include any length info + NO_PREFIX = 0; + // VAR_PROTO uses protobuf (and go-amino) varint encoding of the length + VAR_PROTO = 1; + // VAR_RLP uses rlp int encoding of the length + VAR_RLP = 2; + // FIXED32_BIG uses big-endian encoding of the length as a 32 bit integer + FIXED32_BIG = 3; + // FIXED32_LITTLE uses little-endian encoding of the length as a 32 bit + // integer + FIXED32_LITTLE = 4; + // FIXED64_BIG uses big-endian encoding of the length as a 64 bit integer + FIXED64_BIG = 5; + // FIXED64_LITTLE uses little-endian encoding of the length as a 64 bit + // integer + FIXED64_LITTLE = 6; + // REQUIRE_32_BYTES is like NONE, but will fail if the input is not exactly 32 + // bytes (sha256 output) + REQUIRE_32_BYTES = 7; + // REQUIRE_64_BYTES is like NONE, but will fail if the input is not exactly 64 + // bytes (sha512 output) + REQUIRE_64_BYTES = 8; +} +/** +ExistenceProof takes a key and a value and a set of steps to perform on it. +The result of peforming all these steps will provide a "root hash", which can +be compared to the value in a header. +Since it is computationally infeasible to produce a hash collission for any of +the used cryptographic hash functions, if someone can provide a series of +operations to transform a given key and value into a root hash that matches some +trusted root, these key and values must be in the referenced merkle tree. The +only possible issue is maliablity in LeafOp, such as providing extra prefix +data, which should be controlled by a spec. Eg. with lengthOp as NONE, prefix = +FOO, key = BAR, value = CHOICE and prefix = F, key = OOBAR, value = CHOICE would +produce the same value. With LengthOp this is tricker but not impossible. Which +is why the "leafPrefixEqual" field in the ProofSpec is valuable to prevent this +mutability. And why all trees should length-prefix the data before hashing it. +*/ +message ExistenceProof { + bytes key = 1; + bytes value = 2; + LeafOp leaf = 3; + repeated InnerOp path = 4; +} +/* +NonExistenceProof takes a proof of two neighbors, one left of the desired key, +one right of the desired key. If both proofs are valid AND they are neighbors, +then there is no valid proof for the given key. +*/ +message NonExistenceProof { + bytes key = 1; // TODO: remove this as unnecessary??? we prove a range + ExistenceProof left = 2; + ExistenceProof right = 3; +} +/* +CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch +of such messages +*/ +message CommitmentProof { + oneof proof { + ExistenceProof exist = 1; + NonExistenceProof nonexist = 2; + BatchProof batch = 3; + CompressedBatchProof compressed = 4; + } +} +/** +LeafOp represents the raw key-value data we wish to prove, and +must be flexible to represent the internal transformation from +the original key-value pairs into the basis hash, for many existing +merkle trees. +key and value are passed in. So that the signature of this operation is: + leafOp(key, value) -> output +To process this, first prehash the keys and values if needed (ANY means no hash +in this case): hkey = prehashKey(key) hvalue = prehashValue(value) Then combine +the bytes, and hash it output = hash(prefix || length(hkey) || hkey || +length(hvalue) || hvalue) +*/ +message LeafOp { + HashOp hash = 1; + HashOp prehash_key = 2; + HashOp prehash_value = 3; + LengthOp length = 4; + // prefix is a fixed bytes that may optionally be included at the beginning to + // differentiate a leaf node from an inner node. + bytes prefix = 5; +} +/** +InnerOp represents a merkle-proof step that is not a leaf. +It represents concatenating two children and hashing them to provide the next +result. The result of the previous step is passed in, so the signature of this +op is: innerOp(child) -> output The result of applying InnerOp should be: output += op.hash(op.prefix || child || op.suffix) where the || operator is +concatenation of binary data, and child is the result of hashing all the tree +below this step. Any special data, like prepending child with the length, or +prepending the entire operation with some value to differentiate from leaf +nodes, should be included in prefix and suffix. If either of prefix or suffix is +empty, we just treat it as an empty string +*/ +message InnerOp { + HashOp hash = 1; + bytes prefix = 2; + bytes suffix = 3; +} +/** +ProofSpec defines what the expected parameters are for a given proof type. +This can be stored in the client and used to validate any incoming proofs. + verify(ProofSpec, Proof) -> Proof | Error +As demonstrated in tests, if we don't fix the algorithm used to calculate the +LeafHash for a given tree, there are many possible key-value pairs that can +generate a given hash (by interpretting the preimage differently). +We need this for proper security, requires client knows a priori what +tree format server uses. But not in code, rather a configuration object. +*/ +message ProofSpec { + // any field in the ExistenceProof must be the same as in this spec. + // except Prefix, which is just the first bytes of prefix (spec can be longer) + LeafOp leaf_spec = 1; + InnerSpec inner_spec = 2; + // max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for + // fixed-depth tries) + int32 max_depth = 3; + // min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for + // fixed-depth tries) + int32 min_depth = 4; +} +/* +InnerSpec contains all store-specific structure info to determine if two proofs +from a given store are neighbors. This enables: isLeftMost(spec: InnerSpec, op: +InnerOp) isRightMost(spec: InnerSpec, op: InnerOp) isLeftNeighbor(spec: +InnerSpec, left: InnerOp, right: InnerOp) +*/ +message InnerSpec { + // Child order is the ordering of the children node, must count from 0 + // iavl tree is [0, 1] (left then right) + // merk is [0, 2, 1] (left, right, here) + repeated int32 child_order = 1; + int32 child_size = 2; + int32 min_prefix_length = 3; + int32 max_prefix_length = 4; + // empty child is the prehash image that is used when one child is nil (eg. 20 + // bytes of 0) + bytes empty_child = 5; + // hash is the algorithm that must be used for each InnerOp + HashOp hash = 6; +} +/* +BatchProof is a group of multiple proof types than can be compressed +*/ +message BatchProof { repeated BatchEntry entries = 1; } +// Use BatchEntry not CommitmentProof, to avoid recursion +message BatchEntry { + oneof proof { + ExistenceProof exist = 1; + NonExistenceProof nonexist = 2; + } +} +/****** all items here are compressed forms *******/ +message CompressedBatchProof { + repeated CompressedBatchEntry entries = 1; + repeated InnerOp lookup_inners = 2; +} +// Use BatchEntry not CommitmentProof, to avoid recursion +message CompressedBatchEntry { + oneof proof { + CompressedExistenceProof exist = 1; + CompressedNonExistenceProof nonexist = 2; + } +} +message CompressedExistenceProof { + bytes key = 1; + bytes value = 2; + LeafOp leaf = 3; + // these are indexes into the lookup_inners table in CompressedBatchProof + repeated int32 path = 4; +} +message CompressedNonExistenceProof { + bytes key = 1; // TODO: remove this as unnecessary??? we prove a range + CompressedExistenceProof left = 2; + CompressedExistenceProof right = 3; +} \ No newline at end of file diff --git a/proto/cosmos/mint/v1beta1/genesis.proto b/proto/cosmos/mint/v1beta1/genesis.proto index 4e783fb..b6cc150 100644 --- a/proto/cosmos/mint/v1beta1/genesis.proto +++ b/proto/cosmos/mint/v1beta1/genesis.proto @@ -3,14 +3,15 @@ package cosmos.mint.v1beta1; import "gogoproto/gogo.proto"; import "cosmos/mint/v1beta1/mint.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; // GenesisState defines the mint module's genesis state. message GenesisState { // minter is a space for holding current inflation information. - Minter minter = 1 [(gogoproto.nullable) = false]; + Minter minter = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - // params defines all the paramaters of the module. - Params params = 2 [(gogoproto.nullable) = false]; + // params defines all the parameters of the module. + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } diff --git a/proto/cosmos/mint/v1beta1/mint.proto b/proto/cosmos/mint/v1beta1/mint.proto index f94d4ae..440a392 100644 --- a/proto/cosmos/mint/v1beta1/mint.proto +++ b/proto/cosmos/mint/v1beta1/mint.proto @@ -4,50 +4,59 @@ package cosmos.mint.v1beta1; option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; // Minter represents the minting state. message Minter { // current annual inflation rate - string inflation = 1 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string inflation = 1 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; // current annual expected provisions string annual_provisions = 2 [ - (gogoproto.moretags) = "yaml:\"annual_provisions\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; } -// Params holds parameters for the mint module. +// Params defines the parameters for the x/mint module. message Params { - option (gogoproto.goproto_stringer) = false; + option (amino.name) = "cosmos-sdk/x/mint/Params"; // type of coin to mint string mint_denom = 1; // maximum annual change in inflation rate string inflation_rate_change = 2 [ - (gogoproto.moretags) = "yaml:\"inflation_rate_change\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true ]; // maximum inflation rate string inflation_max = 3 [ - (gogoproto.moretags) = "yaml:\"inflation_max\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true ]; // minimum inflation rate string inflation_min = 4 [ - (gogoproto.moretags) = "yaml:\"inflation_min\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true ]; // goal of percent bonded atoms string goal_bonded = 5 [ - (gogoproto.moretags) = "yaml:\"goal_bonded\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true ]; // expected blocks per year - uint64 blocks_per_year = 6 [(gogoproto.moretags) = "yaml:\"blocks_per_year\""]; + uint64 blocks_per_year = 6; } diff --git a/proto/cosmos/mint/v1beta1/query.proto b/proto/cosmos/mint/v1beta1/query.proto index acd341d..db5c90f 100644 --- a/proto/cosmos/mint/v1beta1/query.proto +++ b/proto/cosmos/mint/v1beta1/query.proto @@ -4,6 +4,8 @@ package cosmos.mint.v1beta1; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/mint/v1beta1/mint.proto"; +import "amino/amino.proto"; +import "cosmos_proto/cosmos.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; @@ -31,7 +33,7 @@ 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]; + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QueryInflationRequest is the request type for the Query/Inflation RPC method. @@ -41,7 +43,12 @@ message QueryInflationRequest {} // method. message QueryInflationResponse { // inflation is the current minting inflation value. - bytes inflation = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + bytes inflation = 1 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; } // QueryAnnualProvisionsRequest is the request type for the @@ -52,6 +59,10 @@ message QueryAnnualProvisionsRequest {} // Query/AnnualProvisions RPC method. message QueryAnnualProvisionsResponse { // annual_provisions is the current minting annual provisions value. - bytes annual_provisions = 1 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + bytes annual_provisions = 1 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; } diff --git a/proto/cosmos/mint/v1beta1/tx.proto b/proto/cosmos/mint/v1beta1/tx.proto new file mode 100644 index 0000000..ec71fb7 --- /dev/null +++ b/proto/cosmos/mint/v1beta1/tx.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; +package cosmos.mint.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; + +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; +import "cosmos/mint/v1beta1/mint.proto"; +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; + +// Msg defines the x/mint Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // UpdateParams defines a governance operation for updating the x/mint module + // parameters. The authority is defaults to the x/gov module account. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/x/mint/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/mint parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} diff --git a/proto/cosmos/msg/textual/v1/textual.proto b/proto/cosmos/msg/textual/v1/textual.proto new file mode 100644 index 0000000..4f8cd14 --- /dev/null +++ b/proto/cosmos/msg/textual/v1/textual.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +package cosmos.msg.textual.v1; + +import "google/protobuf/descriptor.proto"; + +extend google.protobuf.MessageOptions { + // expert_custom_renderer is an informative identifier to reference the + // algorithm used to generate the custom textual representation of the + // protobuf message where this annotation is applied. We recommend to use a + // short, versioned name as this identifier, e.g. "replace_with_username_v1". + // We also recommand providing a human-readable description as protobuf + // comments on this annotation, for example a short specification or a link + // to the relevant documentation. + // + // Also see the section on Custom Message Renderers in ADR-050. + string expert_custom_renderer = 11110009; +} diff --git a/proto/cosmos/msg/v1/msg.proto b/proto/cosmos/msg/v1/msg.proto new file mode 100644 index 0000000..853efa1 --- /dev/null +++ b/proto/cosmos/msg/v1/msg.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; + +package cosmos.msg.v1; + +import "google/protobuf/descriptor.proto"; + +// TODO(fdymylja): once we fully migrate to protov2 the go_package needs to be updated. +// We need this right now because gogoproto codegen needs to import the extension. +option go_package = "github.com/cosmos/cosmos-sdk/types/msgservice"; + +extend google.protobuf.ServiceOptions { + // service indicates that the service is a Msg service and that requests + // must be transported via blockchain transactions rather than gRPC. + // Tooling can use this annotation to distinguish between Msg services and + // other types of services via reflection. + bool service = 11110000; +} + +extend google.protobuf.MessageOptions { + // signer must be used in cosmos messages in order + // to signal to external clients which fields in a + // given cosmos message must be filled with signer + // information (address). + // The field must be the protobuf name of the message + // field extended with this MessageOption. + // The field must either be of string kind, or of message + // kind in case the signer information is contained within + // a message inside the cosmos message. + repeated string signer = 11110000; +} diff --git a/proto/cosmos/nft/v1beta1/event.proto b/proto/cosmos/nft/v1beta1/event.proto new file mode 100644 index 0000000..d2cb29d --- /dev/null +++ b/proto/cosmos/nft/v1beta1/event.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; +package cosmos.nft.v1beta1; + +option go_package = "cosmossdk.io/x/nft"; + +// EventSend is emitted on Msg/Send +message EventSend { + // class_id associated with the nft + string class_id = 1; + + // id is a unique identifier of the nft + string id = 2; + + // sender is the address of the owner of nft + string sender = 3; + + // receiver is the receiver address of nft + string receiver = 4; +} + +// EventMint is emitted on Mint +message EventMint { + // class_id associated with the nft + string class_id = 1; + + // id is a unique identifier of the nft + string id = 2; + + // owner is the owner address of the nft + string owner = 3; +} + +// EventBurn is emitted on Burn +message EventBurn { + // class_id associated with the nft + string class_id = 1; + + // id is a unique identifier of the nft + string id = 2; + + // owner is the owner address of the nft + string owner = 3; +} diff --git a/proto/cosmos/nft/v1beta1/genesis.proto b/proto/cosmos/nft/v1beta1/genesis.proto new file mode 100644 index 0000000..441b48b --- /dev/null +++ b/proto/cosmos/nft/v1beta1/genesis.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; +package cosmos.nft.v1beta1; + +import "cosmos/nft/v1beta1/nft.proto"; + +option go_package = "cosmossdk.io/x/nft"; + +// GenesisState defines the nft module's genesis state. +message GenesisState { + // class defines the class of the nft type. + repeated cosmos.nft.v1beta1.Class classes = 1; + + // entry defines all nft owned by a person. + repeated Entry entries = 2; +} + +// Entry Defines all nft owned by a person +message Entry { + // owner is the owner address of the following nft + string owner = 1; + + // nfts is a group of nfts of the same owner + repeated cosmos.nft.v1beta1.NFT nfts = 2; +} diff --git a/proto/cosmos/nft/v1beta1/nft.proto b/proto/cosmos/nft/v1beta1/nft.proto new file mode 100644 index 0000000..4234bd4 --- /dev/null +++ b/proto/cosmos/nft/v1beta1/nft.proto @@ -0,0 +1,48 @@ +syntax = "proto3"; +package cosmos.nft.v1beta1; + +import "google/protobuf/any.proto"; + +option go_package = "cosmossdk.io/x/nft"; + +// Class defines the class of the nft type. +message Class { + // id defines the unique identifier of the NFT classification, similar to the contract address of ERC721 + string id = 1; + + // name defines the human-readable name of the NFT classification. Optional + string name = 2; + + // symbol is an abbreviated name for nft classification. Optional + string symbol = 3; + + // description is a brief description of nft classification. Optional + string description = 4; + + // uri for the class metadata stored off chain. It can define schema for Class and NFT `Data` attributes. Optional + string uri = 5; + + // uri_hash is a hash of the document pointed by uri. Optional + string uri_hash = 6; + + // data is the app specific metadata of the NFT class. Optional + google.protobuf.Any data = 7; +} + +// NFT defines the NFT. +message NFT { + // class_id associated with the NFT, similar to the contract address of ERC721 + string class_id = 1; + + // id is a unique identifier of the NFT + string id = 2; + + // uri for the NFT metadata stored off chain + string uri = 3; + + // uri_hash is a hash of the document pointed by uri + string uri_hash = 4; + + // data is an app specific data of the NFT. Optional + google.protobuf.Any data = 10; +} diff --git a/proto/cosmos/nft/v1beta1/query.proto b/proto/cosmos/nft/v1beta1/query.proto new file mode 100644 index 0000000..bdc794f --- /dev/null +++ b/proto/cosmos/nft/v1beta1/query.proto @@ -0,0 +1,152 @@ +syntax = "proto3"; +package cosmos.nft.v1beta1; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "google/api/annotations.proto"; +import "cosmos/nft/v1beta1/nft.proto"; + +option go_package = "cosmossdk.io/x/nft"; + +// Query defines the gRPC querier service. +service Query { + // Balance queries the number of NFTs of a given class owned by the owner, same as balanceOf in ERC721 + rpc Balance(QueryBalanceRequest) returns (QueryBalanceResponse) { + option (google.api.http).get = "/cosmos/nft/v1beta1/balance/{owner}/{class_id}"; + } + + // Owner queries the owner of the NFT based on its class and id, same as ownerOf in ERC721 + rpc Owner(QueryOwnerRequest) returns (QueryOwnerResponse) { + option (google.api.http).get = "/cosmos/nft/v1beta1/owner/{class_id}/{id}"; + } + + // Supply queries the number of NFTs from the given class, same as totalSupply of ERC721. + rpc Supply(QuerySupplyRequest) returns (QuerySupplyResponse) { + option (google.api.http).get = "/cosmos/nft/v1beta1/supply/{class_id}"; + } + + // NFTs queries all NFTs of a given class or owner,choose at least one of the two, similar to tokenByIndex in + // ERC721Enumerable + rpc NFTs(QueryNFTsRequest) returns (QueryNFTsResponse) { + option (google.api.http).get = "/cosmos/nft/v1beta1/nfts"; + } + + // NFT queries an NFT based on its class and id. + rpc NFT(QueryNFTRequest) returns (QueryNFTResponse) { + option (google.api.http).get = "/cosmos/nft/v1beta1/nfts/{class_id}/{id}"; + } + + // Class queries an NFT class based on its id + rpc Class(QueryClassRequest) returns (QueryClassResponse) { + option (google.api.http).get = "/cosmos/nft/v1beta1/classes/{class_id}"; + } + + // Classes queries all NFT classes + rpc Classes(QueryClassesRequest) returns (QueryClassesResponse) { + option (google.api.http).get = "/cosmos/nft/v1beta1/classes"; + } +} + +// QueryBalanceRequest is the request type for the Query/Balance RPC method +message QueryBalanceRequest { + // class_id associated with the nft + string class_id = 1; + + // owner is the owner address of the nft + string owner = 2; +} + +// QueryBalanceResponse is the response type for the Query/Balance RPC method +message QueryBalanceResponse { + // amount is the number of all NFTs of a given class owned by the owner + uint64 amount = 1; +} + +// QueryOwnerRequest is the request type for the Query/Owner RPC method +message QueryOwnerRequest { + // class_id associated with the nft + string class_id = 1; + + // id is a unique identifier of the NFT + string id = 2; +} + +// QueryOwnerResponse is the response type for the Query/Owner RPC method +message QueryOwnerResponse { + // owner is the owner address of the nft + string owner = 1; +} + +// QuerySupplyRequest is the request type for the Query/Supply RPC method +message QuerySupplyRequest { + // class_id associated with the nft + string class_id = 1; +} + +// QuerySupplyResponse is the response type for the Query/Supply RPC method +message QuerySupplyResponse { + // amount is the number of all NFTs from the given class + uint64 amount = 1; +} + +// QueryNFTstRequest is the request type for the Query/NFTs RPC method +message QueryNFTsRequest { + // class_id associated with the nft + string class_id = 1; + + // owner is the owner address of the nft + string owner = 2; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +// QueryNFTsResponse is the response type for the Query/NFTs RPC methods +message QueryNFTsResponse { + // NFT defines the NFT + repeated cosmos.nft.v1beta1.NFT nfts = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryNFTRequest is the request type for the Query/NFT RPC method +message QueryNFTRequest { + // class_id associated with the nft + string class_id = 1; + + // id is a unique identifier of the NFT + string id = 2; +} + +// QueryNFTResponse is the response type for the Query/NFT RPC method +message QueryNFTResponse { + // owner is the owner address of the nft + cosmos.nft.v1beta1.NFT nft = 1; +} + +// QueryClassRequest is the request type for the Query/Class RPC method +message QueryClassRequest { + // class_id associated with the nft + string class_id = 1; +} + +// QueryClassResponse is the response type for the Query/Class RPC method +message QueryClassResponse { + // class defines the class of the nft type. + cosmos.nft.v1beta1.Class class = 1; +} + +// QueryClassesRequest is the request type for the Query/Classes RPC method +message QueryClassesRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryClassesResponse is the response type for the Query/Classes RPC method +message QueryClassesResponse { + // class defines the class of the nft type. + repeated cosmos.nft.v1beta1.Class classes = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/proto/cosmos/nft/v1beta1/tx.proto b/proto/cosmos/nft/v1beta1/tx.proto new file mode 100644 index 0000000..9eecfdd --- /dev/null +++ b/proto/cosmos/nft/v1beta1/tx.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; +package cosmos.nft.v1beta1; + +option go_package = "cosmossdk.io/x/nft"; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; + +// Msg defines the nft Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // Send defines a method to send a nft from one account to another account. + rpc Send(MsgSend) returns (MsgSendResponse); +} + +// MsgSend represents a message to send a nft from one account to another account. +message MsgSend { + option (cosmos.msg.v1.signer) = "sender"; + + // class_id defines the unique identifier of the nft classification, similar to the contract address of ERC721 + string class_id = 1; + + // id defines the unique identification of nft + string id = 2; + + // sender is the address of the owner of nft + string sender = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // receiver is the receiver address of nft + string receiver = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} +// MsgSendResponse defines the Msg/Send response type. +message MsgSendResponse {} \ No newline at end of file diff --git a/proto/cosmos/orm/query/v1alpha1/query.proto b/proto/cosmos/orm/query/v1alpha1/query.proto new file mode 100644 index 0000000..4500e99 --- /dev/null +++ b/proto/cosmos/orm/query/v1alpha1/query.proto @@ -0,0 +1,131 @@ +syntax = "proto3"; + +package cosmos.orm.query.v1alpha1; + +import "google/protobuf/timestamp.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/any.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; + +// Query is a generic gRPC service for querying ORM data. +service Query { + + // Get queries an ORM table against an unique index. + rpc Get(GetRequest) returns (GetResponse); + + // List queries an ORM table against an index. + rpc List(ListRequest) returns (ListResponse); +} + +// GetRequest is the Query/Get request type. +message GetRequest { + // message_name is the fully-qualified message name of the ORM table being queried. + string message_name = 1; + + // index is the index fields expression used in orm definitions. If it + // is empty, the table's primary key is assumed. If it is non-empty, it must + // refer to an unique index. + string index = 2; + + // values are the values of the fields corresponding to the requested index. + // There must be as many values provided as there are fields in the index and + // these values must correspond to the index field types. + repeated IndexValue values = 3; +} + +// GetResponse is the Query/Get response type. +message GetResponse { + + // result is the result of the get query. If no value is found, the gRPC + // status code NOT_FOUND will be returned. + google.protobuf.Any result = 1; +} + +// ListRequest is the Query/List request type. +message ListRequest { + // message_name is the fully-qualified message name of the ORM table being queried. + string message_name = 1; + + // index is the index fields expression used in orm definitions. If it + // is empty, the table's primary key is assumed. + string index = 2; + + // query is the query expression corresponding to the provided index. If + // neither prefix nor range is specified, the query will list all the fields + // in the index. + oneof query { + + // prefix defines a prefix query. + Prefix prefix = 3; + + // range defines a range query. + Range range = 4; + } + + // pagination is the pagination request. + cosmos.base.query.v1beta1.PageRequest pagination = 5; + + // Prefix specifies the arguments to a prefix query. + message Prefix { + // values specifies the index values for the prefix query. + // It is valid to special a partial prefix with fewer values than + // the number of fields in the index. + repeated IndexValue values = 1; + } + + // Range specifies the arguments to a range query. + message Range { + // start specifies the starting index values for the range query. + // It is valid to provide fewer values than the number of fields in the + // index. + repeated IndexValue start = 1; + + // end specifies the inclusive ending index values for the range query. + // It is valid to provide fewer values than the number of fields in the + // index. + repeated IndexValue end = 2; + } +} + +// ListResponse is the Query/List response type. +message ListResponse { + + // results are the results of the query. + repeated google.protobuf.Any results = 1; + + // pagination is the pagination response. + cosmos.base.query.v1beta1.PageResponse pagination = 5; +} + +// IndexValue represents the value of a field in an ORM index expression. +message IndexValue { + + // value specifies the index value + oneof value { + // uint specifies a value for an uint32, fixed32, uint64, or fixed64 + // index field. + uint64 uint = 1; + + // int64 specifies a value for an int32, sfixed32, int64, or sfixed64 + // index field. + int64 int = 2; + + // str specifies a value for a string index field. + string str = 3; + + // bytes specifies a value for a bytes index field. + bytes bytes = 4; + + // enum specifies a value for an enum index field. + string enum = 5; + + // bool specifies a value for a bool index field. + bool bool = 6; + + // timestamp specifies a value for a timestamp index field. + google.protobuf.Timestamp timestamp = 7; + + // duration specifies a value for a duration index field. + google.protobuf.Duration duration = 8; + } +} diff --git a/proto/cosmos/orm/v1/orm.proto b/proto/cosmos/orm/v1/orm.proto new file mode 100644 index 0000000..e850939 --- /dev/null +++ b/proto/cosmos/orm/v1/orm.proto @@ -0,0 +1,107 @@ +syntax = "proto3"; + +package cosmos.orm.v1; + +import "google/protobuf/descriptor.proto"; + +extend google.protobuf.MessageOptions { + + // table specifies that this message will be used as an ORM table. It cannot + // be used together with the singleton option. + TableDescriptor table = 104503790; + + // singleton specifies that this message will be used as an ORM singleton. It cannot + // be used together with the table option. + SingletonDescriptor singleton = 104503791; +} + +// TableDescriptor describes an ORM table. +message TableDescriptor { + + // primary_key defines the primary key for the table. + PrimaryKeyDescriptor primary_key = 1; + + // index defines one or more secondary indexes. + repeated SecondaryIndexDescriptor index = 2; + + // id is a non-zero integer ID that must be unique within the + // tables and singletons in this file. It may be deprecated in the future when this + // can be auto-generated. + uint32 id = 3; +} + +// PrimaryKeyDescriptor describes a table primary key. +message PrimaryKeyDescriptor { + + // fields is a comma-separated list of fields in the primary key. Spaces are + // not allowed. Supported field types, their encodings, and any applicable constraints + // are described below. + // - uint32 are encoded as 2,3,4 or 5 bytes using a compact encoding that + // is suitable for sorted iteration (not varint encoding). This type is + // well-suited for small integers. + // - uint64 are encoded as 2,4,6 or 9 bytes using a compact encoding that + // is suitable for sorted iteration (not varint encoding). This type is + // well-suited for small integers such as auto-incrementing sequences. + // - fixed32, fixed64 are encoded as big-endian fixed width bytes and support + // sorted iteration. These types are well-suited for encoding fixed with + // decimals as integers. + // - string's are encoded as raw bytes in terminal key segments and null-terminated + // in non-terminal segments. Null characters are thus forbidden in strings. + // string fields support sorted iteration. + // - bytes are encoded as raw bytes in terminal segments and length-prefixed + // with a 32-bit unsigned varint in non-terminal segments. + // - int32, sint32, int64, sint64, sfixed32, sfixed64 are encoded as fixed width bytes with + // an encoding that enables sorted iteration. + // - google.protobuf.Timestamp is encoded such that values with only seconds occupy 6 bytes, + // values including nanos occupy 9 bytes, and nil values occupy 1 byte. When iterating, nil + // values will always be ordered last. Seconds and nanos values must conform to the officially + // specified ranges of 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z and 0 to 999,999,999 respectively. + // - google.protobuf.Duration is encoded as 12 bytes using an encoding that enables sorted iteration. + // - enum fields are encoded using varint encoding and do not support sorted + // iteration. + // - bool fields are encoded as a single byte 0 or 1. + // + // All other fields types are unsupported in keys including repeated and + // oneof fields. + // + // Primary keys are prefixed by the varint encoded table id and the byte 0x0 + // plus any additional prefix specified by the schema. + string fields = 1; + + // auto_increment specifies that the primary key is generated by an + // auto-incrementing integer. If this is set to true fields must only + // contain one field of that is of type uint64. + bool auto_increment = 2; +} + +// PrimaryKeyDescriptor describes a table secondary index. +message SecondaryIndexDescriptor { + + // fields is a comma-separated list of fields in the index. The supported + // field types are the same as those for PrimaryKeyDescriptor.fields. + // Index keys are prefixed by the varint encoded table id and the varint + // encoded index id plus any additional prefix specified by the schema. + // + // In addition the field segments, non-unique index keys are suffixed with + // any additional primary key fields not present in the index fields so that the + // primary key can be reconstructed. Unique indexes instead of being suffixed + // store the remaining primary key fields in the value.. + string fields = 1; + + // id is a non-zero integer ID that must be unique within the indexes for this + // table and less than 32768. It may be deprecated in the future when this can + // be auto-generated. + uint32 id = 2; + + // unique specifies that this an unique index. + bool unique = 3; +} + +// TableDescriptor describes an ORM singleton table which has at most one instance. +message SingletonDescriptor { + + // id is a non-zero integer ID that must be unique within the + // tables and singletons in this file. It may be deprecated in the future when this + // can be auto-generated. + uint32 id = 1; +} \ No newline at end of file diff --git a/proto/cosmos/orm/v1alpha1/schema.proto b/proto/cosmos/orm/v1alpha1/schema.proto new file mode 100644 index 0000000..cbe90de --- /dev/null +++ b/proto/cosmos/orm/v1alpha1/schema.proto @@ -0,0 +1,58 @@ +syntax = "proto3"; + +package cosmos.orm.v1alpha1; + +import "google/protobuf/descriptor.proto"; + +extend google.protobuf.MessageOptions { + // module_schema is used to define the ORM schema for an app module. + // All module config messages that use module_schema must also declare + // themselves as app module config messages using the cosmos.app.v1.is_module + // option. + ModuleSchemaDescriptor module_schema = 104503792; +} + +// ModuleSchemaDescriptor describe's a module's ORM schema. +message ModuleSchemaDescriptor { + repeated FileEntry schema_file = 1; + + // FileEntry describes an ORM file used in a module. + message FileEntry { + // id is a prefix that will be varint encoded and prepended to all the + // table keys specified in the file's tables. + uint32 id = 1; + + // proto_file_name is the name of a file .proto in that contains + // table definitions. The .proto file must be in a package that the + // module has referenced using cosmos.app.v1.ModuleDescriptor.use_package. + string proto_file_name = 2; + + // storage_type optionally indicates the type of storage this file's + // tables should used. If it is left unspecified, the default KV-storage + // of the app will be used. + StorageType storage_type = 3; + } + + // prefix is an optional prefix that precedes all keys in this module's + // store. + bytes prefix = 2; +} + +// StorageType +enum StorageType { + // STORAGE_TYPE_DEFAULT_UNSPECIFIED indicates the persistent storage where all + // data is stored in the regular Merkle-tree backed KV-store. + STORAGE_TYPE_DEFAULT_UNSPECIFIED = 0; + + // STORAGE_TYPE_MEMORY indicates in-memory storage that will be + // reloaded every time an app restarts. Tables with this type of storage + // will by default be ignored when importing and exporting a module's + // state from JSON. + STORAGE_TYPE_MEMORY = 1; + + // STORAGE_TYPE_TRANSIENT indicates transient storage that is reset + // at the end of every block. Tables with this type of storage + // will by default be ignored when importing and exporting a module's + // state from JSON. + STORAGE_TYPE_TRANSIENT = 2; +} diff --git a/proto/cosmos/params/v1beta1/params.proto b/proto/cosmos/params/v1beta1/params.proto index 5382fd7..c8efa13 100644 --- a/proto/cosmos/params/v1beta1/params.proto +++ b/proto/cosmos/params/v1beta1/params.proto @@ -5,22 +5,23 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/params/types/prop option (gogoproto.equal_all) = true; import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; // ParameterChangeProposal defines a proposal to change one or more parameters. message ParameterChangeProposal { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + option (amino.name) = "cosmos-sdk/ParameterChangeProposal"; string title = 1; string description = 2; - repeated ParamChange changes = 3 [(gogoproto.nullable) = false]; + repeated ParamChange changes = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // ParamChange defines an individual parameter change, for use in // ParameterChangeProposal. message ParamChange { - option (gogoproto.goproto_stringer) = false; - string subspace = 1; string key = 2; string value = 3; diff --git a/proto/cosmos/params/v1beta1/query.proto b/proto/cosmos/params/v1beta1/query.proto index 1078e02..827422e 100644 --- a/proto/cosmos/params/v1beta1/query.proto +++ b/proto/cosmos/params/v1beta1/query.proto @@ -4,6 +4,7 @@ package cosmos.params.v1beta1; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/params/v1beta1/params.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/params/types/proposal"; @@ -14,6 +15,13 @@ service Query { rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { option (google.api.http).get = "/cosmos/params/v1beta1/params"; } + + // Subspaces queries for all registered subspaces and all keys for a subspace. + // + // Since: cosmos-sdk 0.46 + rpc Subspaces(QuerySubspacesRequest) returns (QuerySubspacesResponse) { + option (google.api.http).get = "/cosmos/params/v1beta1/subspaces"; + } } // QueryParamsRequest is request type for the Query/Params RPC method. @@ -28,5 +36,28 @@ message QueryParamsRequest { // QueryParamsResponse is response type for the Query/Params RPC method. message QueryParamsResponse { // param defines the queried parameter. - ParamChange param = 1 [(gogoproto.nullable) = false]; + ParamChange param = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// QuerySubspacesRequest defines a request type for querying for all registered +// subspaces and all keys for a subspace. +// +// Since: cosmos-sdk 0.46 +message QuerySubspacesRequest {} + +// QuerySubspacesResponse defines the response types for querying for all +// registered subspaces and all keys for a subspace. +// +// Since: cosmos-sdk 0.46 +message QuerySubspacesResponse { + repeated Subspace subspaces = 1; +} + +// Subspace defines a parameter subspace name and all the keys that exist for +// the subspace. +// +// Since: cosmos-sdk 0.46 +message Subspace { + string subspace = 1; + repeated string keys = 2; } diff --git a/proto/cosmos/query/v1/query.proto b/proto/cosmos/query/v1/query.proto new file mode 100644 index 0000000..e42e73d --- /dev/null +++ b/proto/cosmos/query/v1/query.proto @@ -0,0 +1,35 @@ +syntax = "proto3"; + +package cosmos.query.v1; + +import "google/protobuf/descriptor.proto"; + +// TODO: once we fully migrate to protov2 the go_package needs to be updated. +// We need this right now because gogoproto codegen needs to import the extension. +option go_package = "github.com/cosmos/cosmos-sdk/types/query"; + +extend google.protobuf.MethodOptions { + // module_query_safe is set to true when the query is safe to be called from + // within the state machine, for example from another module's Keeper, via + // ADR-033 calls or from CosmWasm contracts. + // Concretely, it means that the query is: + // 1. deterministic: given a block height, returns the exact same response + // upon multiple calls; and doesn't introduce any state-machine-breaking + // changes across SDK patch version. + // 2. consumes gas correctly. + // + // If you are a module developer and want to add this annotation to one of + // your own queries, please make sure that the corresponding query: + // 1. is deterministic and won't introduce state-machine-breaking changes + // without a coordinated upgrade path, + // 2. has its gas tracked, to avoid the attack vector where no gas is + // accounted for on potentially high-computation queries. + // + // For queries that potentially consume a large amount of gas (for example + // those with pagination, if the pagination field is incorrectly set), we + // also recommend adding Protobuf comments to warn module developers + // consuming these queries. + // + // When set to true, the query can safely be called + bool module_query_safe = 11110001; +} \ No newline at end of file diff --git a/proto/cosmos/reflection/v1/reflection.proto b/proto/cosmos/reflection/v1/reflection.proto new file mode 100644 index 0000000..1f575b8 --- /dev/null +++ b/proto/cosmos/reflection/v1/reflection.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; + +package cosmos.reflection.v1; + +import "google/protobuf/descriptor.proto"; +import "cosmos/query/v1/query.proto"; + +// Package cosmos.reflection.v1 provides support for inspecting protobuf +// file descriptors. +service ReflectionService { + // FileDescriptors queries all the file descriptors in the app in order + // to enable easier generation of dynamic clients. + rpc FileDescriptors(FileDescriptorsRequest) returns (FileDescriptorsResponse) { + // NOTE: file descriptors SHOULD NOT be part of consensus because they + // include changes to doc commands and module_query_safe should be kept as false. + option (cosmos.query.v1.module_query_safe) = false; + } +} + +// FileDescriptorsRequest is the Query/FileDescriptors request type. +message FileDescriptorsRequest {} + +// FileDescriptorsResponse is the Query/FileDescriptors response type. +message FileDescriptorsResponse { + // files is the file descriptors. + repeated google.protobuf.FileDescriptorProto files = 1; +} diff --git a/proto/cosmos/slashing/v1beta1/genesis.proto b/proto/cosmos/slashing/v1beta1/genesis.proto index a7aebcf..a2f516b 100644 --- a/proto/cosmos/slashing/v1beta1/genesis.proto +++ b/proto/cosmos/slashing/v1beta1/genesis.proto @@ -5,40 +5,38 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; import "gogoproto/gogo.proto"; import "cosmos/slashing/v1beta1/slashing.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; // GenesisState defines the slashing module's genesis state. message GenesisState { - // params defines all the paramaters of related to deposit. - Params params = 1 [(gogoproto.nullable) = false]; + // params defines all the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // signing_infos represents a map between validator addresses and their // signing infos. - repeated SigningInfo signing_infos = 2 - [(gogoproto.moretags) = "yaml:\"signing_infos\"", (gogoproto.nullable) = false]; + repeated SigningInfo signing_infos = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // missed_blocks represents a map between validator addresses and their // missed blocks. - repeated ValidatorMissedBlocks missed_blocks = 3 - [(gogoproto.moretags) = "yaml:\"missed_blocks\"", (gogoproto.nullable) = false]; + repeated ValidatorMissedBlocks missed_blocks = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // SigningInfo stores validator signing info of corresponding address. message SigningInfo { // address is the validator address. - string address = 1; + string address = 1 [(cosmos_proto.scalar) = "cosmos.ConsensusAddressString"]; // validator_signing_info represents the signing info of this validator. - ValidatorSigningInfo validator_signing_info = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"validator_signing_info\""]; + ValidatorSigningInfo validator_signing_info = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // ValidatorMissedBlocks contains array of missed blocks of corresponding // address. message ValidatorMissedBlocks { // address is the validator address. - string address = 1; + string address = 1 [(cosmos_proto.scalar) = "cosmos.ConsensusAddressString"]; // missed_blocks is an array of missed blocks by the validator. - repeated MissedBlock missed_blocks = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"missed_blocks\""]; + repeated MissedBlock missed_blocks = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // MissedBlock contains height and missed status as boolean. diff --git a/proto/cosmos/slashing/v1beta1/query.proto b/proto/cosmos/slashing/v1beta1/query.proto index 869049a..e727970 100644 --- a/proto/cosmos/slashing/v1beta1/query.proto +++ b/proto/cosmos/slashing/v1beta1/query.proto @@ -5,6 +5,8 @@ import "cosmos/base/query/v1beta1/pagination.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/slashing/v1beta1/slashing.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; @@ -31,21 +33,21 @@ message QueryParamsRequest {} // QueryParamsResponse is the response type for the Query/Params RPC method message QueryParamsResponse { - Params params = 1 [(gogoproto.nullable) = false]; + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QuerySigningInfoRequest is the request type for the Query/SigningInfo RPC // method message QuerySigningInfoRequest { // cons_address is the address to query signing info of - string cons_address = 1; + string cons_address = 1 [(cosmos_proto.scalar) = "cosmos.ConsensusAddressString"]; } // QuerySigningInfoResponse is the response type for the Query/SigningInfo RPC // method message QuerySigningInfoResponse { // val_signing_info is the signing info of requested val cons address - ValidatorSigningInfo val_signing_info = 1 [(gogoproto.nullable) = false]; + ValidatorSigningInfo val_signing_info = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QuerySigningInfosRequest is the request type for the Query/SigningInfos RPC @@ -58,6 +60,7 @@ message QuerySigningInfosRequest { // method message QuerySigningInfosResponse { // info is the signing info of all validators - repeated cosmos.slashing.v1beta1.ValidatorSigningInfo info = 1 [(gogoproto.nullable) = false]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; + repeated cosmos.slashing.v1beta1.ValidatorSigningInfo info = 1 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; } diff --git a/proto/cosmos/slashing/v1beta1/slashing.proto b/proto/cosmos/slashing/v1beta1/slashing.proto index 882a0fb..2347f34 100644 --- a/proto/cosmos/slashing/v1beta1/slashing.proto +++ b/proto/cosmos/slashing/v1beta1/slashing.proto @@ -7,52 +7,56 @@ option (gogoproto.equal_all) = true; import "gogoproto/gogo.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; // ValidatorSigningInfo defines a validator's signing info for monitoring their // liveness activity. message ValidatorSigningInfo { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; + option (gogoproto.equal) = true; - string address = 1; - // Height at which validator was first a candidate OR was unjailed - int64 start_height = 2 [(gogoproto.moretags) = "yaml:\"start_height\""]; - // Index which is incremented each time the validator was a bonded - // in a block and may have signed a precommit or not. This in conjunction with the - // `SignedBlocksWindow` param determines the index in the `MissedBlocksBitArray`. - int64 index_offset = 3 [(gogoproto.moretags) = "yaml:\"index_offset\""]; + string address = 1 [(cosmos_proto.scalar) = "cosmos.ConsensusAddressString"]; + // Height at which validator was first a candidate OR was un-jailed + int64 start_height = 2; + // Index which is incremented every time a validator is bonded in a block and + // _may_ have signed a pre-commit or not. This in conjunction with the + // signed_blocks_window param determines the index in the missed block bitmap. + int64 index_offset = 3; // Timestamp until which the validator is jailed due to liveness downtime. google.protobuf.Timestamp jailed_until = 4 - [(gogoproto.moretags) = "yaml:\"jailed_until\"", (gogoproto.stdtime) = true, (gogoproto.nullable) = false]; - // Whether or not a validator has been tombstoned (killed out of validator set). It is set - // once the validator commits an equivocation or for any other configured misbehiavor. + [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // Whether or not a validator has been tombstoned (killed out of validator + // set). It is set once the validator commits an equivocation or for any other + // configured misbehavior. bool tombstoned = 5; - // A counter kept to avoid unnecessary array reads. - // Note that `Sum(MissedBlocksBitArray)` always equals `MissedBlocksCounter`. - int64 missed_blocks_counter = 6 [(gogoproto.moretags) = "yaml:\"missed_blocks_counter\""]; + // A counter of missed (unsigned) blocks. It is used to avoid unnecessary + // reads in the missed block bitmap. + int64 missed_blocks_counter = 6; } // Params represents the parameters used for by the slashing module. message Params { - int64 signed_blocks_window = 1 [(gogoproto.moretags) = "yaml:\"signed_blocks_window\""]; + option (amino.name) = "cosmos-sdk/x/slashing/Params"; + + int64 signed_blocks_window = 1; bytes min_signed_per_window = 2 [ - (gogoproto.moretags) = "yaml:\"min_signed_per_window\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - google.protobuf.Duration downtime_jail_duration = 3 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.moretags) = "yaml:\"downtime_jail_duration\"" + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true ]; + google.protobuf.Duration downtime_jail_duration = 3 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdduration) = true]; bytes slash_fraction_double_sign = 4 [ - (gogoproto.moretags) = "yaml:\"slash_fraction_double_sign\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true ]; bytes slash_fraction_downtime = 5 [ - (gogoproto.moretags) = "yaml:\"slash_fraction_downtime\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true ]; } diff --git a/proto/cosmos/slashing/v1beta1/tx.proto b/proto/cosmos/slashing/v1beta1/tx.proto index 4d63370..2499b4f 100644 --- a/proto/cosmos/slashing/v1beta1/tx.proto +++ b/proto/cosmos/slashing/v1beta1/tx.proto @@ -5,22 +5,63 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; option (gogoproto.equal_all) = true; import "gogoproto/gogo.proto"; +import "cosmos/slashing/v1beta1/slashing.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; // Msg defines the slashing Msg service. service Msg { + option (cosmos.msg.v1.service) = true; + // Unjail defines a method for unjailing a jailed validator, thus returning // them into the bonded validator set, so they can begin receiving provisions // and rewards again. rpc Unjail(MsgUnjail) returns (MsgUnjailResponse); + + // UpdateParams defines a governance operation for updating the x/slashing module + // parameters. The authority defaults to the x/gov module account. + // + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } // MsgUnjail defines the Msg/Unjail request type message MsgUnjail { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = true; + option (cosmos.msg.v1.signer) = "validator_addr"; + option (amino.name) = "cosmos-sdk/MsgUnjail"; - string validator_addr = 1 [(gogoproto.moretags) = "yaml:\"address\"", (gogoproto.jsontag) = "address"]; + option (gogoproto.goproto_getters) = false; + + string validator_addr = 1 [ + (cosmos_proto.scalar) = "cosmos.ValidatorAddressString", + (gogoproto.jsontag) = "address", + (amino.field_name) = "address", + (amino.dont_omitempty) = true + ]; } // MsgUnjailResponse defines the Msg/Unjail response type -message MsgUnjailResponse {} \ No newline at end of file +message MsgUnjailResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/x/slashing/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the x/slashing parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} diff --git a/proto/cosmos/staking/v1beta1/authz.proto b/proto/cosmos/staking/v1beta1/authz.proto index d50c329..409280c 100644 --- a/proto/cosmos/staking/v1beta1/authz.proto +++ b/proto/cosmos/staking/v1beta1/authz.proto @@ -4,6 +4,7 @@ package cosmos.staking.v1beta1; import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; @@ -11,7 +12,8 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; // // Since: cosmos-sdk 0.43 message StakeAuthorization { - option (cosmos_proto.implements_interface) = "Authorization"; + option (cosmos_proto.implements_interface) = "cosmos.authz.v1beta1.Authorization"; + option (amino.name) = "cosmos-sdk/StakeAuthorization"; // max_tokens specifies the maximum amount of tokens can be delegate to a validator. If it is // empty, there is no spend limit and any amount of coins can be delegated. @@ -20,13 +22,13 @@ message StakeAuthorization { oneof validators { // allow_list specifies list of validator addresses to whom grantee can delegate tokens on behalf of granter's // account. - Validators allow_list = 2; + Validators allow_list = 2 [(amino.oneof_name) = "cosmos-sdk/StakeAuthorization/AllowList"]; // deny_list specifies list of validator addresses to whom grantee can not delegate tokens. - Validators deny_list = 3; + Validators deny_list = 3 [(amino.oneof_name) = "cosmos-sdk/StakeAuthorization/DenyList"]; } // Validators defines list of validator addresses. message Validators { - repeated string address = 1; + repeated string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } // authorization_type defines one of AuthorizationType. AuthorizationType authorization_type = 4; @@ -44,4 +46,6 @@ enum AuthorizationType { AUTHORIZATION_TYPE_UNDELEGATE = 2; // AUTHORIZATION_TYPE_REDELEGATE defines an authorization type for Msg/BeginRedelegate AUTHORIZATION_TYPE_REDELEGATE = 3; + // AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION defines an authorization type for Msg/MsgCancelUnbondingDelegation + AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION = 4; } diff --git a/proto/cosmos/staking/v1beta1/genesis.proto b/proto/cosmos/staking/v1beta1/genesis.proto index d1563db..c3f1ce5 100644 --- a/proto/cosmos/staking/v1beta1/genesis.proto +++ b/proto/cosmos/staking/v1beta1/genesis.proto @@ -5,38 +5,40 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; import "gogoproto/gogo.proto"; import "cosmos/staking/v1beta1/staking.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; // GenesisState defines the staking module's genesis state. message GenesisState { - // params defines all the paramaters of related to deposit. - Params params = 1 [(gogoproto.nullable) = false]; + // params defines all the parameters of related to deposit. + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // last_total_power tracks the total amounts of bonded tokens recorded during // the previous end block. bytes last_total_power = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"last_total_power\"", - (gogoproto.nullable) = false + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true ]; // last_validator_powers is a special index that provides a historical list // of the last-block's bonded validators. - repeated LastValidatorPower last_validator_powers = 3 - [(gogoproto.moretags) = "yaml:\"last_validator_powers\"", (gogoproto.nullable) = false]; + repeated LastValidatorPower last_validator_powers = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - // delegations defines the validator set at genesis. - repeated Validator validators = 4 [(gogoproto.nullable) = false]; + // validators defines the validator set at genesis. + repeated Validator validators = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // delegations defines the delegations active at genesis. - repeated Delegation delegations = 5 [(gogoproto.nullable) = false]; + repeated Delegation delegations = 5 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // unbonding_delegations defines the unbonding delegations active at genesis. - repeated UnbondingDelegation unbonding_delegations = 6 - [(gogoproto.moretags) = "yaml:\"unbonding_delegations\"", (gogoproto.nullable) = false]; + repeated UnbondingDelegation unbonding_delegations = 6 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // redelegations defines the redelegations active at genesis. - repeated Redelegation redelegations = 7 [(gogoproto.nullable) = false]; + repeated Redelegation redelegations = 7 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // exported defines a bool to identify whether the chain dealing with exported or initialized genesis. bool exported = 8; } @@ -46,7 +48,7 @@ message LastValidatorPower { option (gogoproto.goproto_getters) = false; // address is the address of the validator. - string address = 1; + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // power defines the power of the validator. int64 power = 2; diff --git a/proto/cosmos/staking/v1beta1/query.proto b/proto/cosmos/staking/v1beta1/query.proto index 4852c53..08eb9f3 100644 --- a/proto/cosmos/staking/v1beta1/query.proto +++ b/proto/cosmos/staking/v1beta1/query.proto @@ -5,90 +5,128 @@ import "cosmos/base/query/v1beta1/pagination.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/staking/v1beta1/staking.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/query/v1/query.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; // Query defines the gRPC querier service. service Query { // Validators queries all validators that match the given status. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. rpc Validators(QueryValidatorsRequest) returns (QueryValidatorsResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/validators"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/validators"; } // Validator queries validator info for given validator address. rpc Validator(QueryValidatorRequest) returns (QueryValidatorResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}"; } // ValidatorDelegations queries delegate info for given validator. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. rpc ValidatorDelegations(QueryValidatorDelegationsRequest) returns (QueryValidatorDelegationsResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations"; } // ValidatorUnbondingDelegations queries unbonding delegations of a validator. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. rpc ValidatorUnbondingDelegations(QueryValidatorUnbondingDelegationsRequest) returns (QueryValidatorUnbondingDelegationsResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/validators/" - "{validator_addr}/unbonding_delegations"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/" + "{validator_addr}/unbonding_delegations"; } // Delegation queries delegate info for given validator delegator pair. rpc Delegation(QueryDelegationRequest) returns (QueryDelegationResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/" - "{delegator_addr}"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/" + "{delegator_addr}"; } // UnbondingDelegation queries unbonding info for given validator delegator // pair. rpc UnbondingDelegation(QueryUnbondingDelegationRequest) returns (QueryUnbondingDelegationResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/" - "{delegator_addr}/unbonding_delegation"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/" + "{delegator_addr}/unbonding_delegation"; } // DelegatorDelegations queries all delegations of a given delegator address. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. rpc DelegatorDelegations(QueryDelegatorDelegationsRequest) returns (QueryDelegatorDelegationsResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/delegations/{delegator_addr}"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/delegations/{delegator_addr}"; } // DelegatorUnbondingDelegations queries all unbonding delegations of a given // delegator address. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. rpc DelegatorUnbondingDelegations(QueryDelegatorUnbondingDelegationsRequest) returns (QueryDelegatorUnbondingDelegationsResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/" - "{delegator_addr}/unbonding_delegations"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/" + "{delegator_addr}/unbonding_delegations"; } // Redelegations queries redelegations of given address. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. rpc Redelegations(QueryRedelegationsRequest) returns (QueryRedelegationsResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations"; } // DelegatorValidators queries all validators info for given delegator // address. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. rpc DelegatorValidators(QueryDelegatorValidatorsRequest) returns (QueryDelegatorValidatorsResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators"; } // DelegatorValidator queries validator info for given delegator validator // pair. rpc DelegatorValidator(QueryDelegatorValidatorRequest) returns (QueryDelegatorValidatorResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/" - "{validator_addr}"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/" + "{validator_addr}"; } // HistoricalInfo queries the historical info for given height. rpc HistoricalInfo(QueryHistoricalInfoRequest) returns (QueryHistoricalInfoResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/historical_info/{height}"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/historical_info/{height}"; } // Pool queries the pool info. rpc Pool(QueryPoolRequest) returns (QueryPoolResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/pool"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/pool"; } // Parameters queries the staking parameters. rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/params"; + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmos/staking/v1beta1/params"; } } @@ -104,7 +142,7 @@ message QueryValidatorsRequest { // QueryValidatorsResponse is response type for the Query/Validators RPC method message QueryValidatorsResponse { // validators contains all the queried validators. - repeated Validator validators = 1 [(gogoproto.nullable) = false]; + repeated Validator validators = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -113,20 +151,20 @@ message QueryValidatorsResponse { // QueryValidatorRequest is response type for the Query/Validator RPC method message QueryValidatorRequest { // validator_addr defines the validator address to query for. - string validator_addr = 1; + string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; } // QueryValidatorResponse is response type for the Query/Validator RPC method message QueryValidatorResponse { - // validator defines the the validator info. - Validator validator = 1 [(gogoproto.nullable) = false]; + // validator defines the validator info. + Validator validator = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QueryValidatorDelegationsRequest is request type for the // Query/ValidatorDelegations RPC method message QueryValidatorDelegationsRequest { // validator_addr defines the validator address to query for. - string validator_addr = 1; + string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; // pagination defines an optional pagination for the request. cosmos.base.query.v1beta1.PageRequest pagination = 2; @@ -136,7 +174,7 @@ message QueryValidatorDelegationsRequest { // Query/ValidatorDelegations RPC method message QueryValidatorDelegationsResponse { repeated DelegationResponse delegation_responses = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "DelegationResponses"]; + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.castrepeated) = "DelegationResponses"]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -146,7 +184,7 @@ message QueryValidatorDelegationsResponse { // Query/ValidatorUnbondingDelegations RPC method message QueryValidatorUnbondingDelegationsRequest { // validator_addr defines the validator address to query for. - string validator_addr = 1; + string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; // pagination defines an optional pagination for the request. cosmos.base.query.v1beta1.PageRequest pagination = 2; @@ -155,7 +193,7 @@ message QueryValidatorUnbondingDelegationsRequest { // QueryValidatorUnbondingDelegationsResponse is response type for the // Query/ValidatorUnbondingDelegations RPC method. message QueryValidatorUnbondingDelegationsResponse { - repeated UnbondingDelegation unbonding_responses = 1 [(gogoproto.nullable) = false]; + repeated UnbondingDelegation unbonding_responses = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -167,10 +205,10 @@ message QueryDelegationRequest { option (gogoproto.goproto_getters) = false; // delegator_addr defines the delegator address to query for. - string delegator_addr = 1; + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // validator_addr defines the validator address to query for. - string validator_addr = 2; + string validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; } // QueryDelegationResponse is response type for the Query/Delegation RPC method. @@ -186,17 +224,17 @@ message QueryUnbondingDelegationRequest { option (gogoproto.goproto_getters) = false; // delegator_addr defines the delegator address to query for. - string delegator_addr = 1; + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // validator_addr defines the validator address to query for. - string validator_addr = 2; + string validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; } // QueryDelegationResponse is response type for the Query/UnbondingDelegation // RPC method. message QueryUnbondingDelegationResponse { // unbond defines the unbonding information of a delegation. - UnbondingDelegation unbond = 1 [(gogoproto.nullable) = false]; + UnbondingDelegation unbond = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QueryDelegatorDelegationsRequest is request type for the @@ -206,7 +244,7 @@ message QueryDelegatorDelegationsRequest { option (gogoproto.goproto_getters) = false; // delegator_addr defines the delegator address to query for. - string delegator_addr = 1; + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // pagination defines an optional pagination for the request. cosmos.base.query.v1beta1.PageRequest pagination = 2; @@ -216,7 +254,7 @@ message QueryDelegatorDelegationsRequest { // Query/DelegatorDelegations RPC method. message QueryDelegatorDelegationsResponse { // delegation_responses defines all the delegations' info of a delegator. - repeated DelegationResponse delegation_responses = 1 [(gogoproto.nullable) = false]; + repeated DelegationResponse delegation_responses = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -229,7 +267,7 @@ message QueryDelegatorUnbondingDelegationsRequest { option (gogoproto.goproto_getters) = false; // delegator_addr defines the delegator address to query for. - string delegator_addr = 1; + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // pagination defines an optional pagination for the request. cosmos.base.query.v1beta1.PageRequest pagination = 2; @@ -238,7 +276,7 @@ message QueryDelegatorUnbondingDelegationsRequest { // QueryUnbondingDelegatorDelegationsResponse is response type for the // Query/UnbondingDelegatorDelegations RPC method. message QueryDelegatorUnbondingDelegationsResponse { - repeated UnbondingDelegation unbonding_responses = 1 [(gogoproto.nullable) = false]; + repeated UnbondingDelegation unbonding_responses = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -251,13 +289,13 @@ message QueryRedelegationsRequest { option (gogoproto.goproto_getters) = false; // delegator_addr defines the delegator address to query for. - string delegator_addr = 1; + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // src_validator_addr defines the validator address to redelegate from. - string src_validator_addr = 2; + string src_validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // dst_validator_addr defines the validator address to redelegate to. - string dst_validator_addr = 3; + string dst_validator_addr = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // pagination defines an optional pagination for the request. cosmos.base.query.v1beta1.PageRequest pagination = 4; @@ -266,7 +304,8 @@ message QueryRedelegationsRequest { // QueryRedelegationsResponse is response type for the Query/Redelegations RPC // method. message QueryRedelegationsResponse { - repeated RedelegationResponse redelegation_responses = 1 [(gogoproto.nullable) = false]; + repeated RedelegationResponse redelegation_responses = 1 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -279,7 +318,7 @@ message QueryDelegatorValidatorsRequest { option (gogoproto.goproto_getters) = false; // delegator_addr defines the delegator address to query for. - string delegator_addr = 1; + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // pagination defines an optional pagination for the request. cosmos.base.query.v1beta1.PageRequest pagination = 2; @@ -288,8 +327,8 @@ message QueryDelegatorValidatorsRequest { // QueryDelegatorValidatorsResponse is response type for the // Query/DelegatorValidators RPC method. message QueryDelegatorValidatorsResponse { - // validators defines the the validators' info of a delegator. - repeated Validator validators = 1 [(gogoproto.nullable) = false]; + // validators defines the validators' info of a delegator. + repeated Validator validators = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -302,17 +341,17 @@ message QueryDelegatorValidatorRequest { option (gogoproto.goproto_getters) = false; // delegator_addr defines the delegator address to query for. - string delegator_addr = 1; + string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // validator_addr defines the validator address to query for. - string validator_addr = 2; + string validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; } // QueryDelegatorValidatorResponse response type for the // Query/DelegatorValidator RPC method. message QueryDelegatorValidatorResponse { - // validator defines the the validator info. - Validator validator = 1 [(gogoproto.nullable) = false]; + // validator defines the validator info. + Validator validator = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC @@ -335,7 +374,7 @@ message QueryPoolRequest {} // QueryPoolResponse is response type for the Query/Pool RPC method. message QueryPoolResponse { // pool defines the pool info. - Pool pool = 1 [(gogoproto.nullable) = false]; + Pool pool = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QueryParamsRequest is request type for the Query/Params RPC method. @@ -344,5 +383,5 @@ message QueryParamsRequest {} // QueryParamsResponse is response type for the Query/Params RPC method. message QueryParamsResponse { // params holds all the parameters of this module. - Params params = 1 [(gogoproto.nullable) = false]; + Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } diff --git a/proto/cosmos/staking/v1beta1/staking.proto b/proto/cosmos/staking/v1beta1/staking.proto index 27581a1..24ec65d 100644 --- a/proto/cosmos/staking/v1beta1/staking.proto +++ b/proto/cosmos/staking/v1beta1/staking.proto @@ -8,6 +8,7 @@ import "google/protobuf/timestamp.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "amino/amino.proto"; import "tendermint/types/types.proto"; import "tendermint/abci/types.proto"; @@ -18,48 +19,53 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; // recent HistoricalInfo // (`n` is set by the staking module's `historical_entries` parameter). message HistoricalInfo { - tendermint.types.Header header = 1 [(gogoproto.nullable) = false]; - repeated Validator valset = 2 [(gogoproto.nullable) = false]; + tendermint.types.Header header = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + repeated Validator valset = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // CommissionRates defines the initial commission rates to be used for creating // a validator. message CommissionRates { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; + option (gogoproto.equal) = true; // rate is the commission rate charged to delegators, as a fraction. - string rate = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string rate = 1 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; // max_rate defines the maximum commission rate which validator can ever charge, as a fraction. string max_rate = 2 [ - (gogoproto.moretags) = "yaml:\"max_rate\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true ]; // max_change_rate defines the maximum daily increase of the validator commission, as a fraction. string max_change_rate = 3 [ - (gogoproto.moretags) = "yaml:\"max_change_rate\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true ]; } // Commission defines commission parameters for a given validator. message Commission { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; + option (gogoproto.equal) = true; // commission_rates defines the initial commission rates to be used for creating a validator. - CommissionRates commission_rates = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + CommissionRates commission_rates = 1 + [(gogoproto.embed) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // update_time is the last time the commission rate was changed. google.protobuf.Timestamp update_time = 2 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"update_time\""]; + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; } // Description defines a validator description. message Description { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; + option (gogoproto.equal) = true; // moniker defines a human-readable name for the validator. string moniker = 1; @@ -68,7 +74,7 @@ message Description { // website defines an optional website link. string website = 3; // security_contact defines an optional email for security contact. - string security_contact = 4 [(gogoproto.moretags) = "yaml:\"security_contact\""]; + string security_contact = 4; // details define other optional details. string details = 5; } @@ -82,40 +88,44 @@ message Description { // exchange rate. Voting power can be calculated as total bonded shares // multiplied by exchange rate. message Validator { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; // operator_address defines the address of the validator's operator; bech encoded in JSON. - string operator_address = 1 [(gogoproto.moretags) = "yaml:\"operator_address\""]; + string operator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. - google.protobuf.Any consensus_pubkey = 2 - [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey", (gogoproto.moretags) = "yaml:\"consensus_pubkey\""]; + google.protobuf.Any consensus_pubkey = 2 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"]; // jailed defined whether the validator has been jailed from bonded status or not. bool jailed = 3; // status is the validator status (bonded/unbonding/unbonded). BondStatus status = 4; // tokens define the delegated tokens (incl. self-delegation). - string tokens = 5 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + string tokens = 5 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; // delegator_shares defines total shares issued to a validator's delegators. string delegator_shares = 6 [ - (gogoproto.moretags) = "yaml:\"delegator_shares\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // description defines the description terms for the validator. - Description description = 7 [(gogoproto.nullable) = false]; + Description description = 7 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. - int64 unbonding_height = 8 [(gogoproto.moretags) = "yaml:\"unbonding_height\""]; + int64 unbonding_height = 8; // unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. google.protobuf.Timestamp unbonding_time = 9 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"unbonding_time\""]; + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; // commission defines the commission parameters. - Commission commission = 10 [(gogoproto.nullable) = false]; + Commission commission = 10 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // min_self_delegation is the validator's self declared minimum self delegation. + // + // Since: cosmos-sdk 0.46 string min_self_delegation = 11 [ - (gogoproto.moretags) = "yaml:\"min_self_delegation\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false ]; @@ -142,27 +152,23 @@ enum BondStatus { // ValAddresses defines a repeated set of validator addresses. message ValAddresses { - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = true; - - repeated string addresses = 1; + repeated string addresses = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } // DVPair is struct that just has a delegator-validator pair with no other data. // It is intended to be used as a marshalable pointer. For example, a DVPair can // be used to construct the key to getting an UnbondingDelegation from state. message DVPair { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""]; + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; } // DVPairs defines an array of DVPair objects. message DVPairs { - repeated DVPair pairs = 1 [(gogoproto.nullable) = false]; + repeated DVPair pairs = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // DVVTriplet is struct that just has a delegator-validator-validator triplet @@ -170,70 +176,74 @@ message DVPairs { // example, a DVVTriplet can be used to construct the key to getting a // Redelegation from state. message DVVTriplet { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - string validator_src_address = 2 [(gogoproto.moretags) = "yaml:\"validator_src_address\""]; - string validator_dst_address = 3 [(gogoproto.moretags) = "yaml:\"validator_dst_address\""]; + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_src_address = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; + string validator_dst_address = 3 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; } // DVVTriplets defines an array of DVVTriplet objects. message DVVTriplets { - repeated DVVTriplet triplets = 1 [(gogoproto.nullable) = false]; + repeated DVVTriplet triplets = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // Delegation represents the bond with tokens held by an account. It is // owned by one delegator, and is associated with the voting power of one // validator. message Delegation { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; - // delegator_address is the bech32-encoded address of the delegator. - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - // validator_address is the bech32-encoded address of the validator. - string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""]; + // delegator_address is the encoded address of the delegator. + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // validator_address is the encoded address of the validator. + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; // shares define the delegation shares received. - string shares = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; + string shares = 3 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; } // UnbondingDelegation stores all of a single delegator's unbonding bonds // for a single validator in an time-ordered list. message UnbondingDelegation { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; - // delegator_address is the bech32-encoded address of the delegator. - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - // validator_address is the bech32-encoded address of the validator. - string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""]; + // delegator_address is the encoded address of the delegator. + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // validator_address is the encoded address of the validator. + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; // entries are the unbonding delegation entries. - repeated UnbondingDelegationEntry entries = 3 [(gogoproto.nullable) = false]; // unbonding delegation entries + repeated UnbondingDelegationEntry entries = 3 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // unbonding delegation entries } // UnbondingDelegationEntry defines an unbonding object with relevant metadata. message UnbondingDelegationEntry { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; + option (gogoproto.equal) = true; // creation_height is the height which the unbonding took place. - int64 creation_height = 1 [(gogoproto.moretags) = "yaml:\"creation_height\""]; + int64 creation_height = 1; // completion_time is the unix time for unbonding completion. google.protobuf.Timestamp completion_time = 2 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"completion_time\""]; + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; // initial_balance defines the tokens initially scheduled to receive at completion. string initial_balance = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"initial_balance\"" + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false ]; // balance defines the tokens to receive at completion. - string balance = 4 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; - + string balance = 4 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; // Incrementing id that uniquely identifies this entry uint64 unbonding_id = 5; @@ -243,24 +253,25 @@ message UnbondingDelegationEntry { // RedelegationEntry defines a redelegation object with relevant metadata. message RedelegationEntry { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; + option (gogoproto.equal) = true; // creation_height defines the height which the redelegation took place. - int64 creation_height = 1 [(gogoproto.moretags) = "yaml:\"creation_height\""]; + int64 creation_height = 1; // completion_time defines the unix time for redelegation completion. google.protobuf.Timestamp completion_time = 2 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"completion_time\""]; + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; // initial_balance defines the initial balance when redelegation started. string initial_balance = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"initial_balance\"" + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false ]; // shares_dst is the amount of destination-validator shares created by redelegation. - string shares_dst = 4 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; - + string shares_dst = 4 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false + ]; // Incrementing id that uniquely identifies this entry uint64 unbonding_id = 5; @@ -271,47 +282,54 @@ message RedelegationEntry { // Redelegation contains the list of a particular delegator's redelegating bonds // from a particular source validator to a particular destination validator. message Redelegation { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; // delegator_address is the bech32-encoded address of the delegator. - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // validator_src_address is the validator redelegation source operator address. - string validator_src_address = 2 [(gogoproto.moretags) = "yaml:\"validator_src_address\""]; + string validator_src_address = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; // validator_dst_address is the validator redelegation destination operator address. - string validator_dst_address = 3 [(gogoproto.moretags) = "yaml:\"validator_dst_address\""]; + string validator_dst_address = 3 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; // entries are the redelegation entries. - repeated RedelegationEntry entries = 4 [(gogoproto.nullable) = false]; // redelegation entries + repeated RedelegationEntry entries = 4 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // redelegation entries } -// Params defines the parameters for the staking module. +// Params defines the parameters for the x/staking module. message Params { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; + option (amino.name) = "cosmos-sdk/x/staking/Params"; + option (gogoproto.equal) = true; // unbonding_time is the time duration of unbonding. google.protobuf.Duration unbonding_time = 1 - [(gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.moretags) = "yaml:\"unbonding_time\""]; + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdduration) = true]; // max_validators is the maximum number of validators. - uint32 max_validators = 2 [(gogoproto.moretags) = "yaml:\"max_validators\""]; + uint32 max_validators = 2; // max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). - uint32 max_entries = 3 [(gogoproto.moretags) = "yaml:\"max_entries\""]; + uint32 max_entries = 3; // historical_entries is the number of historical entries to persist. - uint32 historical_entries = 4 [(gogoproto.moretags) = "yaml:\"historical_entries\""]; + uint32 historical_entries = 4; // bond_denom defines the bondable coin denomination. - string bond_denom = 5 [(gogoproto.moretags) = "yaml:\"bond_denom\""]; + string bond_denom = 5; + // min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators + string min_commission_rate = 6 [ + (gogoproto.moretags) = "yaml:\"min_commission_rate\"", + (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (cosmos_proto.scalar) = "cosmos.Dec" + ]; } // DelegationResponse is equivalent to Delegation except that it contains a // balance in addition to shares which is more suitable for client responses. message DelegationResponse { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; + option (gogoproto.equal) = false; - Delegation delegation = 1 [(gogoproto.nullable) = false]; + Delegation delegation = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - cosmos.base.v1beta1.Coin balance = 2 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.Coin balance = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // RedelegationEntryResponse is equivalent to a RedelegationEntry except that it @@ -320,8 +338,12 @@ message DelegationResponse { message RedelegationEntryResponse { option (gogoproto.equal) = true; - RedelegationEntry redelegation_entry = 1 [(gogoproto.nullable) = false]; - string balance = 4 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; + RedelegationEntry redelegation_entry = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + string balance = 4 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false + ]; } // RedelegationResponse is equivalent to a Redelegation except that its entries @@ -330,8 +352,8 @@ message RedelegationEntryResponse { message RedelegationResponse { option (gogoproto.equal) = false; - Redelegation redelegation = 1 [(gogoproto.nullable) = false]; - repeated RedelegationEntryResponse entries = 2 [(gogoproto.nullable) = false]; + Redelegation redelegation = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + repeated RedelegationEntryResponse entries = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // Pool is used for tracking bonded and not-bonded token supply of the bond @@ -340,31 +362,33 @@ message Pool { option (gogoproto.description) = true; option (gogoproto.equal) = true; string not_bonded_tokens = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false, (gogoproto.jsontag) = "not_bonded_tokens", - (gogoproto.nullable) = false + (amino.dont_omitempty) = true ]; string bonded_tokens = 2 [ - (gogoproto.jsontag) = "bonded_tokens", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"bonded_tokens\"" + (gogoproto.jsontag) = "bonded_tokens", + (amino.dont_omitempty) = true ]; } -// InfractionType indicates the infraction type a validator commited. -enum InfractionType { - option (gogoproto.goproto_enum_prefix) = false; - - // UNSPECIFIED defines an empty infraction type. - INFRACTION_TYPE_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "InfractionEmpty"]; +// Infraction indicates the infraction a validator commited. +enum Infraction { + // UNSPECIFIED defines an empty infraction. + INFRACTION_UNSPECIFIED = 0; // DOUBLE_SIGN defines a validator that double-signs a block. - INFRACTION_TYPE_DOUBLE_SIGN = 1 [(gogoproto.enumvalue_customname) = "DoubleSign"]; + INFRACTION_DOUBLE_SIGN = 1; // DOWNTIME defines a validator that missed signing too many blocks. - INFRACTION_TYPE_DOWNTIME = 2 [(gogoproto.enumvalue_customname) = "Downtime"]; + INFRACTION_DOWNTIME = 2; } // ValidatorUpdates defines an array of abci.ValidatorUpdate objects. +// TODO: explore moving this to proto/cosmos/base to separate modules from tendermint dependence message ValidatorUpdates { - repeated tendermint.abci.ValidatorUpdate updates = 1 [(gogoproto.nullable) = false]; -} \ No newline at end of file + repeated tendermint.abci.ValidatorUpdate updates = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} diff --git a/proto/cosmos/staking/v1beta1/tx.proto b/proto/cosmos/staking/v1beta1/tx.proto index d074fe0..238645b 100644 --- a/proto/cosmos/staking/v1beta1/tx.proto +++ b/proto/cosmos/staking/v1beta1/tx.proto @@ -8,11 +8,15 @@ import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmos/staking/v1beta1/staking.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; // Msg defines the staking Msg service. service Msg { + option (cosmos.msg.v1.service) = true; + // CreateValidator defines a method for creating a new validator. rpc CreateValidator(MsgCreateValidator) returns (MsgCreateValidatorResponse); @@ -30,24 +34,42 @@ service Msg { // Undelegate defines a method for performing an undelegation from a // delegate and a validator. rpc Undelegate(MsgUndelegate) returns (MsgUndelegateResponse); + + // CancelUnbondingDelegation defines a method for performing canceling the unbonding delegation + // and delegate back to previous validator. + // + // Since: cosmos-sdk 0.46 + rpc CancelUnbondingDelegation(MsgCancelUnbondingDelegation) returns (MsgCancelUnbondingDelegationResponse); + + // UpdateParams defines an operation for updating the x/staking module + // parameters. + // Since: cosmos-sdk 0.47 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } // MsgCreateValidator defines a SDK message for creating a new validator. message MsgCreateValidator { + option (cosmos.msg.v1.signer) = "validator_address"; + option (amino.name) = "cosmos-sdk/MsgCreateValidator"; + option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - Description description = 1 [(gogoproto.nullable) = false]; - CommissionRates commission = 2 [(gogoproto.nullable) = false]; + Description description = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + CommissionRates commission = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; string min_self_delegation = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"min_self_delegation\"", - (gogoproto.nullable) = false + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true ]; - string delegator_address = 4 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - string validator_address = 5 [(gogoproto.moretags) = "yaml:\"validator_address\""]; + // Deprecated: Use of Delegator Address in MsgCreateValidator is deprecated. + // The validator address bytes and delegator address bytes refer to the same account while creating validator (defer + // only in bech32 notation). + string delegator_address = 4 [(cosmos_proto.scalar) = "cosmos.AddressString", deprecated = true]; + string validator_address = 5 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; google.protobuf.Any pubkey = 6 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"]; - cosmos.base.v1beta1.Coin value = 7 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.Coin value = 7 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // MsgCreateValidatorResponse defines the Msg/CreateValidator response type. @@ -55,24 +77,23 @@ message MsgCreateValidatorResponse {} // MsgEditValidator defines a SDK message for editing an existing validator. message MsgEditValidator { + option (cosmos.msg.v1.signer) = "validator_address"; + option (amino.name) = "cosmos-sdk/MsgEditValidator"; + option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - Description description = 1 [(gogoproto.nullable) = false]; - string validator_address = 2 [(gogoproto.moretags) = "yaml:\"address\""]; + Description description = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; // We pass a reference to the new commission rate and min self delegation as // it's not mandatory to update. If not updated, the deserialized rate will be // zero with no way to distinguish if an update was intended. // REF: #2373 - string commission_rate = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.moretags) = "yaml:\"commission_rate\"" - ]; - string min_self_delegation = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"min_self_delegation\"" - ]; + string commission_rate = 3 + [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec"]; + string min_self_delegation = 4 + [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "cosmossdk.io/math.Int"]; } // MsgEditValidatorResponse defines the Msg/EditValidator response type. @@ -81,11 +102,15 @@ message MsgEditValidatorResponse {} // MsgDelegate defines a SDK message for performing a delegation of coins // from a delegator to a validator. message MsgDelegate { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "cosmos-sdk/MsgDelegate"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""]; - cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false]; + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; + cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // MsgDelegateResponse defines the Msg/Delegate response type. @@ -94,30 +119,88 @@ message MsgDelegateResponse {} // MsgBeginRedelegate defines a SDK message for performing a redelegation // of coins from a delegator and source validator to a destination validator. message MsgBeginRedelegate { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "cosmos-sdk/MsgBeginRedelegate"; - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - string validator_src_address = 2 [(gogoproto.moretags) = "yaml:\"validator_src_address\""]; - string validator_dst_address = 3 [(gogoproto.moretags) = "yaml:\"validator_dst_address\""]; - cosmos.base.v1beta1.Coin amount = 4 [(gogoproto.nullable) = false]; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_src_address = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; + string validator_dst_address = 3 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; + cosmos.base.v1beta1.Coin amount = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. message MsgBeginRedelegateResponse { - google.protobuf.Timestamp completion_time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp completion_time = 1 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; } // MsgUndelegate defines a SDK message for performing an undelegation from a // delegate and a validator. message MsgUndelegate { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "cosmos-sdk/MsgUndelegate"; + + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""]; - cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false]; + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; + cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // MsgUndelegateResponse defines the Msg/Undelegate response type. message MsgUndelegateResponse { - google.protobuf.Timestamp completion_time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp completion_time = 1 + [(gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.stdtime) = true]; + + // amount returns the amount of undelegated coins + // + // Since: cosmos-sdk 0.50 + cosmos.base.v1beta1.Coin amount = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } + +// MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator +// +// Since: cosmos-sdk 0.46 +message MsgCancelUnbondingDelegation { + option (cosmos.msg.v1.signer) = "delegator_address"; + option (amino.name) = "cosmos-sdk/MsgCancelUnbondingDelegation"; + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.ValidatorAddressString"]; + // amount is always less than or equal to unbonding delegation entry balance + cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // creation_height is the height which the unbonding took place. + int64 creation_height = 4; +} + +// MsgCancelUnbondingDelegationResponse +// +// Since: cosmos-sdk 0.46 +message MsgCancelUnbondingDelegationResponse {} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/x/staking/MsgUpdateParams"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // params defines the x/staking parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +}; + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {}; diff --git a/proto/cosmos/store/internal/kv/v1beta1/kv.proto b/proto/cosmos/store/internal/kv/v1beta1/kv.proto new file mode 100644 index 0000000..4243444 --- /dev/null +++ b/proto/cosmos/store/internal/kv/v1beta1/kv.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; +package cosmos.store.internal.kv.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "cosmossdk.io/store/internal/kv"; + +// This is duplicated from the base kv directory to avoid a circular dependency with the cosmos-sdk + +// Pairs defines a repeated slice of Pair objects. +message Pairs { + repeated Pair pairs = 1 [(gogoproto.nullable) = false]; +} + +// Pair defines a key/value bytes tuple. +message Pair { + bytes key = 1; + bytes value = 2; +} diff --git a/proto/cosmos/store/snapshots/v1/snapshot.proto b/proto/cosmos/store/snapshots/v1/snapshot.proto new file mode 100644 index 0000000..af49bda --- /dev/null +++ b/proto/cosmos/store/snapshots/v1/snapshot.proto @@ -0,0 +1,67 @@ +syntax = "proto3"; +package cosmos.store.snapshots.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "cosmossdk.io/store/snapshots/types"; + +// Snapshot contains Tendermint state sync snapshot info. +message Snapshot { + uint64 height = 1; + uint32 format = 2; + uint32 chunks = 3; + bytes hash = 4; + Metadata metadata = 5 [(gogoproto.nullable) = false]; +} + +// Metadata contains SDK-specific snapshot metadata. +message Metadata { + repeated bytes chunk_hashes = 1; // SHA-256 chunk hashes +} + +// SnapshotItem is an item contained in a rootmulti.Store snapshot. +// +// Since: cosmos-sdk 0.46 +message SnapshotItem { + // item is the specific type of snapshot item. + oneof item { + SnapshotStoreItem store = 1; + SnapshotIAVLItem iavl = 2 [(gogoproto.customname) = "IAVL"]; + SnapshotExtensionMeta extension = 3; + SnapshotExtensionPayload extension_payload = 4; + } +} + +// SnapshotStoreItem contains metadata about a snapshotted store. +// +// Since: cosmos-sdk 0.46 +message SnapshotStoreItem { + string name = 1; +} + +// SnapshotIAVLItem is an exported IAVL node. +// +// Since: cosmos-sdk 0.46 +message SnapshotIAVLItem { + bytes key = 1; + bytes value = 2; + // version is block height + int64 version = 3; + // height is depth of the tree. + int32 height = 4; +} + +// SnapshotExtensionMeta contains metadata about an external snapshotter. +// +// Since: cosmos-sdk 0.46 +message SnapshotExtensionMeta { + string name = 1; + uint32 format = 2; +} + +// SnapshotExtensionPayload contains payloads of an external snapshotter. +// +// Since: cosmos-sdk 0.46 +message SnapshotExtensionPayload { + bytes payload = 1; +} \ No newline at end of file diff --git a/proto/cosmos/store/streaming/abci/grpc.proto b/proto/cosmos/store/streaming/abci/grpc.proto new file mode 100644 index 0000000..25366cd --- /dev/null +++ b/proto/cosmos/store/streaming/abci/grpc.proto @@ -0,0 +1,36 @@ +syntax = "proto3"; + +package cosmos.store.streaming.abci; + +import "tendermint/abci/types.proto"; +import "cosmos/store/v1beta1/listening.proto"; + +option go_package = "cosmossdk.io/store/streaming/abci"; + +// ListenEndBlockRequest is the request type for the ListenEndBlock RPC method +message ListenFinalizeBlockRequest { + tendermint.abci.RequestFinalizeBlock req = 1; + tendermint.abci.ResponseFinalizeBlock res = 2; +} + +// ListenEndBlockResponse is the response type for the ListenEndBlock RPC method +message ListenFinalizeBlockResponse {} + +// ListenCommitRequest is the request type for the ListenCommit RPC method +message ListenCommitRequest { + // explicitly pass in block height as ResponseCommit does not contain this info + int64 block_height = 1; + tendermint.abci.ResponseCommit res = 2; + repeated cosmos.store.v1beta1.StoreKVPair change_set = 3; +} + +// ListenCommitResponse is the response type for the ListenCommit RPC method +message ListenCommitResponse {} + +// ABCIListenerService is the service for the BaseApp ABCIListener interface +service ABCIListenerService { + // ListenFinalizeBlock is the corresponding endpoint for ABCIListener.ListenEndBlock + rpc ListenFinalizeBlock(ListenFinalizeBlockRequest) returns (ListenFinalizeBlockResponse); + // ListenCommit is the corresponding endpoint for ABCIListener.ListenCommit + rpc ListenCommit(ListenCommitRequest) returns (ListenCommitResponse); +} diff --git a/proto/cosmos/store/v1beta1/commit_info.proto b/proto/cosmos/store/v1beta1/commit_info.proto new file mode 100644 index 0000000..37459a0 --- /dev/null +++ b/proto/cosmos/store/v1beta1/commit_info.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; +package cosmos.store.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cosmossdk.io/store/types"; + +// CommitInfo defines commit information used by the multi-store when committing +// a version/height. +message CommitInfo { + int64 version = 1; + repeated StoreInfo store_infos = 2 [(gogoproto.nullable) = false]; + google.protobuf.Timestamp timestamp = 3 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} + +// StoreInfo defines store-specific commit information. It contains a reference +// between a store name and the commit ID. +message StoreInfo { + string name = 1; + CommitID commit_id = 2 [(gogoproto.nullable) = false]; +} + +// CommitID defines the commitment information when a specific store is +// committed. +message CommitID { + option (gogoproto.goproto_stringer) = false; + + int64 version = 1; + bytes hash = 2; +} diff --git a/proto/cosmos/store/v1beta1/listening.proto b/proto/cosmos/store/v1beta1/listening.proto new file mode 100644 index 0000000..14bc2e7 --- /dev/null +++ b/proto/cosmos/store/v1beta1/listening.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; +package cosmos.store.v1beta1; + +import "tendermint/abci/types.proto"; + +option go_package = "cosmossdk.io/store/types"; + +// StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and Deletes) +// It optionally includes the StoreKey for the originating KVStore and a Boolean flag to distinguish between Sets and +// Deletes +// +// Since: cosmos-sdk 0.43 +message StoreKVPair { + string store_key = 1; // the store key for the KVStore this pair originates from + bool delete = 2; // true indicates a delete operation, false indicates a set operation + bytes key = 3; + bytes value = 4; +} + +// BlockMetadata contains all the abci event data of a block +// the file streamer dump them into files together with the state changes. +message BlockMetadata { + tendermint.abci.ResponseCommit response_commit = 6; + tendermint.abci.RequestFinalizeBlock request_finalize_block = 7; + tendermint.abci.ResponseFinalizeBlock response_finalize_block = 8; // TODO: should we renumber this? + + reserved 1, 2, 3, 4, 5; // reserved for from previous use in comet <= 0.37 +} diff --git a/proto/cosmos/tx/config/v1/config.proto b/proto/cosmos/tx/config/v1/config.proto new file mode 100644 index 0000000..15553a2 --- /dev/null +++ b/proto/cosmos/tx/config/v1/config.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package cosmos.tx.config.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Config is the config object of the x/auth/tx package. +message Config { + option (cosmos.app.v1alpha1.module) = { + go_import: "github.com/cosmos/cosmos-sdk/x/auth/tx" + }; + + // skip_ante_handler defines whether the ante handler registration should be skipped in case an app wants to override + // this functionality. + bool skip_ante_handler = 1; + + // skip_post_handler defines whether the post handler registration should be skipped in case an app wants to override + // this functionality. + bool skip_post_handler = 2; +} \ No newline at end of file diff --git a/proto/cosmos/tx/signing/v1beta1/signing.proto b/proto/cosmos/tx/signing/v1beta1/signing.proto index 50de89c..584eff4 100644 --- a/proto/cosmos/tx/signing/v1beta1/signing.proto +++ b/proto/cosmos/tx/signing/v1beta1/signing.proto @@ -7,22 +7,38 @@ import "google/protobuf/any.proto"; option go_package = "github.com/cosmos/cosmos-sdk/types/tx/signing"; // SignMode represents a signing mode with its own security guarantees. +// +// This enum should be considered a registry of all known sign modes +// in the Cosmos ecosystem. Apps are not expected to support all known +// sign modes. Apps that would like to support custom sign modes are +// encouraged to open a small PR against this file to add a new case +// to this SignMode enum describing their sign mode so that different +// apps have a consistent version of this enum. enum SignMode { // SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be - // rejected + // rejected. SIGN_MODE_UNSPECIFIED = 0; // SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is - // verified with raw bytes from Tx + // verified with raw bytes from Tx. SIGN_MODE_DIRECT = 1; // SIGN_MODE_TEXTUAL is a future signing mode that will verify some // human-readable textual representation on top of the binary representation - // from SIGN_MODE_DIRECT + // from SIGN_MODE_DIRECT. + // + // Since: cosmos-sdk 0.50 SIGN_MODE_TEXTUAL = 2; + // SIGN_MODE_DIRECT_AUX specifies a signing mode which uses + // SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not + // require signers signing over other signers' `signer_info`. + // + // Since: cosmos-sdk 0.46 + SIGN_MODE_DIRECT_AUX = 3; + // SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses - // Amino JSON and will be removed in the future + // Amino JSON and will be removed in the future. SIGN_MODE_LEGACY_AMINO_JSON = 127; // SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos diff --git a/proto/cosmos/tx/v1beta1/service.proto b/proto/cosmos/tx/v1beta1/service.proto index d9f828f..7e19a18 100644 --- a/proto/cosmos/tx/v1beta1/service.proto +++ b/proto/cosmos/tx/v1beta1/service.proto @@ -4,13 +4,11 @@ package cosmos.tx.v1beta1; import "google/api/annotations.proto"; import "cosmos/base/abci/v1beta1/abci.proto"; import "cosmos/tx/v1beta1/tx.proto"; -import "gogoproto/gogo.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; import "tendermint/types/block.proto"; import "tendermint/types/types.proto"; -option (gogoproto.goproto_registration) = true; -option go_package = "github.com/cosmos/cosmos-sdk/types/tx"; +option go_package = "github.com/cosmos/cosmos-sdk/types/tx"; // Service defines a gRPC service for interacting with transactions. service Service { @@ -42,21 +40,77 @@ service Service { rpc GetBlockWithTxs(GetBlockWithTxsRequest) returns (GetBlockWithTxsResponse) { option (google.api.http).get = "/cosmos/tx/v1beta1/txs/block/{height}"; } + // TxDecode decodes the transaction. + // + // Since: cosmos-sdk 0.47 + rpc TxDecode(TxDecodeRequest) returns (TxDecodeResponse) { + option (google.api.http) = { + post: "/cosmos/tx/v1beta1/decode" + body: "*" + }; + } + // TxEncode encodes the transaction. + // + // Since: cosmos-sdk 0.47 + rpc TxEncode(TxEncodeRequest) returns (TxEncodeResponse) { + option (google.api.http) = { + post: "/cosmos/tx/v1beta1/encode" + body: "*" + }; + } + // TxEncodeAmino encodes an Amino transaction from JSON to encoded bytes. + // + // Since: cosmos-sdk 0.47 + rpc TxEncodeAmino(TxEncodeAminoRequest) returns (TxEncodeAminoResponse) { + option (google.api.http) = { + post: "/cosmos/tx/v1beta1/encode/amino" + body: "*" + }; + } + // TxDecodeAmino decodes an Amino transaction from encoded bytes to JSON. + // + // Since: cosmos-sdk 0.47 + rpc TxDecodeAmino(TxDecodeAminoRequest) returns (TxDecodeAminoResponse) { + option (google.api.http) = { + post: "/cosmos/tx/v1beta1/decode/amino" + body: "*" + }; + } } // GetTxsEventRequest is the request type for the Service.TxsByEvents // RPC method. message GetTxsEventRequest { // events is the list of transaction event type. - repeated string events = 1; + // Deprecated post v0.47.x: use query instead, which should contain a valid + // events query. + repeated string events = 1 [deprecated = true]; + // pagination defines a pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; - OrderBy order_by = 3; + // Deprecated post v0.46.x: use page and limit instead. + cosmos.base.query.v1beta1.PageRequest pagination = 2 [deprecated = true]; + + OrderBy order_by = 3; + + // page is the page number to query, starts at 1. If not provided, will + // default to first page. + uint64 page = 4; + + // limit is the total number of results to be returned in the result page. + // If left empty it will default to a value to be set by each app. + uint64 limit = 5; + + // query defines the transaction event query that is proxied to Tendermint's + // TxSearch RPC method. The query must be valid. + // + // Since cosmos-sdk 0.50 + string query = 6; } // OrderBy defines the sorting order enum OrderBy { - // ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case. + // ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults + // to ASC in this case. ORDER_BY_UNSPECIFIED = 0; // ORDER_BY_ASC defines ascending order ORDER_BY_ASC = 1; @@ -72,7 +126,10 @@ message GetTxsEventResponse { // tx_responses is the list of queried TxResponses. repeated cosmos.base.abci.v1beta1.TxResponse tx_responses = 2; // pagination defines a pagination for the response. - cosmos.base.query.v1beta1.PageResponse pagination = 3; + // Deprecated post v0.46.x: use total instead. + cosmos.base.query.v1beta1.PageResponse pagination = 3 [deprecated = true]; + // total is total number of results available + uint64 total = 4; } // BroadcastTxRequest is the request type for the Service.BroadcastTxRequest @@ -83,18 +140,19 @@ message BroadcastTxRequest { BroadcastMode mode = 2; } -// BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method. +// BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC +// method. enum BroadcastMode { // zero-value for mode ordering BROADCAST_MODE_UNSPECIFIED = 0; - // BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for - // the tx to be committed in a block. - BROADCAST_MODE_BLOCK = 1; - // BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for - // a CheckTx execution response only. + // DEPRECATED: use BROADCAST_MODE_SYNC instead, + // BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x onwards. + BROADCAST_MODE_BLOCK = 1 [deprecated = true]; + // BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits + // for a CheckTx execution response only. BROADCAST_MODE_SYNC = 2; - // BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns - // immediately. + // BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client + // returns immediately. BROADCAST_MODE_ASYNC = 3; } @@ -152,7 +210,8 @@ message GetBlockWithTxsRequest { cosmos.base.query.v1beta1.PageRequest pagination = 2; } -// GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. +// GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs +// method. // // Since: cosmos-sdk 0.45.2 message GetBlockWithTxsResponse { @@ -162,4 +221,72 @@ message GetBlockWithTxsResponse { .tendermint.types.Block block = 3; // pagination defines a pagination for the response. cosmos.base.query.v1beta1.PageResponse pagination = 4; -} \ No newline at end of file +} + +// TxDecodeRequest is the request type for the Service.TxDecode +// RPC method. +// +// Since: cosmos-sdk 0.47 +message TxDecodeRequest { + // tx_bytes is the raw transaction. + bytes tx_bytes = 1; +} + +// TxDecodeResponse is the response type for the +// Service.TxDecode method. +// +// Since: cosmos-sdk 0.47 +message TxDecodeResponse { + // tx is the decoded transaction. + cosmos.tx.v1beta1.Tx tx = 1; +} + +// TxEncodeRequest is the request type for the Service.TxEncode +// RPC method. +// +// Since: cosmos-sdk 0.47 +message TxEncodeRequest { + // tx is the transaction to encode. + cosmos.tx.v1beta1.Tx tx = 1; +} + +// TxEncodeResponse is the response type for the +// Service.TxEncode method. +// +// Since: cosmos-sdk 0.47 +message TxEncodeResponse { + // tx_bytes is the encoded transaction bytes. + bytes tx_bytes = 1; +} + +// TxEncodeAminoRequest is the request type for the Service.TxEncodeAmino +// RPC method. +// +// Since: cosmos-sdk 0.47 +message TxEncodeAminoRequest { + string amino_json = 1; +} + +// TxEncodeAminoResponse is the response type for the Service.TxEncodeAmino +// RPC method. +// +// Since: cosmos-sdk 0.47 +message TxEncodeAminoResponse { + bytes amino_binary = 1; +} + +// TxDecodeAminoRequest is the request type for the Service.TxDecodeAmino +// RPC method. +// +// Since: cosmos-sdk 0.47 +message TxDecodeAminoRequest { + bytes amino_binary = 1; +} + +// TxDecodeAminoResponse is the response type for the Service.TxDecodeAmino +// RPC method. +// +// Since: cosmos-sdk 0.47 +message TxDecodeAminoResponse { + string amino_json = 1; +} diff --git a/proto/cosmos/tx/v1beta1/tx.proto b/proto/cosmos/tx/v1beta1/tx.proto index 6d5caf1..cfaac70 100644 --- a/proto/cosmos/tx/v1beta1/tx.proto +++ b/proto/cosmos/tx/v1beta1/tx.proto @@ -1,11 +1,13 @@ syntax = "proto3"; package cosmos.tx.v1beta1; +import "amino/amino.proto"; import "gogoproto/gogo.proto"; import "cosmos/crypto/multisig/v1beta1/multisig.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmos/tx/signing/v1beta1/signing.proto"; import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; option go_package = "github.com/cosmos/cosmos-sdk/types/tx"; @@ -63,6 +65,33 @@ message SignDoc { uint64 account_number = 4; } +// SignDocDirectAux is the type used for generating sign bytes for +// SIGN_MODE_DIRECT_AUX. +// +// Since: cosmos-sdk 0.46 +message SignDocDirectAux { + // body_bytes is protobuf serialization of a TxBody that matches the + // representation in TxRaw. + bytes body_bytes = 1; + + // public_key is the public key of the signing account. + google.protobuf.Any public_key = 2; + + // chain_id is the identifier of the chain this transaction targets. + // It prevents signed transactions from being used on another chain by an + // attacker. + string chain_id = 3; + + // account_number is the account number of the account in state. + uint64 account_number = 4; + + // sequence is the sequence number of the signing account. + uint64 sequence = 5; + + // tips have been depreacted and should not be used + Tip tip = 6 [deprecated = true]; +} + // TxBody is the body of a transaction that all signers sign over. message TxBody { // messages is a list of messages to be executed. The required signers of @@ -108,6 +137,13 @@ message AuthInfo { // based on the cost of evaluating the body and doing signature verification // of the signers. This can be estimated via simulation. Fee fee = 2; + // Tip is the optional tip used for transactions fees paid in another denom. + // + // This field is ignored if the chain didn't enable tips, i.e. didn't add the + // `TipDecorator` in its posthandler. + // + // Since: cosmos-sdk 0.46 + Tip tip = 3 [deprecated = true]; } // SignerInfo describes the public key and signing mode of a single top-level @@ -164,8 +200,12 @@ message ModeInfo { // which must be above some miminum to be accepted into the mempool. message Fee { // amount is the amount of coins to be paid as a fee - repeated cosmos.base.v1beta1.Coin amount = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin amount = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins" + ]; // gas_limit is the maximum gas that can be used in transaction processing // before an out of gas error occurs @@ -174,10 +214,47 @@ message Fee { // if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. // the payer must be a tx signer (and thus have signed this field in AuthInfo). // setting this field does *not* change the ordering of required signers for the transaction. - string payer = 3; + string payer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used // to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does // not support fee grants, this will fail - string granter = 4; + string granter = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// Tip is the tip used for meta-transactions. +// +// Since: cosmos-sdk 0.46 +message Tip { + option deprecated = true; + // amount is the amount of the tip + repeated cosmos.base.v1beta1.Coin amount = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins" + ]; + // tipper is the address of the account paying for the tip + string tipper = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// AuxSignerData is the intermediary format that an auxiliary signer (e.g. a +// tipper) builds and sends to the fee payer (who will build and broadcast the +// actual tx). AuxSignerData is not a valid tx in itself, and will be rejected +// by the node if sent directly as-is. +// +// Since: cosmos-sdk 0.46 +message AuxSignerData { + // address is the bech32-encoded address of the auxiliary signer. If using + // AuxSignerData across different chains, the bech32 prefix of the target + // chain (where the final transaction is broadcasted) should be used. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // sign_doc is the SIGN_MODE_DIRECT_AUX sign doc that the auxiliary signer + // signs. Note: we use the same sign doc even if we're signing with + // LEGACY_AMINO_JSON. + SignDocDirectAux sign_doc = 2; + // mode is the signing mode of the single signer. + cosmos.tx.signing.v1beta1.SignMode mode = 3; + // sig is the signature of the sign doc. + bytes sig = 4; } diff --git a/proto/cosmos/upgrade/v1beta1/query.proto b/proto/cosmos/upgrade/v1beta1/query.proto index dd14ba6..2b90a78 100644 --- a/proto/cosmos/upgrade/v1beta1/query.proto +++ b/proto/cosmos/upgrade/v1beta1/query.proto @@ -1,11 +1,10 @@ syntax = "proto3"; package cosmos.upgrade.v1beta1; -import "google/protobuf/any.proto"; import "google/api/annotations.proto"; import "cosmos/upgrade/v1beta1/upgrade.proto"; -option go_package = "github.com/cosmos/cosmos-sdk/x/upgrade/types"; +option go_package = "cosmossdk.io/x/upgrade/types"; // Query defines the gRPC upgrade querier service. service Query { @@ -36,6 +35,13 @@ service Query { rpc ModuleVersions(QueryModuleVersionsRequest) returns (QueryModuleVersionsResponse) { option (google.api.http).get = "/cosmos/upgrade/v1beta1/module_versions"; } + + // Returns the account with authority to conduct upgrades + // + // Since: cosmos-sdk 0.46 + rpc Authority(QueryAuthorityRequest) returns (QueryAuthorityResponse) { + option (google.api.http).get = "/cosmos/upgrade/v1beta1/authority"; + } } // QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC @@ -102,3 +108,15 @@ message QueryModuleVersionsResponse { // module_versions is a list of module names with their consensus versions. repeated ModuleVersion module_versions = 1; } + +// QueryAuthorityRequest is the request type for Query/Authority +// +// Since: cosmos-sdk 0.46 +message QueryAuthorityRequest {} + +// QueryAuthorityResponse is the response type for Query/Authority +// +// Since: cosmos-sdk 0.46 +message QueryAuthorityResponse { + string address = 1; +} \ No newline at end of file diff --git a/proto/cosmos/upgrade/v1beta1/tx.proto b/proto/cosmos/upgrade/v1beta1/tx.proto new file mode 100644 index 0000000..4a6c9ee --- /dev/null +++ b/proto/cosmos/upgrade/v1beta1/tx.proto @@ -0,0 +1,62 @@ +// Since: cosmos-sdk 0.46 +syntax = "proto3"; +package cosmos.upgrade.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/upgrade/v1beta1/upgrade.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; + +option go_package = "cosmossdk.io/x/upgrade/types"; + +// Msg defines the upgrade Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // SoftwareUpgrade is a governance operation for initiating a software upgrade. + // + // Since: cosmos-sdk 0.46 + rpc SoftwareUpgrade(MsgSoftwareUpgrade) returns (MsgSoftwareUpgradeResponse); + + // CancelUpgrade is a governance operation for cancelling a previously + // approved software upgrade. + // + // Since: cosmos-sdk 0.46 + rpc CancelUpgrade(MsgCancelUpgrade) returns (MsgCancelUpgradeResponse); +} + +// MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. +// +// Since: cosmos-sdk 0.46 +message MsgSoftwareUpgrade { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/MsgSoftwareUpgrade"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // plan is the upgrade plan. + Plan plan = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. +// +// Since: cosmos-sdk 0.46 +message MsgSoftwareUpgradeResponse {} + +// MsgCancelUpgrade is the Msg/CancelUpgrade request type. +// +// Since: cosmos-sdk 0.46 +message MsgCancelUpgrade { + option (cosmos.msg.v1.signer) = "authority"; + option (amino.name) = "cosmos-sdk/MsgCancelUpgrade"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. +// +// Since: cosmos-sdk 0.46 +message MsgCancelUpgradeResponse {} diff --git a/proto/cosmos/upgrade/v1beta1/upgrade.proto b/proto/cosmos/upgrade/v1beta1/upgrade.proto index e888b39..5dfb289 100644 --- a/proto/cosmos/upgrade/v1beta1/upgrade.proto +++ b/proto/cosmos/upgrade/v1beta1/upgrade.proto @@ -4,14 +4,16 @@ package cosmos.upgrade.v1beta1; import "google/protobuf/any.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; -option go_package = "github.com/cosmos/cosmos-sdk/x/upgrade/types"; +option go_package = "cosmossdk.io/x/upgrade/types"; option (gogoproto.goproto_getters_all) = false; // Plan specifies information about a planned upgrade and when it should occur. message Plan { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; + option (amino.name) = "cosmos-sdk/Plan"; + option (gogoproto.equal) = true; // Sets the name for the upgrade. This name will be used by the upgraded // version of the software to apply any special "on-upgrade" commands during @@ -25,10 +27,10 @@ message Plan { // Deprecated: Time based upgrades have been deprecated. Time based upgrade logic // has been removed from the SDK. // If this field is not empty, an error will be thrown. - google.protobuf.Timestamp time = 2 [deprecated = true, (gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp time = 2 + [deprecated = true, (gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // The height at which the upgrade must be performed. - // Only used if Time is not set. int64 height = 3; // Any application specific upgrade info to be included on-chain @@ -38,28 +40,43 @@ message Plan { // Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been // moved to the IBC module in the sub module 02-client. // If this field is not empty, an error will be thrown. - google.protobuf.Any upgraded_client_state = 5 - [deprecated = true, (gogoproto.moretags) = "yaml:\"upgraded_client_state\""]; + google.protobuf.Any upgraded_client_state = 5 [deprecated = true]; } // SoftwareUpgradeProposal is a gov Content type for initiating a software // upgrade. +// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov +// proposals, see MsgSoftwareUpgrade. message SoftwareUpgradeProposal { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; + option deprecated = true; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + option (amino.name) = "cosmos-sdk/SoftwareUpgradeProposal"; + option (gogoproto.equal) = true; - string title = 1; + // title of the proposal + string title = 1; + + // description of the proposal string description = 2; - Plan plan = 3 [(gogoproto.nullable) = false]; + + // plan of the proposal + Plan plan = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software // upgrade. +// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov +// proposals, see MsgCancelUpgrade. message CancelSoftwareUpgradeProposal { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; + option deprecated = true; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + option (amino.name) = "cosmos-sdk/CancelSoftwareUpgradeProposal"; + option (gogoproto.equal) = true; + + // title of the proposal + string title = 1; - string title = 1; + // description of the proposal string description = 2; } @@ -67,8 +84,7 @@ message CancelSoftwareUpgradeProposal { // // Since: cosmos-sdk 0.43 message ModuleVersion { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = true; + option (gogoproto.equal) = true; // name of the app module string name = 1; diff --git a/proto/cosmos/vesting/v1beta1/tx.proto b/proto/cosmos/vesting/v1beta1/tx.proto index c49be80..6700872 100644 --- a/proto/cosmos/vesting/v1beta1/tx.proto +++ b/proto/cosmos/vesting/v1beta1/tx.proto @@ -3,29 +3,100 @@ package cosmos.vesting.v1beta1; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/vesting/v1beta1/vesting.proto"; +import "cosmos/msg/v1/msg.proto"; +import "amino/amino.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"; // Msg defines the bank Msg service. service Msg { + option (cosmos.msg.v1.service) = true; + // CreateVestingAccount defines a method that enables creating a vesting // account. rpc CreateVestingAccount(MsgCreateVestingAccount) returns (MsgCreateVestingAccountResponse); + // CreatePermanentLockedAccount defines a method that enables creating a permanent + // locked account. + // + // Since: cosmos-sdk 0.46 + rpc CreatePermanentLockedAccount(MsgCreatePermanentLockedAccount) returns (MsgCreatePermanentLockedAccountResponse); + // CreatePeriodicVestingAccount defines a method that enables creating a + // periodic vesting account. + // + // Since: cosmos-sdk 0.46 + rpc CreatePeriodicVestingAccount(MsgCreatePeriodicVestingAccount) returns (MsgCreatePeriodicVestingAccountResponse); } // MsgCreateVestingAccount defines a message that enables creating a vesting // account. message MsgCreateVestingAccount { + option (cosmos.msg.v1.signer) = "from_address"; + option (amino.name) = "cosmos-sdk/MsgCreateVestingAccount"; + option (gogoproto.equal) = true; - string from_address = 1 [(gogoproto.moretags) = "yaml:\"from_address\""]; - string to_address = 2 [(gogoproto.moretags) = "yaml:\"to_address\""]; - repeated cosmos.base.v1beta1.Coin amount = 3 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + string from_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string to_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated cosmos.base.v1beta1.Coin amount = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; - int64 end_time = 4 [(gogoproto.moretags) = "yaml:\"end_time\""]; + // end of vesting as unix time (in seconds). + int64 end_time = 4; bool delayed = 5; } // MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. -message MsgCreateVestingAccountResponse {} \ No newline at end of file +message MsgCreateVestingAccountResponse {} + +// MsgCreatePermanentLockedAccount defines a message that enables creating a permanent +// locked account. +// +// Since: cosmos-sdk 0.46 +message MsgCreatePermanentLockedAccount { + option (cosmos.msg.v1.signer) = "from_address"; + option (amino.name) = "cosmos-sdk/MsgCreatePermLockedAccount"; + option (gogoproto.equal) = true; + + string from_address = 1 [(gogoproto.moretags) = "yaml:\"from_address\""]; + string to_address = 2 [(gogoproto.moretags) = "yaml:\"to_address\""]; + repeated cosmos.base.v1beta1.Coin amount = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// MsgCreatePermanentLockedAccountResponse defines the Msg/CreatePermanentLockedAccount response type. +// +// Since: cosmos-sdk 0.46 +message MsgCreatePermanentLockedAccountResponse {} + +// MsgCreateVestingAccount defines a message that enables creating a vesting +// account. +// +// Since: cosmos-sdk 0.46 +message MsgCreatePeriodicVestingAccount { + option (cosmos.msg.v1.signer) = "from_address"; + option (amino.name) = "cosmos-sdk/MsgCreatePeriodVestAccount"; + + option (gogoproto.equal) = false; + + string from_address = 1; + string to_address = 2; + // start of vesting as unix time (in seconds). + int64 start_time = 3; + repeated Period vesting_periods = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; +} + +// MsgCreateVestingAccountResponse defines the Msg/CreatePeriodicVestingAccount +// response type. +// +// Since: cosmos-sdk 0.46 +message MsgCreatePeriodicVestingAccountResponse {} diff --git a/proto/cosmos/vesting/v1beta1/vesting.proto b/proto/cosmos/vesting/v1beta1/vesting.proto index e9f661f..12e9cdd 100644 --- a/proto/cosmos/vesting/v1beta1/vesting.proto +++ b/proto/cosmos/vesting/v1beta1/vesting.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package cosmos.vesting.v1beta1; +import "amino/amino.proto"; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmos/auth/v1beta1/auth.proto"; @@ -10,66 +11,74 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"; // BaseVestingAccount implements the VestingAccount interface. It contains all // the necessary fields needed for any vesting account implementation. message BaseVestingAccount { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; + option (amino.name) = "cosmos-sdk/BaseVestingAccount"; + option (gogoproto.goproto_getters) = false; cosmos.auth.v1beta1.BaseAccount base_account = 1 [(gogoproto.embed) = true]; repeated cosmos.base.v1beta1.Coin original_vesting = 2 [ (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.moretags) = "yaml:\"original_vesting\"" + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" ]; repeated cosmos.base.v1beta1.Coin delegated_free = 3 [ (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.moretags) = "yaml:\"delegated_free\"" + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" ]; repeated cosmos.base.v1beta1.Coin delegated_vesting = 4 [ (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.moretags) = "yaml:\"delegated_vesting\"" + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" ]; - int64 end_time = 5 [(gogoproto.moretags) = "yaml:\"end_time\""]; + // Vesting end time, as unix timestamp (in seconds). + int64 end_time = 5; } // ContinuousVestingAccount implements the VestingAccount interface. It // continuously vests by unlocking coins linearly with respect to time. message ContinuousVestingAccount { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; + option (amino.name) = "cosmos-sdk/ContinuousVestingAccount"; + option (gogoproto.goproto_getters) = false; BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; - int64 start_time = 2 [(gogoproto.moretags) = "yaml:\"start_time\""]; + // Vesting start time, as unix timestamp (in seconds). + int64 start_time = 2; } // DelayedVestingAccount implements the VestingAccount interface. It vests all // coins after a specific time, but non prior. In other words, it keeps them // locked until a specified time. message DelayedVestingAccount { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; + option (amino.name) = "cosmos-sdk/DelayedVestingAccount"; + option (gogoproto.goproto_getters) = false; BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; } // Period defines a length of time and amount of coins that will vest. message Period { - option (gogoproto.goproto_stringer) = false; - + // Period duration in seconds. int64 length = 1; - repeated cosmos.base.v1beta1.Coin amount = 2 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin amount = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; } // PeriodicVestingAccount implements the VestingAccount interface. It // periodically vests by unlocking coins during each specified period. message PeriodicVestingAccount { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; + option (amino.name) = "cosmos-sdk/PeriodicVestingAccount"; + option (gogoproto.goproto_getters) = false; BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; - int64 start_time = 2 [(gogoproto.moretags) = "yaml:\"start_time\""]; - repeated Period vesting_periods = 3 [(gogoproto.moretags) = "yaml:\"vesting_periods\"", (gogoproto.nullable) = false]; + int64 start_time = 2; + repeated Period vesting_periods = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // PermanentLockedAccount implements the VestingAccount interface. It does @@ -78,8 +87,8 @@ message PeriodicVestingAccount { // // Since: cosmos-sdk 0.43 message PermanentLockedAccount { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; + option (amino.name) = "cosmos-sdk/PermanentLockedAccount"; + option (gogoproto.goproto_getters) = false; BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; } diff --git a/proto/cosmwasm/tokenfactory/v1beta1/authorityMetadata.proto b/proto/cosmwasm/tokenfactory/v1beta1/authorityMetadata.proto new file mode 100755 index 0000000..45e5a8b --- /dev/null +++ b/proto/cosmwasm/tokenfactory/v1beta1/authorityMetadata.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package cosmwasm.tokenfactory.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/CosmWasm/wasmd/x/tokenfactory/types"; + +// DenomAuthorityMetadata specifies metadata for addresses that have specific +// capabilities over a token factory denom. Right now there is only one Admin +// permission, but is planned to be extended to the future. +message DenomAuthorityMetadata { + option (gogoproto.equal) = true; + + // Can be empty for no admin, or a valid cosmwasm address + string admin = 1 [ (gogoproto.moretags) = "yaml:\"admin\"" ]; +} \ No newline at end of file diff --git a/proto/cosmwasm/tokenfactory/v1beta1/genesis.proto b/proto/cosmwasm/tokenfactory/v1beta1/genesis.proto new file mode 100755 index 0000000..aa15f19 --- /dev/null +++ b/proto/cosmwasm/tokenfactory/v1beta1/genesis.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; +package cosmwasm.tokenfactory.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmwasm/tokenfactory/v1beta1/authorityMetadata.proto"; +import "cosmwasm/tokenfactory/v1beta1/params.proto"; + +option go_package = "github.com/CosmWasm/wasmd/x/tokenfactory/types"; + +// GenesisState defines the tokenfactory module's genesis state. +message GenesisState { + // params defines the paramaters of the module. + Params params = 1 [ (gogoproto.nullable) = false ]; + + repeated GenesisDenom factory_denoms = 2 [ + (gogoproto.moretags) = "yaml:\"factory_denoms\"", + (gogoproto.nullable) = false + ]; +} + +// GenesisDenom defines a tokenfactory denom that is defined within genesis +// state. The structure contains DenomAuthorityMetadata which defines the +// denom's admin. +message GenesisDenom { + option (gogoproto.equal) = true; + + string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; + DenomAuthorityMetadata authority_metadata = 2 [ + (gogoproto.moretags) = "yaml:\"authority_metadata\"", + (gogoproto.nullable) = false + ]; +} \ No newline at end of file diff --git a/proto/cosmwasm/tokenfactory/v1beta1/params.proto b/proto/cosmwasm/tokenfactory/v1beta1/params.proto new file mode 100755 index 0000000..b9b25e5 --- /dev/null +++ b/proto/cosmwasm/tokenfactory/v1beta1/params.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; +package cosmwasm.tokenfactory.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmwasm/tokenfactory/v1beta1/authorityMetadata.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/CosmWasm/wasmd/x/tokenfactory/types"; + +// Params defines the parameters for the tokenfactory module. +message Params { + repeated cosmos.base.v1beta1.Coin denom_creation_fee = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"denom_creation_fee\"", + (gogoproto.nullable) = false + ]; + + // https://github.com/CosmWasm/wasmd/issues/11 + uint64 denom_creation_gas_consume = 2 [ + (gogoproto.moretags) = "yaml:\"denom_creation_gas_consume\"", + (gogoproto.nullable) = true + ]; +} \ No newline at end of file diff --git a/proto/cosmwasm/tokenfactory/v1beta1/query.proto b/proto/cosmwasm/tokenfactory/v1beta1/query.proto new file mode 100755 index 0000000..62100fe --- /dev/null +++ b/proto/cosmwasm/tokenfactory/v1beta1/query.proto @@ -0,0 +1,71 @@ +syntax = "proto3"; +package cosmwasm.tokenfactory.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmwasm/tokenfactory/v1beta1/authorityMetadata.proto"; +import "cosmwasm/tokenfactory/v1beta1/params.proto"; + +option go_package = "github.com/CosmWasm/wasmd/x/tokenfactory/types"; + +// Query defines the gRPC querier service. +service Query { + // Params defines a gRPC query method that returns the tokenfactory module's + // parameters. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmwasm/tokenfactory/v1beta1/params"; + } + + // DenomAuthorityMetadata defines a gRPC query method for fetching + // DenomAuthorityMetadata for a particular denom. + rpc DenomAuthorityMetadata(QueryDenomAuthorityMetadataRequest) + returns (QueryDenomAuthorityMetadataResponse) { + option (google.api.http).get = + "/cosmwasm/tokenfactory/v1beta1/denoms/{denom}/authority_metadata"; + } + + // DenomsFromCreator defines a gRPC query method for fetching all + // denominations created by a specific admin/creator. + rpc DenomsFromCreator(QueryDenomsFromCreatorRequest) + returns (QueryDenomsFromCreatorResponse) { + option (google.api.http).get = + "/cosmwasm/tokenfactory/v1beta1/denoms_from_creator/{creator}"; + } +} + +// 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 ]; +} + +// QueryDenomAuthorityMetadataRequest defines the request structure for the +// DenomAuthorityMetadata gRPC query. +message QueryDenomAuthorityMetadataRequest { + string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; +} + +// QueryDenomAuthorityMetadataResponse defines the response structure for the +// DenomAuthorityMetadata gRPC query. +message QueryDenomAuthorityMetadataResponse { + DenomAuthorityMetadata authority_metadata = 1 [ + (gogoproto.moretags) = "yaml:\"authority_metadata\"", + (gogoproto.nullable) = false + ]; +} + +// QueryDenomsFromCreatorRequest defines the request structure for the +// DenomsFromCreator gRPC query. +message QueryDenomsFromCreatorRequest { + string creator = 1 [ (gogoproto.moretags) = "yaml:\"creator\"" ]; +} + +// QueryDenomsFromCreatorRequest defines the response structure for the +// DenomsFromCreator gRPC query. +message QueryDenomsFromCreatorResponse { + repeated string denoms = 1 [ (gogoproto.moretags) = "yaml:\"denoms\"" ]; +} diff --git a/proto/cosmwasm/tokenfactory/v1beta1/tx.proto b/proto/cosmwasm/tokenfactory/v1beta1/tx.proto new file mode 100755 index 0000000..41d16a3 --- /dev/null +++ b/proto/cosmwasm/tokenfactory/v1beta1/tx.proto @@ -0,0 +1,118 @@ +syntax = "proto3"; +package cosmwasm.tokenfactory.v1beta1; +import "cosmos/msg/v1/msg.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/bank/v1beta1/bank.proto"; + +option go_package = "github.com/CosmWasm/wasmd/x/tokenfactory/types"; + +// Msg defines the tokefactory module's gRPC message service. +service Msg { + + option (cosmos.msg.v1.service) = true; + + rpc CreateDenom(MsgCreateDenom) returns (MsgCreateDenomResponse); + rpc Mint(MsgMint) returns (MsgMintResponse); + rpc Burn(MsgBurn) returns (MsgBurnResponse); + rpc ChangeAdmin(MsgChangeAdmin) returns (MsgChangeAdminResponse); + rpc SetDenomMetadata(MsgSetDenomMetadata) + returns (MsgSetDenomMetadataResponse); + rpc ForceTransfer(MsgForceTransfer) returns (MsgForceTransferResponse); +} + +// MsgCreateDenom defines the message structure for the CreateDenom gRPC service +// method. It allows an account to create a new denom. It requires a sender +// address and a sub denomination. The (sender_address, sub_denomination) tuple +// must be unique and cannot be re-used. +// +// The resulting denom created is defined as +// . The resulting denom's admin is +// originally set to be the creator, but this can be changed later. The token +// denom does not indicate the current admin. +message MsgCreateDenom { + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + // subdenom can be up to 44 "alphanumeric" characters long. + string subdenom = 2 [ (gogoproto.moretags) = "yaml:\"subdenom\"" ]; +} + +// MsgCreateDenomResponse is the return value of MsgCreateDenom +// It returns the full string of the newly created denom +message MsgCreateDenomResponse { + string new_token_denom = 1 + [ (gogoproto.moretags) = "yaml:\"new_token_denom\"" ]; +} + +// MsgMint is the sdk.Msg type for allowing an admin account to mint +// more of a token. For now, we only support minting to the sender account +message MsgMint { + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + cosmos.base.v1beta1.Coin amount = 2 [ + (gogoproto.moretags) = "yaml:\"amount\"", + (gogoproto.nullable) = false + ]; + string mintToAddress = 3 + [ (gogoproto.moretags) = "yaml:\"mint_to_address\"" ]; +} + +message MsgMintResponse {} + +// MsgBurn is the sdk.Msg type for allowing an admin account to burn +// a token. For now, we only support burning from the sender account. +message MsgBurn { + option (cosmos.msg.v1.signer) = "sender"; + + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + cosmos.base.v1beta1.Coin amount = 2 [ + (gogoproto.moretags) = "yaml:\"amount\"", + (gogoproto.nullable) = false + ]; + string burnFromAddress = 3 + [ (gogoproto.moretags) = "yaml:\"burn_from_address\"" ]; +} + +message MsgBurnResponse {} + +// MsgChangeAdmin is the sdk.Msg type for allowing an admin account to reassign +// adminship of a denom to a new account +message MsgChangeAdmin { + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + string denom = 2 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; + string new_admin = 3 [ (gogoproto.moretags) = "yaml:\"new_admin\"" ]; +} + +// MsgChangeAdminResponse defines the response structure for an executed +// MsgChangeAdmin message. +message MsgChangeAdminResponse {} + +// MsgSetDenomMetadata is the sdk.Msg type for allowing an admin account to set +// the denom's bank metadata +message MsgSetDenomMetadata { + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + cosmos.bank.v1beta1.Metadata metadata = 2 [ + (gogoproto.moretags) = "yaml:\"metadata\"", + (gogoproto.nullable) = false + ]; +} + +// MsgSetDenomMetadataResponse defines the response structure for an executed +// MsgSetDenomMetadata message. +message MsgSetDenomMetadataResponse {} + +message MsgForceTransfer { + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + cosmos.base.v1beta1.Coin amount = 2 [ + (gogoproto.moretags) = "yaml:\"amount\"", + (gogoproto.nullable) = false + ]; + string transferFromAddress = 3 + [ (gogoproto.moretags) = "yaml:\"transfer_from_address\"" ]; + string transferToAddress = 4 + [ (gogoproto.moretags) = "yaml:\"transfer_to_address\"" ]; +} + +message MsgForceTransferResponse {} \ No newline at end of file diff --git a/proto/cosmwasm/wasm/v1/authz.proto b/proto/cosmwasm/wasm/v1/authz.proto index 97a8227..eb50c76 100644 --- a/proto/cosmwasm/wasm/v1/authz.proto +++ b/proto/cosmwasm/wasm/v1/authz.proto @@ -4,36 +4,66 @@ package cosmwasm.wasm.v1; import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "cosmwasm/wasm/v1/types.proto"; import "google/protobuf/any.proto"; +import "amino/amino.proto"; option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; option (gogoproto.goproto_getters_all) = false; +// StoreCodeAuthorization defines authorization for wasm code upload. +// Since: wasmd 0.42 +message StoreCodeAuthorization { + option (amino.name) = "wasm/StoreCodeAuthorization"; + option (cosmos_proto.implements_interface) = + "cosmos.authz.v1beta1.Authorization"; + + // Grants for code upload + repeated CodeGrant grants = 1 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; +} + // ContractExecutionAuthorization defines authorization for wasm execute. // Since: wasmd 0.30 message ContractExecutionAuthorization { + option (amino.name) = "wasm/ContractExecutionAuthorization"; option (cosmos_proto.implements_interface) = "cosmos.authz.v1beta1.Authorization"; // Grants for contract executions - repeated ContractGrant grants = 1 [ (gogoproto.nullable) = false ]; + repeated ContractGrant grants = 1 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; } // ContractMigrationAuthorization defines authorization for wasm contract // migration. Since: wasmd 0.30 message ContractMigrationAuthorization { + option (amino.name) = "wasm/ContractMigrationAuthorization"; option (cosmos_proto.implements_interface) = "cosmos.authz.v1beta1.Authorization"; // Grants for contract migrations - repeated ContractGrant grants = 1 [ (gogoproto.nullable) = false ]; + repeated ContractGrant grants = 1 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; +} + +// CodeGrant a granted permission for a single code +message CodeGrant { + // CodeHash is the unique identifier created by wasmvm + // Wildcard "*" is used to specify any kind of grant. + bytes code_hash = 1; + + // InstantiatePermission is the superset access control to apply + // on contract creation. + // Optional + AccessConfig instantiate_permission = 2; } // ContractGrant a granted permission for a single contract // Since: wasmd 0.30 message ContractGrant { // Contract is the bech32 address of the smart contract - string contract = 1; + string contract = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // Limit defines execution limits that are enforced and updated when the grant // is applied. When the limit lapsed the grant is removed. @@ -51,6 +81,7 @@ message ContractGrant { // MaxCallsLimit limited number of calls to the contract. No funds transferable. // Since: wasmd 0.30 message MaxCallsLimit { + option (amino.name) = "wasm/MaxCallsLimit"; option (cosmos_proto.implements_interface) = "cosmwasm.wasm.v1.ContractAuthzLimitX"; @@ -61,13 +92,16 @@ message MaxCallsLimit { // MaxFundsLimit defines the maximal amounts that can be sent to the contract. // Since: wasmd 0.30 message MaxFundsLimit { + option (amino.name) = "wasm/MaxFundsLimit"; option (cosmos_proto.implements_interface) = "cosmwasm.wasm.v1.ContractAuthzLimitX"; // Amounts is the maximal amount of tokens transferable to the contract. repeated cosmos.base.v1beta1.Coin amounts = 1 [ (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (amino.encoding) = "legacy_coins" ]; } @@ -75,6 +109,7 @@ message MaxFundsLimit { // the maximal number of calls executable. Both need to remain >0 to be valid. // Since: wasmd 0.30 message CombinedLimit { + option (amino.name) = "wasm/CombinedLimit"; option (cosmos_proto.implements_interface) = "cosmwasm.wasm.v1.ContractAuthzLimitX"; @@ -83,7 +118,9 @@ message CombinedLimit { // Amounts is the maximal amount of tokens transferable to the contract. repeated cosmos.base.v1beta1.Coin amounts = 2 [ (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (amino.encoding) = "legacy_coins" ]; } @@ -91,6 +128,7 @@ message CombinedLimit { // message. // Since: wasmd 0.30 message AllowAllMessagesFilter { + option (amino.name) = "wasm/AllowAllMessagesFilter"; option (cosmos_proto.implements_interface) = "cosmwasm.wasm.v1.ContractAuthzFilterX"; } @@ -99,6 +137,7 @@ message AllowAllMessagesFilter { // the json object to be executed. // Since: wasmd 0.30 message AcceptedMessageKeysFilter { + option (amino.name) = "wasm/AcceptedMessageKeysFilter"; option (cosmos_proto.implements_interface) = "cosmwasm.wasm.v1.ContractAuthzFilterX"; @@ -110,9 +149,13 @@ message AcceptedMessageKeysFilter { // executed. // Since: wasmd 0.30 message AcceptedMessagesFilter { + option (amino.name) = "wasm/AcceptedMessagesFilter"; option (cosmos_proto.implements_interface) = "cosmwasm.wasm.v1.ContractAuthzFilterX"; // Messages is the list of raw contract messages - repeated bytes messages = 1 [ (gogoproto.casttype) = "RawContractMessage" ]; + repeated bytes messages = 1 [ + (gogoproto.casttype) = "RawContractMessage", + (amino.encoding) = "inline_json" + ]; } diff --git a/proto/cosmwasm/wasm/v1/genesis.proto b/proto/cosmwasm/wasm/v1/genesis.proto index 4e728ff..9082c8b 100644 --- a/proto/cosmwasm/wasm/v1/genesis.proto +++ b/proto/cosmwasm/wasm/v1/genesis.proto @@ -3,20 +3,28 @@ package cosmwasm.wasm.v1; import "gogoproto/gogo.proto"; import "cosmwasm/wasm/v1/types.proto"; +import "amino/amino.proto"; +import "cosmos_proto/cosmos.proto"; option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; // GenesisState - genesis state of x/wasm message GenesisState { - Params params = 1 [ (gogoproto.nullable) = false ]; - repeated Code codes = 2 - [ (gogoproto.nullable) = false, (gogoproto.jsontag) = "codes,omitempty" ]; + Params params = 1 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; + repeated Code codes = 2 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.jsontag) = "codes,omitempty" + ]; repeated Contract contracts = 3 [ (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, (gogoproto.jsontag) = "contracts,omitempty" ]; repeated Sequence sequences = 4 [ (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, (gogoproto.jsontag) = "sequences,omitempty" ]; } @@ -24,7 +32,8 @@ message GenesisState { // Code struct encompasses CodeInfo and CodeBytes message Code { uint64 code_id = 1 [ (gogoproto.customname) = "CodeID" ]; - CodeInfo code_info = 2 [ (gogoproto.nullable) = false ]; + CodeInfo code_info = 2 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; bytes code_bytes = 3; // Pinned to wasmvm cache bool pinned = 4; @@ -32,11 +41,14 @@ message Code { // Contract struct encompasses ContractAddress, ContractInfo, and ContractState message Contract { - string contract_address = 1; - ContractInfo contract_info = 2 [ (gogoproto.nullable) = false ]; - repeated Model contract_state = 3 [ (gogoproto.nullable) = false ]; + string contract_address = 1 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + ContractInfo contract_info = 2 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; + repeated Model contract_state = 3 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; repeated ContractCodeHistoryEntry contract_code_history = 4 - [ (gogoproto.nullable) = false ]; + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; } // Sequence key and value of an id generation counter diff --git a/proto/cosmwasm/wasm/v1/ibc.proto b/proto/cosmwasm/wasm/v1/ibc.proto index feaad29..a04e4f8 100644 --- a/proto/cosmwasm/wasm/v1/ibc.proto +++ b/proto/cosmwasm/wasm/v1/ibc.proto @@ -31,6 +31,9 @@ message MsgIBCSendResponse { uint64 sequence = 1; } +// MsgIBCWriteAcknowledgementResponse +message MsgIBCWriteAcknowledgementResponse {} + // MsgIBCCloseChannel port and channel need to be owned by the contract message MsgIBCCloseChannel { string channel = 2 [ (gogoproto.moretags) = "yaml:\"source_channel\"" ]; diff --git a/proto/cosmwasm/wasm/v1/proposal_legacy.proto b/proto/cosmwasm/wasm/v1/proposal_legacy.proto new file mode 100644 index 0000000..ed44ada --- /dev/null +++ b/proto/cosmwasm/wasm/v1/proposal_legacy.proto @@ -0,0 +1,387 @@ +syntax = "proto3"; +package cosmwasm.wasm.v1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmwasm/wasm/v1/types.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; +option (gogoproto.goproto_stringer_all) = false; +option (gogoproto.goproto_getters_all) = false; +option (gogoproto.equal_all) = true; + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit StoreCodeProposal. To submit WASM code to the system, +// a simple MsgStoreCode can be invoked from the x/gov module via +// a v1 governance proposal. +message StoreCodeProposal { + option deprecated = true; + option (amino.name) = "wasm/StoreCodeProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // RunAs is the address that is passed to the contract's environment as sender + string run_as = 3 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // WASMByteCode can be raw or gzip compressed + bytes wasm_byte_code = 4 [ (gogoproto.customname) = "WASMByteCode" ]; + // Used in v1beta1 + reserved 5, 6; + // InstantiatePermission to apply on contract creation, optional + AccessConfig instantiate_permission = 7; + // UnpinCode code on upload, optional + bool unpin_code = 8; + // Source is the URL where the code is hosted + string source = 9; + // Builder is the docker image used to build the code deterministically, used + // for smart contract verification + string builder = 10; + // CodeHash is the SHA256 sum of the code outputted by builder, used for smart + // contract verification + bytes code_hash = 11; +} + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit InstantiateContractProposal. To instantiate a contract, +// a simple MsgInstantiateContract can be invoked from the x/gov module via +// a v1 governance proposal. +message InstantiateContractProposal { + option deprecated = true; + option (amino.name) = "wasm/InstantiateContractProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // RunAs is the address that is passed to the contract's environment as sender + string run_as = 3 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Admin is an optional address that can execute migrations + string admin = 4 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // CodeID is the reference to the stored WASM code + uint64 code_id = 5 [ (gogoproto.customname) = "CodeID" ]; + // Label is optional metadata to be stored with a constract instance. + string label = 6; + // Msg json encoded message to be passed to the contract on instantiation + bytes msg = 7 [ + (gogoproto.casttype) = "RawContractMessage", + (amino.encoding) = "inline_json" + ]; + // Funds coins that are transferred to the contract on instantiation + repeated cosmos.base.v1beta1.Coin funds = 8 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (amino.encoding) = "legacy_coins" + ]; +} + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit InstantiateContract2Proposal. To instantiate contract 2, +// a simple MsgInstantiateContract2 can be invoked from the x/gov module via +// a v1 governance proposal. +message InstantiateContract2Proposal { + option deprecated = true; + option (amino.name) = "wasm/InstantiateContract2Proposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // RunAs is the address that is passed to the contract's enviroment as sender + string run_as = 3 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Admin is an optional address that can execute migrations + string admin = 4 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // CodeID is the reference to the stored WASM code + uint64 code_id = 5 [ (gogoproto.customname) = "CodeID" ]; + // Label is optional metadata to be stored with a constract instance. + string label = 6; + // Msg json encode message to be passed to the contract on instantiation + bytes msg = 7 [ + (gogoproto.casttype) = "RawContractMessage", + (amino.encoding) = "inline_json" + ]; + // Funds coins that are transferred to the contract on instantiation + repeated cosmos.base.v1beta1.Coin funds = 8 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (amino.encoding) = "legacy_coins" + ]; + // Salt is an arbitrary value provided by the sender. Size can be 1 to 64. + bytes salt = 9; + // FixMsg include the msg value into the hash for the predictable address. + // Default is false + bool fix_msg = 10; +} + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit MigrateContractProposal. To migrate a contract, +// a simple MsgMigrateContract can be invoked from the x/gov module via +// a v1 governance proposal. +message MigrateContractProposal { + option deprecated = true; + option (amino.name) = "wasm/MigrateContractProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // Note: skipping 3 as this was previously used for unneeded run_as + + // Contract is the address of the smart contract + string contract = 4 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // CodeID references the new WASM code + uint64 code_id = 5 [ (gogoproto.customname) = "CodeID" ]; + // Msg json encoded message to be passed to the contract on migration + bytes msg = 6 [ + (gogoproto.casttype) = "RawContractMessage", + (amino.encoding) = "inline_json" + ]; +} + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit SudoContractProposal. To call sudo on a contract, +// a simple MsgSudoContract can be invoked from the x/gov module via +// a v1 governance proposal. +message SudoContractProposal { + option deprecated = true; + option (amino.name) = "wasm/SudoContractProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // Contract is the address of the smart contract + string contract = 3 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Msg json encoded message to be passed to the contract as sudo + bytes msg = 4 [ + (gogoproto.casttype) = "RawContractMessage", + (amino.encoding) = "inline_json" + ]; +} + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit ExecuteContractProposal. To call execute on a contract, +// a simple MsgExecuteContract can be invoked from the x/gov module via +// a v1 governance proposal. +message ExecuteContractProposal { + option deprecated = true; + option (amino.name) = "wasm/ExecuteContractProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // RunAs is the address that is passed to the contract's environment as sender + string run_as = 3 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Contract is the address of the smart contract + string contract = 4 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Msg json encoded message to be passed to the contract as execute + bytes msg = 5 [ + (gogoproto.casttype) = "RawContractMessage", + (amino.encoding) = "inline_json" + ]; + // Funds coins that are transferred to the contract on instantiation + repeated cosmos.base.v1beta1.Coin funds = 6 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (amino.encoding) = "legacy_coins" + ]; +} + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit UpdateAdminProposal. To set an admin for a contract, +// a simple MsgUpdateAdmin can be invoked from the x/gov module via +// a v1 governance proposal. +message UpdateAdminProposal { + option deprecated = true; + option (amino.name) = "wasm/UpdateAdminProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // NewAdmin address to be set + string new_admin = 3 [ + (gogoproto.moretags) = "yaml:\"new_admin\"", + (cosmos_proto.scalar) = "cosmos.AddressString" + ]; + // Contract is the address of the smart contract + string contract = 4 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit ClearAdminProposal. To clear the admin of a contract, +// a simple MsgClearAdmin can be invoked from the x/gov module via +// a v1 governance proposal. +message ClearAdminProposal { + option deprecated = true; + option (amino.name) = "wasm/ClearAdminProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // Contract is the address of the smart contract + string contract = 3 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit PinCodesProposal. To pin a set of code ids in the wasmvm +// cache, a simple MsgPinCodes can be invoked from the x/gov module via +// a v1 governance proposal. +message PinCodesProposal { + option deprecated = true; + option (amino.name) = "wasm/PinCodesProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // CodeIDs references the new WASM codes + repeated uint64 code_ids = 3 [ + (gogoproto.customname) = "CodeIDs", + (gogoproto.moretags) = "yaml:\"code_ids\"" + ]; +} + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit UnpinCodesProposal. To unpin a set of code ids in the wasmvm +// cache, a simple MsgUnpinCodes can be invoked from the x/gov module via +// a v1 governance proposal. +message UnpinCodesProposal { + option deprecated = true; + option (amino.name) = "wasm/UnpinCodesProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // CodeIDs references the WASM codes + repeated uint64 code_ids = 3 [ + (gogoproto.customname) = "CodeIDs", + (gogoproto.moretags) = "yaml:\"code_ids\"" + ]; +} + +// SetGasLessContractsProposal gov proposal content type to set gassless a set of contract addresses in the +// wasmvm cache. +message SetGasLessContractsProposal { + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1 [ (gogoproto.moretags) = "yaml:\"title\"" ]; + // Description is a human readable text + string description = 2 [ (gogoproto.moretags) = "yaml:\"description\"" ]; + // ContractAddresses references the new WASM addresses + repeated string contract_addresses = 3 [ + (gogoproto.customname) = "ContractAddresses", + (gogoproto.moretags) = "yaml:\"contract_addresses\"" + ]; +} + +// UnsetGasLessContractsProposal gov proposal content type to unset gassless a set of contract addresses in +// the wasmvm cache. +message UnsetGasLessContractsProposal { + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1 [ (gogoproto.moretags) = "yaml:\"title\"" ]; + // Description is a human readable text + string description = 2 [ (gogoproto.moretags) = "yaml:\"description\"" ]; + // ContractAddresses references the new WASM addresses + repeated string contract_addresses = 3 [ + (gogoproto.customname) = "ContractAddresses", + (gogoproto.moretags) = "yaml:\"contract_addresses\"" + ]; +} + +// AccessConfigUpdate contains the code id and the access config to be +// applied. +message AccessConfigUpdate { + // CodeID is the reference to the stored WASM code to be updated + uint64 code_id = 1 [ (gogoproto.customname) = "CodeID" ]; + // InstantiatePermission to apply to the set of code ids + AccessConfig instantiate_permission = 2 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; +} + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit UpdateInstantiateConfigProposal. To update instantiate config +// to a set of code ids, a simple MsgUpdateInstantiateConfig can be invoked from +// the x/gov module via a v1 governance proposal. +message UpdateInstantiateConfigProposal { + option deprecated = true; + option (amino.name) = "wasm/UpdateInstantiateConfigProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1 [ (gogoproto.moretags) = "yaml:\"title\"" ]; + // Description is a human readable text + string description = 2 [ (gogoproto.moretags) = "yaml:\"description\"" ]; + // AccessConfigUpdate contains the list of code ids and the access config + // to be applied. + repeated AccessConfigUpdate access_config_updates = 3 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; +} + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit StoreAndInstantiateContractProposal. To store and instantiate +// the contract, a simple MsgStoreAndInstantiateContract can be invoked from +// the x/gov module via a v1 governance proposal. +message StoreAndInstantiateContractProposal { + option deprecated = true; + option (amino.name) = "wasm/StoreAndInstantiateContractProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // RunAs is the address that is passed to the contract's environment as sender + string run_as = 3 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // WASMByteCode can be raw or gzip compressed + bytes wasm_byte_code = 4 [ (gogoproto.customname) = "WASMByteCode" ]; + // InstantiatePermission to apply on contract creation, optional + AccessConfig instantiate_permission = 5; + // UnpinCode code on upload, optional + bool unpin_code = 6; + // Admin is an optional address that can execute migrations + string admin = 7; + // Label is optional metadata to be stored with a constract instance. + string label = 8; + // Msg json encoded message to be passed to the contract on instantiation + bytes msg = 9 [ + (gogoproto.casttype) = "RawContractMessage", + (amino.encoding) = "inline_json" + ]; + // Funds coins that are transferred to the contract on instantiation + repeated cosmos.base.v1beta1.Coin funds = 10 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (amino.encoding) = "legacy_coins" + ]; + // Source is the URL where the code is hosted + string source = 11; + // Builder is the docker image used to build the code deterministically, used + // for smart contract verification + string builder = 12; + // CodeHash is the SHA256 sum of the code outputted by builder, used for smart + // contract verification + bytes code_hash = 13; +} diff --git a/proto/cosmwasm/wasm/v1/query.proto b/proto/cosmwasm/wasm/v1/query.proto index ad6214e..d682b45 100644 --- a/proto/cosmwasm/wasm/v1/query.proto +++ b/proto/cosmwasm/wasm/v1/query.proto @@ -5,6 +5,9 @@ import "gogoproto/gogo.proto"; import "cosmwasm/wasm/v1/types.proto"; import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos/query/v1/query.proto"; +import "amino/amino.proto"; +import "cosmos_proto/cosmos.proto"; option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; option (gogoproto.goproto_getters_all) = false; @@ -15,27 +18,32 @@ service Query { // ContractInfo gets the contract meta data rpc ContractInfo(QueryContractInfoRequest) returns (QueryContractInfoResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/cosmwasm/wasm/v1/contract/{address}"; } // ContractHistory gets the contract code history rpc ContractHistory(QueryContractHistoryRequest) returns (QueryContractHistoryResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/cosmwasm/wasm/v1/contract/{address}/history"; } // ContractsByCode lists all smart contracts for a code id rpc ContractsByCode(QueryContractsByCodeRequest) returns (QueryContractsByCodeResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/cosmwasm/wasm/v1/code/{code_id}/contracts"; } // AllContractState gets all raw store data for a single contract rpc AllContractState(QueryAllContractStateRequest) returns (QueryAllContractStateResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/cosmwasm/wasm/v1/contract/{address}/state"; } // RawContractState gets single key from the raw store data of a contract rpc RawContractState(QueryRawContractStateRequest) returns (QueryRawContractStateResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/cosmwasm/wasm/v1/contract/{address}/raw/{query_data}"; } @@ -47,41 +55,54 @@ service Query { } // Code gets the binary code and metadata for a singe wasm code rpc Code(QueryCodeRequest) returns (QueryCodeResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/cosmwasm/wasm/v1/code/{code_id}"; } // Codes gets the metadata for all stored wasm codes rpc Codes(QueryCodesRequest) returns (QueryCodesResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/cosmwasm/wasm/v1/code"; } // PinnedCodes gets the pinned code ids rpc PinnedCodes(QueryPinnedCodesRequest) returns (QueryPinnedCodesResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/cosmwasm/wasm/v1/codes/pinned"; } // GaslessContracts gets the gasless contract addresses - rpc GaslessContracts(QueryGaslessContractsRequest) returns (QueryGaslessContractsResponse) { + rpc GaslessContracts(QueryGaslessContractsRequest) + returns (QueryGaslessContractsResponse) { option (google.api.http).get = "/cosmwasm/wasm/v1/codes/gasless"; } // Params gets the module params rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/cosmwasm/wasm/v1/codes/params"; } // ContractsByCreator gets the contracts by creator rpc ContractsByCreator(QueryContractsByCreatorRequest) returns (QueryContractsByCreatorResponse) { + option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/cosmwasm/wasm/v1/contracts/creator/{creator_address}"; } + + // BuildAddress builds a contract address + rpc BuildAddress(QueryBuildAddressRequest) + returns (QueryBuildAddressResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/cosmwasm/wasm/v1/contract/build_address"; + } } // QueryContractInfoRequest is the request type for the Query/ContractInfo RPC // method message QueryContractInfoRequest { // address is the address of the contract to query - string address = 1; + string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; } // QueryContractInfoResponse is the response type for the Query/ContractInfo RPC // method @@ -89,10 +110,11 @@ message QueryContractInfoResponse { option (gogoproto.equal) = true; // address is the address of the contract - string address = 1; + string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; ContractInfo contract_info = 2 [ (gogoproto.embed) = true, (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, (gogoproto.jsontag) = "" ]; } @@ -101,7 +123,7 @@ message QueryContractInfoResponse { // RPC method message QueryContractHistoryRequest { // address is the address of the contract to query - string address = 1; + string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // pagination defines an optional pagination for the request. cosmos.base.query.v1beta1.PageRequest pagination = 2; } @@ -110,7 +132,7 @@ message QueryContractHistoryRequest { // Query/ContractHistory RPC method message QueryContractHistoryResponse { repeated ContractCodeHistoryEntry entries = 1 - [ (gogoproto.nullable) = false ]; + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; } @@ -127,7 +149,8 @@ message QueryContractsByCodeRequest { // Query/ContractsByCode RPC method message QueryContractsByCodeResponse { // contracts are a set of contract addresses - repeated string contracts = 1; + repeated string contracts = 1 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -137,7 +160,7 @@ message QueryContractsByCodeResponse { // Query/AllContractState RPC method message QueryAllContractStateRequest { // address is the address of the contract - string address = 1; + string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // pagination defines an optional pagination for the request. cosmos.base.query.v1beta1.PageRequest pagination = 2; } @@ -145,7 +168,8 @@ message QueryAllContractStateRequest { // QueryAllContractStateResponse is the response type for the // Query/AllContractState RPC method message QueryAllContractStateResponse { - repeated Model models = 1 [ (gogoproto.nullable) = false ]; + repeated Model models = 1 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; } @@ -154,7 +178,7 @@ message QueryAllContractStateResponse { // Query/RawContractState RPC method message QueryRawContractStateRequest { // address is the address of the contract - string address = 1; + string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; bytes query_data = 2; } @@ -169,16 +193,22 @@ message QueryRawContractStateResponse { // Query/SmartContractState RPC method message QuerySmartContractStateRequest { // address is the address of the contract - string address = 1; + string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // QueryData contains the query data passed to the contract - bytes query_data = 2 [ (gogoproto.casttype) = "RawContractMessage" ]; + bytes query_data = 2 [ + (gogoproto.casttype) = "RawContractMessage", + (amino.encoding) = "inline_json" + ]; } // QuerySmartContractStateResponse is the response type for the // Query/SmartContractState RPC method message QuerySmartContractStateResponse { // Data contains the json data returned from the smart contract - bytes data = 1 [ (gogoproto.casttype) = "RawContractMessage" ]; + bytes data = 1 [ + (gogoproto.casttype) = "RawContractMessage", + (amino.encoding) = "inline_json" + ]; } // QueryCodeRequest is the request type for the Query/Code RPC method @@ -194,13 +224,14 @@ message CodeInfoResponse { (gogoproto.customname) = "CodeID", (gogoproto.jsontag) = "id" ]; // id for legacy support - string creator = 2; + string creator = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; bytes data_hash = 3 [ (gogoproto.casttype) = - "github.com/tendermint/tendermint/libs/bytes.HexBytes" ]; + "github.com/cometbft/cometbft/libs/bytes.HexBytes" ]; // Used in v1beta1 reserved 4, 5; - AccessConfig instantiate_permission = 6 [ (gogoproto.nullable) = false ]; + AccessConfig instantiate_permission = 6 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; } // QueryCodeResponse is the response type for the Query/Code RPC method @@ -219,7 +250,8 @@ message QueryCodesRequest { // QueryCodesResponse is the response type for the Query/Codes RPC method message QueryCodesResponse { - repeated CodeInfoResponse code_infos = 1 [ (gogoproto.nullable) = false ]; + repeated CodeInfoResponse code_infos = 1 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; } @@ -234,14 +266,13 @@ message QueryPinnedCodesRequest { // QueryPinnedCodesResponse is the response type for the // Query/PinnedCodes RPC method message QueryPinnedCodesResponse { - repeated uint64 code_ids = 1 - [ (gogoproto.nullable) = false, (gogoproto.customname) = "CodeIDs" ]; + repeated uint64 code_ids = 1 [ (gogoproto.customname) = "CodeIDs" ]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; } -// QueryGaslessContractsRequest is the request type for the Query/GaslessContracts -// RPC method +// QueryGaslessContractsRequest is the request type for the +// Query/GaslessContracts RPC method message QueryGaslessContractsRequest { // pagination defines an optional pagination for the request. cosmos.base.query.v1beta1.PageRequest pagination = 2; @@ -251,7 +282,7 @@ message QueryGaslessContractsRequest { // Query/GaslessContracts RPC method message QueryGaslessContractsResponse { repeated string contract_addresses = 1 - [ (gogoproto.nullable) = false, (gogoproto.customname) = "ContractAddresses" ]; + [ (gogoproto.customname) = "ContractAddresses" ]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; } @@ -262,14 +293,15 @@ 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 ]; + Params params = 1 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; } // QueryContractsByCreatorRequest is the request type for the // Query/ContractsByCreator RPC method. message QueryContractsByCreatorRequest { // CreatorAddress is the address of contract creator - string creator_address = 1; + string creator_address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // Pagination defines an optional pagination for the request. cosmos.base.query.v1beta1.PageRequest pagination = 2; } @@ -278,7 +310,29 @@ message QueryContractsByCreatorRequest { // Query/ContractsByCreator RPC method. message QueryContractsByCreatorResponse { // ContractAddresses result set - repeated string contract_addresses = 1; + repeated string contract_addresses = 1 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // Pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; -} \ No newline at end of file +} + +// QueryBuildAddressRequest is the request type for the Query/BuildAddress RPC +// method. +message QueryBuildAddressRequest { + // CodeHash is the hash of the code + string code_hash = 1; + // CreatorAddress is the address of the contract instantiator + string creator_address = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Salt is a hex encoded salt + string salt = 3; + // InitArgs are optional json encoded init args to be used in contract address + // building if provided + bytes init_args = 4; +} + +// QueryBuildAddressResponse is the response type for the Query/BuildAddress RPC +// method. +message QueryBuildAddressResponse { + // Address is the contract address + string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} diff --git a/proto/cosmwasm/wasm/v1/tx.proto b/proto/cosmwasm/wasm/v1/tx.proto index 741fbc4..c4e1606 100644 --- a/proto/cosmwasm/wasm/v1/tx.proto +++ b/proto/cosmwasm/wasm/v1/tx.proto @@ -2,14 +2,19 @@ syntax = "proto3"; package cosmwasm.wasm.v1; import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/msg/v1/msg.proto"; import "gogoproto/gogo.proto"; import "cosmwasm/wasm/v1/types.proto"; +import "cosmos_proto/cosmos.proto"; +import "amino/amino.proto"; option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; option (gogoproto.goproto_getters_all) = false; // Msg defines the wasm Msg service. service Msg { + option (cosmos.msg.v1.service) = true; + // StoreCode to submit Wasm code to the system rpc StoreCode(MsgStoreCode) returns (MsgStoreCodeResponse); // InstantiateContract creates a new smart contract instance for the given @@ -24,19 +29,72 @@ service Msg { rpc ExecuteContract(MsgExecuteContract) returns (MsgExecuteContractResponse); // Migrate runs a code upgrade/ downgrade for a smart contract rpc MigrateContract(MsgMigrateContract) returns (MsgMigrateContractResponse); - // UpdateAdmin sets a new admin for a smart contract + // UpdateAdmin sets a new admin for a smart contract rpc UpdateAdmin(MsgUpdateAdmin) returns (MsgUpdateAdminResponse); // ClearAdmin removes any admin stored for a smart contract rpc ClearAdmin(MsgClearAdmin) returns (MsgClearAdminResponse); // UpdateInstantiateConfig updates instantiate config for a smart contract rpc UpdateInstantiateConfig(MsgUpdateInstantiateConfig) returns (MsgUpdateInstantiateConfigResponse); + // UpdateParams defines a governance operation for updating the x/wasm + // module parameters. The authority is defined in the keeper. + // + // Since: 0.40 + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + // SudoContract defines a governance operation for calling sudo + // on a contract. The authority is defined in the keeper. + // + // Since: 0.40 + rpc SudoContract(MsgSudoContract) returns (MsgSudoContractResponse); + // PinCodes defines a governance operation for pinning a set of + // code ids in the wasmvm cache. The authority is defined in the keeper. + // + // Since: 0.40 + rpc PinCodes(MsgPinCodes) returns (MsgPinCodesResponse); + // UnpinCodes defines a governance operation for unpinning a set of + // code ids in the wasmvm cache. The authority is defined in the keeper. + // + // Since: 0.40 + rpc UnpinCodes(MsgUnpinCodes) returns (MsgUnpinCodesResponse); + // StoreAndInstantiateContract defines a governance operation for storing + // and instantiating the contract. The authority is defined in the keeper. + // + // Since: 0.40 + rpc StoreAndInstantiateContract(MsgStoreAndInstantiateContract) + returns (MsgStoreAndInstantiateContractResponse); + // RemoveCodeUploadParamsAddresses defines a governance operation for + // removing addresses from code upload params. + // The authority is defined in the keeper. + rpc RemoveCodeUploadParamsAddresses(MsgRemoveCodeUploadParamsAddresses) + returns (MsgRemoveCodeUploadParamsAddressesResponse); + // AddCodeUploadParamsAddresses defines a governance operation for + // adding addresses to code upload params. + // The authority is defined in the keeper. + rpc AddCodeUploadParamsAddresses(MsgAddCodeUploadParamsAddresses) + returns (MsgAddCodeUploadParamsAddressesResponse); + // StoreAndMigrateContract defines a governance operation for storing + // and migrating the contract. The authority is defined in the keeper. + // + // Since: 0.42 + rpc StoreAndMigrateContract(MsgStoreAndMigrateContract) + returns (MsgStoreAndMigrateContractResponse); + // UpdateContractLabel sets a new label for a smart contract + // + // Since: 0.43 + rpc UpdateContractLabel(MsgUpdateContractLabel) + returns (MsgUpdateContractLabelResponse); + // SetGaslessContract set contracts are gasless + rpc SetGaslessContracts(MsgSetGaslessContracts) + returns (MsgSetGaslessContractsResponse); } // MsgStoreCode submit Wasm code to the system message MsgStoreCode { + option (amino.name) = "wasm/MsgStoreCode"; + option (cosmos.msg.v1.signer) = "sender"; + // Sender is the actor that signed the messages - string sender = 1; + string sender = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // WASMByteCode can be raw or gzip compressed bytes wasm_byte_code = 2 [ (gogoproto.customname) = "WASMByteCode" ]; // Used in v1beta1 @@ -56,40 +114,64 @@ message MsgStoreCodeResponse { // MsgInstantiateContract create a new smart contract instance for the given // code id. message MsgInstantiateContract { + option (amino.name) = "wasm/MsgInstantiateContract"; + option (cosmos.msg.v1.signer) = "sender"; + // Sender is the that actor that signed the messages - string sender = 1; + string sender = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // Admin is an optional address that can execute migrations - string admin = 2; + string admin = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // CodeID is the reference to the stored WASM code uint64 code_id = 3 [ (gogoproto.customname) = "CodeID" ]; // Label is optional metadata to be stored with a contract instance. string label = 4; // Msg json encoded message to be passed to the contract on instantiation - bytes msg = 5 [ (gogoproto.casttype) = "RawContractMessage" ]; + bytes msg = 5 [ + (gogoproto.casttype) = "RawContractMessage", + (amino.encoding) = "inline_json" + ]; // Funds coins that are transferred to the contract on instantiation repeated cosmos.base.v1beta1.Coin funds = 6 [ (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (amino.encoding) = "legacy_coins" ]; } +// MsgInstantiateContractResponse return instantiation result data +message MsgInstantiateContractResponse { + // Address is the bech32 address of the new contract instance. + string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Data contains bytes to returned from the contract + bytes data = 2; +} + // MsgInstantiateContract2 create a new smart contract instance for the given -// code id with a predicable address. +// code id with a predictable address. message MsgInstantiateContract2 { + option (amino.name) = "wasm/MsgInstantiateContract2"; + option (cosmos.msg.v1.signer) = "sender"; + // Sender is the that actor that signed the messages - string sender = 1; + string sender = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // Admin is an optional address that can execute migrations - string admin = 2; + string admin = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // CodeID is the reference to the stored WASM code uint64 code_id = 3 [ (gogoproto.customname) = "CodeID" ]; // Label is optional metadata to be stored with a contract instance. string label = 4; // Msg json encoded message to be passed to the contract on instantiation - bytes msg = 5 [ (gogoproto.casttype) = "RawContractMessage" ]; + bytes msg = 5 [ + (gogoproto.casttype) = "RawContractMessage", + (amino.encoding) = "inline_json" + ]; // Funds coins that are transferred to the contract on instantiation repeated cosmos.base.v1beta1.Coin funds = 6 [ (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (amino.encoding) = "legacy_coins" ]; // Salt is an arbitrary value provided by the sender. Size can be 1 to 64. bytes salt = 7; @@ -98,34 +180,34 @@ message MsgInstantiateContract2 { bool fix_msg = 8; } -// MsgInstantiateContractResponse return instantiation result data -message MsgInstantiateContractResponse { - // Address is the bech32 address of the new contract instance. - string address = 1; - // Data contains bytes to returned from the contract - bytes data = 2; -} - // MsgInstantiateContract2Response return instantiation result data message MsgInstantiateContract2Response { // Address is the bech32 address of the new contract instance. - string address = 1; + string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // Data contains bytes to returned from the contract bytes data = 2; } // MsgExecuteContract submits the given message data to a smart contract message MsgExecuteContract { + option (amino.name) = "wasm/MsgExecuteContract"; + option (cosmos.msg.v1.signer) = "sender"; + // Sender is the that actor that signed the messages - string sender = 1; + string sender = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // Contract is the address of the smart contract - string contract = 2; + string contract = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // Msg json encoded message to be passed to the contract - bytes msg = 3 [ (gogoproto.casttype) = "RawContractMessage" ]; + bytes msg = 3 [ + (gogoproto.casttype) = "RawContractMessage", + (amino.encoding) = "inline_json" + ]; // Funds coins that are transferred to the contract on execution repeated cosmos.base.v1beta1.Coin funds = 5 [ (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (amino.encoding) = "legacy_coins" ]; } @@ -137,14 +219,20 @@ message MsgExecuteContractResponse { // MsgMigrateContract runs a code upgrade/ downgrade for a smart contract message MsgMigrateContract { + option (amino.name) = "wasm/MsgMigrateContract"; + option (cosmos.msg.v1.signer) = "sender"; + // Sender is the that actor that signed the messages - string sender = 1; + string sender = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // Contract is the address of the smart contract - string contract = 2; + string contract = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // CodeID references the new WASM code uint64 code_id = 3 [ (gogoproto.customname) = "CodeID" ]; // Msg json encoded message to be passed to the contract on migration - bytes msg = 4 [ (gogoproto.casttype) = "RawContractMessage" ]; + bytes msg = 4 [ + (gogoproto.casttype) = "RawContractMessage", + (amino.encoding) = "inline_json" + ]; } // MsgMigrateContractResponse returns contract migration result data. @@ -156,12 +244,15 @@ message MsgMigrateContractResponse { // MsgUpdateAdmin sets a new admin for a smart contract message MsgUpdateAdmin { + option (amino.name) = "wasm/MsgUpdateAdmin"; + option (cosmos.msg.v1.signer) = "sender"; + // Sender is the that actor that signed the messages - string sender = 1; + string sender = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // NewAdmin address to be set - string new_admin = 2; + string new_admin = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // Contract is the address of the smart contract - string contract = 3; + string contract = 3 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; } // MsgUpdateAdminResponse returns empty data @@ -169,10 +260,13 @@ message MsgUpdateAdminResponse {} // MsgClearAdmin removes any admin stored for a smart contract message MsgClearAdmin { + option (amino.name) = "wasm/MsgClearAdmin"; + option (cosmos.msg.v1.signer) = "sender"; + // Sender is the actor that signed the messages - string sender = 1; + string sender = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // Contract is the address of the smart contract - string contract = 3; + string contract = 3 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; } // MsgClearAdminResponse returns empty data @@ -180,8 +274,11 @@ message MsgClearAdminResponse {} // MsgUpdateInstantiateConfig updates instantiate config for a smart contract message MsgUpdateInstantiateConfig { + option (amino.name) = "wasm/MsgUpdateInstantiateConfig"; + option (cosmos.msg.v1.signer) = "sender"; + // Sender is the that actor that signed the messages - string sender = 1; + string sender = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // CodeID references the stored WASM code uint64 code_id = 2 [ (gogoproto.customname) = "CodeID" ]; // NewInstantiatePermission is the new access control @@ -189,4 +286,256 @@ message MsgUpdateInstantiateConfig { } // MsgUpdateInstantiateConfigResponse returns empty data -message MsgUpdateInstantiateConfigResponse {} \ No newline at end of file +message MsgUpdateInstantiateConfigResponse {} + +// MsgUpdateParams is the MsgUpdateParams request type. +// +// Since: 0.40 +message MsgUpdateParams { + option (amino.name) = "wasm/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 x/wasm parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: 0.40 +message MsgUpdateParamsResponse {} + +// MsgSudoContract is the MsgSudoContract request type. +// +// Since: 0.40 +message MsgSudoContract { + option (amino.name) = "wasm/MsgSudoContract"; + option (cosmos.msg.v1.signer) = "authority"; + + // Authority is the address of the governance account. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // Contract is the address of the smart contract + string contract = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Msg json encoded message to be passed to the contract as sudo + bytes msg = 3 [ + (gogoproto.casttype) = "RawContractMessage", + (amino.encoding) = "inline_json" + ]; +} + +// MsgSudoContractResponse defines the response structure for executing a +// MsgSudoContract message. +// +// Since: 0.40 +message MsgSudoContractResponse { + // Data contains bytes to returned from the contract + bytes data = 1; +} + +// MsgPinCodes is the MsgPinCodes request type. +// +// Since: 0.40 +message MsgPinCodes { + option (amino.name) = "wasm/MsgPinCodes"; + option (cosmos.msg.v1.signer) = "authority"; + + // Authority is the address of the governance account. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // CodeIDs references the new WASM codes + repeated uint64 code_ids = 2 [ + (gogoproto.customname) = "CodeIDs", + (gogoproto.moretags) = "yaml:\"code_ids\"" + ]; +} + +// MsgPinCodesResponse defines the response structure for executing a +// MsgPinCodes message. +// +// Since: 0.40 +message MsgPinCodesResponse {} + +// MsgUnpinCodes is the MsgUnpinCodes request type. +// +// Since: 0.40 +message MsgUnpinCodes { + option (amino.name) = "wasm/MsgUnpinCodes"; + option (cosmos.msg.v1.signer) = "authority"; + + // Authority is the address of the governance account. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // CodeIDs references the WASM codes + repeated uint64 code_ids = 2 [ + (gogoproto.customname) = "CodeIDs", + (gogoproto.moretags) = "yaml:\"code_ids\"" + ]; +} + +// MsgUnpinCodesResponse defines the response structure for executing a +// MsgUnpinCodes message. +// +// Since: 0.40 +message MsgUnpinCodesResponse {} + +// MsgStoreAndInstantiateContract is the MsgStoreAndInstantiateContract +// request type. +// +// Since: 0.40 +message MsgStoreAndInstantiateContract { + option (amino.name) = "wasm/MsgStoreAndInstantiateContract"; + option (cosmos.msg.v1.signer) = "authority"; + + // Authority is the address of the governance account. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // WASMByteCode can be raw or gzip compressed + bytes wasm_byte_code = 3 [ (gogoproto.customname) = "WASMByteCode" ]; + // InstantiatePermission to apply on contract creation, optional + AccessConfig instantiate_permission = 4; + // UnpinCode code on upload, optional. As default the uploaded contract is + // pinned to cache. + bool unpin_code = 5; + // Admin is an optional address that can execute migrations + string admin = 6 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Label is optional metadata to be stored with a constract instance. + string label = 7; + // Msg json encoded message to be passed to the contract on instantiation + bytes msg = 8 [ + (gogoproto.casttype) = "RawContractMessage", + (amino.encoding) = "inline_json" + ]; + // Funds coins that are transferred from the authority account to the contract + // on instantiation + repeated cosmos.base.v1beta1.Coin funds = 9 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (amino.encoding) = "legacy_coins" + ]; + // Source is the URL where the code is hosted + string source = 10; + // Builder is the docker image used to build the code deterministically, used + // for smart contract verification + string builder = 11; + // CodeHash is the SHA256 sum of the code outputted by builder, used for smart + // contract verification + bytes code_hash = 12; +} + +// MsgStoreAndInstantiateContractResponse defines the response structure +// for executing a MsgStoreAndInstantiateContract message. +// +// Since: 0.40 +message MsgStoreAndInstantiateContractResponse { + // Address is the bech32 address of the new contract instance. + string address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // Data contains bytes to returned from the contract + bytes data = 2; +} + +// MsgAddCodeUploadParamsAddresses is the +// MsgAddCodeUploadParamsAddresses request type. +message MsgAddCodeUploadParamsAddresses { + option (amino.name) = "wasm/MsgAddCodeUploadParamsAddresses"; + option (cosmos.msg.v1.signer) = "authority"; + + // Authority is the address of the governance account. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + repeated string addresses = 2 [ (gogoproto.moretags) = "yaml:\"addresses\"" ]; +} + +// MsgAddCodeUploadParamsAddressesResponse defines the response +// structure for executing a MsgAddCodeUploadParamsAddresses message. +message MsgAddCodeUploadParamsAddressesResponse {} + +// MsgRemoveCodeUploadParamsAddresses is the +// MsgRemoveCodeUploadParamsAddresses request type. +message MsgRemoveCodeUploadParamsAddresses { + option (amino.name) = "wasm/MsgRemoveCodeUploadParamsAddresses"; + option (cosmos.msg.v1.signer) = "authority"; + + // Authority is the address of the governance account. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + repeated string addresses = 2 [ (gogoproto.moretags) = "yaml:\"addresses\"" ]; +} + +// MsgRemoveCodeUploadParamsAddressesResponse defines the response +// structure for executing a MsgRemoveCodeUploadParamsAddresses message. +message MsgRemoveCodeUploadParamsAddressesResponse {} + +// MsgStoreAndMigrateContract is the MsgStoreAndMigrateContract +// request type. +// +// Since: 0.42 +message MsgStoreAndMigrateContract { + option (amino.name) = "wasm/MsgStoreAndMigrateContract"; + option (cosmos.msg.v1.signer) = "authority"; + + // Authority is the address of the governance account. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // WASMByteCode can be raw or gzip compressed + bytes wasm_byte_code = 2 [ (gogoproto.customname) = "WASMByteCode" ]; + // InstantiatePermission to apply on contract creation, optional + AccessConfig instantiate_permission = 3; + // Contract is the address of the smart contract + string contract = 4; + // Msg json encoded message to be passed to the contract on migration + bytes msg = 5 [ + (gogoproto.casttype) = "RawContractMessage", + (amino.encoding) = "inline_json" + ]; +} + +// MsgStoreAndMigrateContractResponse defines the response structure +// for executing a MsgStoreAndMigrateContract message. +// +// Since: 0.42 +message MsgStoreAndMigrateContractResponse { + // CodeID is the reference to the stored WASM code + uint64 code_id = 1 [ (gogoproto.customname) = "CodeID" ]; + // Checksum is the sha256 hash of the stored code + bytes checksum = 2; + // Data contains bytes to returned from the contract + bytes data = 3; +} + +// MsgUpdateContractLabel sets a new label for a smart contract +message MsgUpdateContractLabel { + option (amino.name) = "wasm/MsgUpdateContractLabel"; + option (cosmos.msg.v1.signer) = "sender"; + + // Sender is the that actor that signed the messages + string sender = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // NewLabel string to be set + string new_label = 2; + // Contract is the address of the smart contract + string contract = 3 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +// MsgUpdateContractLabelResponse returns empty data +message MsgUpdateContractLabelResponse {} + +// MsgSetGasLessContracts set smart contracts are gasless +message MsgSetGaslessContracts { + option (amino.name) = "wasm/MsgSetGaslessContracts"; + option (cosmos.msg.v1.signer) = "authority"; + + // Authority is the address of the governance account. + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Contracts are the addresses of the smart contracts + repeated string contracts = 2 [ + (cosmos_proto.scalar) = "cosmos.AddressString", + (gogoproto.moretags) = "yaml:\"contracts\"" + ]; +} + +// MsgSetGaslessContractsResponse returns empty data +message MsgSetGaslessContractsResponse {} diff --git a/proto/cosmwasm/wasm/v1/types.proto b/proto/cosmwasm/wasm/v1/types.proto index b68179e..ad53085 100644 --- a/proto/cosmwasm/wasm/v1/types.proto +++ b/proto/cosmwasm/wasm/v1/types.proto @@ -4,6 +4,7 @@ package cosmwasm.wasm.v1; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; +import "amino/amino.proto"; option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; option (gogoproto.goproto_getters_all) = false; @@ -19,10 +20,9 @@ enum AccessType { // AccessTypeNobody forbidden ACCESS_TYPE_NOBODY = 1 [ (gogoproto.enumvalue_customname) = "AccessTypeNobody" ]; - // AccessTypeOnlyAddress restricted to a single address - // Deprecated: use AccessTypeAnyOfAddresses instead - ACCESS_TYPE_ONLY_ADDRESS = 2 - [ (gogoproto.enumvalue_customname) = "AccessTypeOnlyAddress" ]; + + reserved 2; // was AccessTypeOnlyAddress + // AccessTypeEverybody unrestricted ACCESS_TYPE_EVERYBODY = 3 [ (gogoproto.enumvalue_customname) = "AccessTypeEverybody" ]; @@ -42,10 +42,10 @@ message AccessConfig { option (gogoproto.goproto_stringer) = true; AccessType permission = 1 [ (gogoproto.moretags) = "yaml:\"permission\"" ]; - // Address - // Deprecated: replaced by addresses - string address = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ]; - repeated string addresses = 3 [ (gogoproto.moretags) = "yaml:\"addresses\"" ]; + reserved 2; // was address + + repeated string addresses = 3 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; } // Params defines the set of wasm parameters. @@ -53,6 +53,7 @@ message Params { option (gogoproto.goproto_stringer) = false; AccessConfig code_upload_access = 1 [ (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, (gogoproto.moretags) = "yaml:\"code_upload_access\"" ]; AccessType instantiate_default_permission = 2 @@ -64,11 +65,12 @@ message CodeInfo { // CodeHash is the unique identifier created by wasmvm bytes code_hash = 1; // Creator address who initially stored the code - string creator = 2; + string creator = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // Used in v1beta1 reserved 3, 4; // InstantiateConfig access control to apply on contract creation, optional - AccessConfig instantiate_config = 5 [ (gogoproto.nullable) = false ]; + AccessConfig instantiate_config = 5 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; } // ContractInfo stores a WASM contract instance @@ -78,9 +80,9 @@ message ContractInfo { // CodeID is the reference to the stored Wasm code uint64 code_id = 1 [ (gogoproto.customname) = "CodeID" ]; // Creator address who initially instantiated the contract - string creator = 2; + string creator = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // Admin is an optional address that can execute migrations - string admin = 3; + string admin = 3 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; // Label is optional metadata to be stored with a contract instance. string label = 4; // Created Tx position when the contract was instantiated. @@ -122,7 +124,10 @@ message ContractCodeHistoryEntry { uint64 code_id = 2 [ (gogoproto.customname) = "CodeID" ]; // Updated Tx position when the operation was executed. AbsoluteTxPosition updated = 3; - bytes msg = 4 [ (gogoproto.casttype) = "RawContractMessage" ]; + bytes msg = 4 [ + (gogoproto.casttype) = "RawContractMessage", + (amino.encoding) = "inline_json" + ]; } // AbsoluteTxPosition is a unique transaction position that allows for global @@ -139,7 +144,7 @@ message AbsoluteTxPosition { message Model { // hex-encode key to read it better (this is often ascii) bytes key = 1 [ (gogoproto.casttype) = - "github.com/tendermint/tendermint/libs/bytes.HexBytes" ]; + "github.com/cometbft/cometbft/libs/bytes.HexBytes" ]; // base64-encode raw value bytes value = 2; } diff --git a/proto/cosmwasm/wasm/v1beta1/proposal_legacy_v1beta1.proto b/proto/cosmwasm/wasm/v1beta1/proposal_legacy_v1beta1.proto new file mode 100644 index 0000000..5797950 --- /dev/null +++ b/proto/cosmwasm/wasm/v1beta1/proposal_legacy_v1beta1.proto @@ -0,0 +1,386 @@ +syntax = "proto3"; +package cosmwasm.wasm.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "amino/amino.proto"; + +option go_package = "github.com/CosmWasm/wasmd/x/wasm/legacy"; +option (gogoproto.goproto_stringer_all) = false; +option (gogoproto.goproto_getters_all) = false; +option (gogoproto.equal_all) = true; + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit StoreCodeProposal. To submit WASM code to the system, +// a simple MsgStoreCode can be invoked from the x/gov module via +// a v1 governance proposal. +message StoreCodeProposal { + option deprecated = true; + option (amino.name) = "wasm/StoreCodeProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // RunAs is the address that is passed to the contract's environment as sender + string run_as = 3 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // WASMByteCode can be raw or gzip compressed + bytes wasm_byte_code = 4 [ (gogoproto.customname) = "WASMByteCode" ]; + // Used in v1beta1 + reserved 5, 6; + // InstantiatePermission to apply on contract creation, optional + AccessConfigV1Beta1 instantiate_permission = 7; + // UnpinCode code on upload, optional + bool unpin_code = 8; + // Source is the URL where the code is hosted + string source = 9; + // Builder is the docker image used to build the code deterministically, used + // for smart contract verification + string builder = 10; + // CodeHash is the SHA256 sum of the code outputted by builder, used for smart + // contract verification + bytes code_hash = 11; +} + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit InstantiateContractProposal. To instantiate a contract, +// a simple MsgInstantiateContract can be invoked from the x/gov module via +// a v1 governance proposal. +message InstantiateContractProposal { + option deprecated = true; + option (amino.name) = "wasm/InstantiateContractProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // RunAs is the address that is passed to the contract's environment as sender + string run_as = 3 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Admin is an optional address that can execute migrations + string admin = 4 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // CodeID is the reference to the stored WASM code + uint64 code_id = 5 [ (gogoproto.customname) = "CodeID" ]; + // Label is optional metadata to be stored with a constract instance. + string label = 6; + // Msg json encoded message to be passed to the contract on instantiation + bytes msg = 7 [ + (gogoproto.casttype) = "RawContractMessage", + (amino.encoding) = "inline_json" + ]; + // Funds coins that are transferred to the contract on instantiation + repeated cosmos.base.v1beta1.Coin funds = 8 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (amino.encoding) = "legacy_coins" + ]; +} + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit InstantiateContract2Proposal. To instantiate contract 2, +// a simple MsgInstantiateContract2 can be invoked from the x/gov module via +// a v1 governance proposal. +message InstantiateContract2Proposal { + option deprecated = true; + option (amino.name) = "wasm/InstantiateContract2Proposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // RunAs is the address that is passed to the contract's enviroment as sender + string run_as = 3 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Admin is an optional address that can execute migrations + string admin = 4 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // CodeID is the reference to the stored WASM code + uint64 code_id = 5 [ (gogoproto.customname) = "CodeID" ]; + // Label is optional metadata to be stored with a constract instance. + string label = 6; + // Msg json encode message to be passed to the contract on instantiation + bytes msg = 7 [ + (gogoproto.casttype) = "RawContractMessage", + (amino.encoding) = "inline_json" + ]; + // Funds coins that are transferred to the contract on instantiation + repeated cosmos.base.v1beta1.Coin funds = 8 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (amino.encoding) = "legacy_coins" + ]; + // Salt is an arbitrary value provided by the sender. Size can be 1 to 64. + bytes salt = 9; + // FixMsg include the msg value into the hash for the predictable address. + // Default is false + bool fix_msg = 10; +} + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit MigrateContractProposal. To migrate a contract, +// a simple MsgMigrateContract can be invoked from the x/gov module via +// a v1 governance proposal. +message MigrateContractProposal { + option deprecated = true; + option (amino.name) = "wasm/MigrateContractProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // Note: skipping 3 as this was previously used for unneeded run_as + + // Contract is the address of the smart contract + string contract = 4 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // CodeID references the new WASM code + uint64 code_id = 5 [ (gogoproto.customname) = "CodeID" ]; + // Msg json encoded message to be passed to the contract on migration + bytes msg = 6 [ + (gogoproto.casttype) = "RawContractMessage", + (amino.encoding) = "inline_json" + ]; +} + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit SudoContractProposal. To call sudo on a contract, +// a simple MsgSudoContract can be invoked from the x/gov module via +// a v1 governance proposal. +message SudoContractProposal { + option deprecated = true; + option (amino.name) = "wasm/SudoContractProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // Contract is the address of the smart contract + string contract = 3 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Msg json encoded message to be passed to the contract as sudo + bytes msg = 4 [ + (gogoproto.casttype) = "RawContractMessage", + (amino.encoding) = "inline_json" + ]; +} + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit ExecuteContractProposal. To call execute on a contract, +// a simple MsgExecuteContract can be invoked from the x/gov module via +// a v1 governance proposal. +message ExecuteContractProposal { + option deprecated = true; + option (amino.name) = "wasm/ExecuteContractProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // RunAs is the address that is passed to the contract's environment as sender + string run_as = 3 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Contract is the address of the smart contract + string contract = 4 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Msg json encoded message to be passed to the contract as execute + bytes msg = 5 [ + (gogoproto.casttype) = "RawContractMessage", + (amino.encoding) = "inline_json" + ]; + // Funds coins that are transferred to the contract on instantiation + repeated cosmos.base.v1beta1.Coin funds = 6 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (amino.encoding) = "legacy_coins" + ]; +} + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit UpdateAdminProposal. To set an admin for a contract, +// a simple MsgUpdateAdmin can be invoked from the x/gov module via +// a v1 governance proposal. +message UpdateAdminProposal { + option deprecated = true; + option (amino.name) = "wasm/UpdateAdminProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // NewAdmin address to be set + string new_admin = 3 [ + (gogoproto.moretags) = "yaml:\"new_admin\"", + (cosmos_proto.scalar) = "cosmos.AddressString" + ]; + // Contract is the address of the smart contract + string contract = 4 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit ClearAdminProposal. To clear the admin of a contract, +// a simple MsgClearAdmin can be invoked from the x/gov module via +// a v1 governance proposal. +message ClearAdminProposal { + option deprecated = true; + option (amino.name) = "wasm/ClearAdminProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // Contract is the address of the smart contract + string contract = 3 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit PinCodesProposal. To pin a set of code ids in the wasmvm +// cache, a simple MsgPinCodes can be invoked from the x/gov module via +// a v1 governance proposal. +message PinCodesProposal { + option deprecated = true; + option (amino.name) = "wasm/PinCodesProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // CodeIDs references the new WASM codes + repeated uint64 code_ids = 3 [ + (gogoproto.customname) = "CodeIDs", + (gogoproto.moretags) = "yaml:\"code_ids\"" + ]; +} + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit UnpinCodesProposal. To unpin a set of code ids in the wasmvm +// cache, a simple MsgUnpinCodes can be invoked from the x/gov module via +// a v1 governance proposal. +message UnpinCodesProposal { + option deprecated = true; + option (amino.name) = "wasm/UnpinCodesProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // CodeIDs references the WASM codes + repeated uint64 code_ids = 3 [ + (gogoproto.customname) = "CodeIDs", + (gogoproto.moretags) = "yaml:\"code_ids\"" + ]; +} + +// AccessConfigUpdateV1Beta1 contains the code id and the access config to be +// applied. +message AccessConfigUpdateV1Beta1 { + // CodeID is the reference to the stored WASM code to be updated + uint64 code_id = 1 [ (gogoproto.customname) = "CodeID" ]; + // InstantiatePermission to apply to the set of code ids + AccessConfigV1Beta1 instantiate_permission = 2 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; +} + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit UpdateInstantiateConfigProposal. To update instantiate config +// to a set of code ids, a simple MsgUpdateInstantiateConfig can be invoked from +// the x/gov module via a v1 governance proposal. +message UpdateInstantiateConfigProposal { + option deprecated = true; + option (amino.name) = "wasm/UpdateInstantiateConfigProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1 [ (gogoproto.moretags) = "yaml:\"title\"" ]; + // Description is a human readable text + string description = 2 [ (gogoproto.moretags) = "yaml:\"description\"" ]; + // AccessConfigUpdateV1Beta1 contains the list of code ids and the access + // config to be applied. + repeated AccessConfigUpdateV1Beta1 access_config_updates = 3 + [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; +} + +// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +// an explicit StoreAndInstantiateContractProposal. To store and instantiate +// the contract, a simple MsgStoreAndInstantiateContract can be invoked from +// the x/gov module via a v1 governance proposal. +message StoreAndInstantiateContractProposal { + option deprecated = true; + option (amino.name) = "wasm/StoreAndInstantiateContractProposal"; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + // Title is a short summary + string title = 1; + // Description is a human readable text + string description = 2; + // RunAs is the address that is passed to the contract's environment as sender + string run_as = 3 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // WASMByteCode can be raw or gzip compressed + bytes wasm_byte_code = 4 [ (gogoproto.customname) = "WASMByteCode" ]; + // InstantiatePermission to apply on contract creation, optional + AccessConfigV1Beta1 instantiate_permission = 5; + // UnpinCode code on upload, optional + bool unpin_code = 6; + // Admin is an optional address that can execute migrations + string admin = 7; + // Label is optional metadata to be stored with a constract instance. + string label = 8; + // Msg json encoded message to be passed to the contract on instantiation + bytes msg = 9 [ + (gogoproto.casttype) = "RawContractMessage", + (amino.encoding) = "inline_json" + ]; + // Funds coins that are transferred to the contract on instantiation + repeated cosmos.base.v1beta1.Coin funds = 10 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (amino.encoding) = "legacy_coins" + ]; + // Source is the URL where the code is hosted + string source = 11; + // Builder is the docker image used to build the code deterministically, used + // for smart contract verification + string builder = 12; + // CodeHash is the SHA256 sum of the code outputted by builder, used for smart + // contract verification + bytes code_hash = 13; +} + +// AccessTypeV1Beta1 permission types +enum AccessTypeV1Beta1 { + option (gogoproto.goproto_enum_prefix) = false; + option (gogoproto.goproto_enum_stringer) = false; + // AccessTypeUnspecified placeholder for empty value + ACCESS_TYPE_UNSPECIFIED = 0 + [ (gogoproto.enumvalue_customname) = "AccessTypeUnspecifiedV1Beta1" ]; + // AccessTypeNobody forbidden + ACCESS_TYPE_NOBODY = 1 + [ (gogoproto.enumvalue_customname) = "AccessTypeNobodyV1Beta1" ]; + + reserved 2; // was AccessTypeOnlyAddress + + // AccessTypeEverybody unrestricted + ACCESS_TYPE_EVERYBODY = 3 + [ (gogoproto.enumvalue_customname) = "AccessTypeEverybodyV1Beta1" ]; + // AccessTypeAnyOfAddresses allow any of the addresses + ACCESS_TYPE_ANY_OF_ADDRESSES = 4 + [ (gogoproto.enumvalue_customname) = "AccessTypeAnyOfAddressesV1Beta1" ]; +} + +// AccessConfigV1Beta1 access control type. +message AccessConfigV1Beta1 { + option (gogoproto.goproto_stringer) = true; + AccessTypeV1Beta1 permission = 1 [ (gogoproto.moretags) = "yaml:\"permission\"" ]; + + reserved 2; // was address + + repeated string addresses = 3 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; +} \ No newline at end of file diff --git a/proto/descriptor.proto b/proto/descriptor.proto deleted file mode 100644 index 0636a87..0000000 --- a/proto/descriptor.proto +++ /dev/null @@ -1,921 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// The messages in this file describe the definitions found in .proto files. -// A valid .proto file can be translated directly to a FileDescriptorProto -// without any other information (e.g. without reading its imports). - -syntax = "proto2"; - -package google.protobuf; - -option go_package = "google.golang.org/protobuf/types/descriptorpb"; -option java_package = "com.google.protobuf"; -option java_outer_classname = "DescriptorProtos"; -option csharp_namespace = "Google.Protobuf.Reflection"; -option objc_class_prefix = "GPB"; -option cc_enable_arenas = true; - -// descriptor.proto must be optimized for speed because reflection-based -// algorithms don't work during bootstrapping. -option optimize_for = SPEED; - -// The protocol compiler can output a FileDescriptorSet containing the .proto -// files it parses. -message FileDescriptorSet { - repeated FileDescriptorProto file = 1; -} - -// Describes a complete .proto file. -message FileDescriptorProto { - optional string name = 1; // file name, relative to root of source tree - optional string package = 2; // e.g. "foo", "foo.bar", etc. - - // Names of files imported by this file. - repeated string dependency = 3; - // Indexes of the public imported files in the dependency list above. - repeated int32 public_dependency = 10; - // Indexes of the weak imported files in the dependency list. - // For Google-internal migration only. Do not use. - repeated int32 weak_dependency = 11; - - // All top-level definitions in this file. - repeated DescriptorProto message_type = 4; - repeated EnumDescriptorProto enum_type = 5; - repeated ServiceDescriptorProto service = 6; - repeated FieldDescriptorProto extension = 7; - - optional FileOptions options = 8; - - // This field contains optional information about the original source code. - // You may safely remove this entire field without harming runtime - // functionality of the descriptors -- the information is needed only by - // development tools. - optional SourceCodeInfo source_code_info = 9; - - // The syntax of the proto file. - // The supported values are "proto2", "proto3", and "editions". - // - // If `edition` is present, this value must be "editions". - optional string syntax = 12; - - // The edition of the proto file, which is an opaque string. - optional string edition = 13; -} - -// Describes a message type. -message DescriptorProto { - optional string name = 1; - - repeated FieldDescriptorProto field = 2; - repeated FieldDescriptorProto extension = 6; - - repeated DescriptorProto nested_type = 3; - repeated EnumDescriptorProto enum_type = 4; - - message ExtensionRange { - optional int32 start = 1; // Inclusive. - optional int32 end = 2; // Exclusive. - - optional ExtensionRangeOptions options = 3; - } - repeated ExtensionRange extension_range = 5; - - repeated OneofDescriptorProto oneof_decl = 8; - - optional MessageOptions options = 7; - - // Range of reserved tag numbers. Reserved tag numbers may not be used by - // fields or extension ranges in the same message. Reserved ranges may - // not overlap. - message ReservedRange { - optional int32 start = 1; // Inclusive. - optional int32 end = 2; // Exclusive. - } - repeated ReservedRange reserved_range = 9; - // Reserved field names, which may not be used by fields in the same message. - // A given name may only be reserved once. - repeated string reserved_name = 10; -} - -message ExtensionRangeOptions { - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -// Describes a field within a message. -message FieldDescriptorProto { - enum Type { - // 0 is reserved for errors. - // Order is weird for historical reasons. - TYPE_DOUBLE = 1; - TYPE_FLOAT = 2; - // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if - // negative values are likely. - TYPE_INT64 = 3; - TYPE_UINT64 = 4; - // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if - // negative values are likely. - TYPE_INT32 = 5; - TYPE_FIXED64 = 6; - TYPE_FIXED32 = 7; - TYPE_BOOL = 8; - TYPE_STRING = 9; - // Tag-delimited aggregate. - // Group type is deprecated and not supported in proto3. However, Proto3 - // implementations should still be able to parse the group wire format and - // treat group fields as unknown fields. - TYPE_GROUP = 10; - TYPE_MESSAGE = 11; // Length-delimited aggregate. - - // New in version 2. - TYPE_BYTES = 12; - TYPE_UINT32 = 13; - TYPE_ENUM = 14; - TYPE_SFIXED32 = 15; - TYPE_SFIXED64 = 16; - TYPE_SINT32 = 17; // Uses ZigZag encoding. - TYPE_SINT64 = 18; // Uses ZigZag encoding. - } - - enum Label { - // 0 is reserved for errors - LABEL_OPTIONAL = 1; - LABEL_REQUIRED = 2; - LABEL_REPEATED = 3; - } - - optional string name = 1; - optional int32 number = 3; - optional Label label = 4; - - // If type_name is set, this need not be set. If both this and type_name - // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. - optional Type type = 5; - - // For message and enum types, this is the name of the type. If the name - // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping - // rules are used to find the type (i.e. first the nested types within this - // message are searched, then within the parent, on up to the root - // namespace). - optional string type_name = 6; - - // For extensions, this is the name of the type being extended. It is - // resolved in the same manner as type_name. - optional string extendee = 2; - - // For numeric types, contains the original text representation of the value. - // For booleans, "true" or "false". - // For strings, contains the default text contents (not escaped in any way). - // For bytes, contains the C escaped value. All bytes >= 128 are escaped. - optional string default_value = 7; - - // If set, gives the index of a oneof in the containing type's oneof_decl - // list. This field is a member of that oneof. - optional int32 oneof_index = 9; - - // JSON name of this field. The value is set by protocol compiler. If the - // user has set a "json_name" option on this field, that option's value - // will be used. Otherwise, it's deduced from the field's name by converting - // it to camelCase. - optional string json_name = 10; - - optional FieldOptions options = 8; - - // If true, this is a proto3 "optional". When a proto3 field is optional, it - // tracks presence regardless of field type. - // - // When proto3_optional is true, this field must be belong to a oneof to - // signal to old proto3 clients that presence is tracked for this field. This - // oneof is known as a "synthetic" oneof, and this field must be its sole - // member (each proto3 optional field gets its own synthetic oneof). Synthetic - // oneofs exist in the descriptor only, and do not generate any API. Synthetic - // oneofs must be ordered after all "real" oneofs. - // - // For message fields, proto3_optional doesn't create any semantic change, - // since non-repeated message fields always track presence. However it still - // indicates the semantic detail of whether the user wrote "optional" or not. - // This can be useful for round-tripping the .proto file. For consistency we - // give message fields a synthetic oneof also, even though it is not required - // to track presence. This is especially important because the parser can't - // tell if a field is a message or an enum, so it must always create a - // synthetic oneof. - // - // Proto2 optional fields do not set this flag, because they already indicate - // optional with `LABEL_OPTIONAL`. - optional bool proto3_optional = 17; -} - -// Describes a oneof. -message OneofDescriptorProto { - optional string name = 1; - optional OneofOptions options = 2; -} - -// Describes an enum type. -message EnumDescriptorProto { - optional string name = 1; - - repeated EnumValueDescriptorProto value = 2; - - optional EnumOptions options = 3; - - // Range of reserved numeric values. Reserved values may not be used by - // entries in the same enum. Reserved ranges may not overlap. - // - // Note that this is distinct from DescriptorProto.ReservedRange in that it - // is inclusive such that it can appropriately represent the entire int32 - // domain. - message EnumReservedRange { - optional int32 start = 1; // Inclusive. - optional int32 end = 2; // Inclusive. - } - - // Range of reserved numeric values. Reserved numeric values may not be used - // by enum values in the same enum declaration. Reserved ranges may not - // overlap. - repeated EnumReservedRange reserved_range = 4; - - // Reserved enum value names, which may not be reused. A given name may only - // be reserved once. - repeated string reserved_name = 5; -} - -// Describes a value within an enum. -message EnumValueDescriptorProto { - optional string name = 1; - optional int32 number = 2; - - optional EnumValueOptions options = 3; -} - -// Describes a service. -message ServiceDescriptorProto { - optional string name = 1; - repeated MethodDescriptorProto method = 2; - - optional ServiceOptions options = 3; -} - -// Describes a method of a service. -message MethodDescriptorProto { - optional string name = 1; - - // Input and output type names. These are resolved in the same way as - // FieldDescriptorProto.type_name, but must refer to a message type. - optional string input_type = 2; - optional string output_type = 3; - - optional MethodOptions options = 4; - - // Identifies if client streams multiple client messages - optional bool client_streaming = 5 [default = false]; - // Identifies if server streams multiple server messages - optional bool server_streaming = 6 [default = false]; -} - -// =================================================================== -// Options - -// Each of the definitions above may have "options" attached. These are -// just annotations which may cause code to be generated slightly differently -// or may contain hints for code that manipulates protocol messages. -// -// Clients may define custom options as extensions of the *Options messages. -// These extensions may not yet be known at parsing time, so the parser cannot -// store the values in them. Instead it stores them in a field in the *Options -// message called uninterpreted_option. This field must have the same name -// across all *Options messages. We then use this field to populate the -// extensions when we build a descriptor, at which point all protos have been -// parsed and so all extensions are known. -// -// Extension numbers for custom options may be chosen as follows: -// * For options which will only be used within a single application or -// organization, or for experimental options, use field numbers 50000 -// through 99999. It is up to you to ensure that you do not use the -// same number for multiple options. -// * For options which will be published and used publicly by multiple -// independent entities, e-mail protobuf-global-extension-registry@google.com -// to reserve extension numbers. Simply provide your project name (e.g. -// Objective-C plugin) and your project website (if available) -- there's no -// need to explain how you intend to use them. Usually you only need one -// extension number. You can declare multiple options with only one extension -// number by putting them in a sub-message. See the Custom Options section of -// the docs for examples: -// https://developers.google.com/protocol-buffers/docs/proto#options -// If this turns out to be popular, a web service will be set up -// to automatically assign option numbers. - -message FileOptions { - - // Sets the Java package where classes generated from this .proto will be - // placed. By default, the proto package is used, but this is often - // inappropriate because proto packages do not normally start with backwards - // domain names. - optional string java_package = 1; - - // Controls the name of the wrapper Java class generated for the .proto file. - // That class will always contain the .proto file's getDescriptor() method as - // well as any top-level extensions defined in the .proto file. - // If java_multiple_files is disabled, then all the other classes from the - // .proto file will be nested inside the single wrapper outer class. - optional string java_outer_classname = 8; - - // If enabled, then the Java code generator will generate a separate .java - // file for each top-level message, enum, and service defined in the .proto - // file. Thus, these types will *not* be nested inside the wrapper class - // named by java_outer_classname. However, the wrapper class will still be - // generated to contain the file's getDescriptor() method as well as any - // top-level extensions defined in the file. - optional bool java_multiple_files = 10 [default = false]; - - // This option does nothing. - optional bool java_generate_equals_and_hash = 20 [deprecated=true]; - - // If set true, then the Java2 code generator will generate code that - // throws an exception whenever an attempt is made to assign a non-UTF-8 - // byte sequence to a string field. - // Message reflection will do the same. - // However, an extension field still accepts non-UTF-8 byte sequences. - // This option has no effect on when used with the lite runtime. - optional bool java_string_check_utf8 = 27 [default = false]; - - // Generated classes can be optimized for speed or code size. - enum OptimizeMode { - SPEED = 1; // Generate complete code for parsing, serialization, - // etc. - CODE_SIZE = 2; // Use ReflectionOps to implement these methods. - LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. - } - optional OptimizeMode optimize_for = 9 [default = SPEED]; - - // Sets the Go package where structs generated from this .proto will be - // placed. If omitted, the Go package will be derived from the following: - // - The basename of the package import path, if provided. - // - Otherwise, the package statement in the .proto file, if present. - // - Otherwise, the basename of the .proto file, without extension. - optional string go_package = 11; - - // Should generic services be generated in each language? "Generic" services - // are not specific to any particular RPC system. They are generated by the - // main code generators in each language (without additional plugins). - // Generic services were the only kind of service generation supported by - // early versions of google.protobuf. - // - // Generic services are now considered deprecated in favor of using plugins - // that generate code specific to your particular RPC system. Therefore, - // these default to false. Old code which depends on generic services should - // explicitly set them to true. - optional bool cc_generic_services = 16 [default = false]; - optional bool java_generic_services = 17 [default = false]; - optional bool py_generic_services = 18 [default = false]; - optional bool php_generic_services = 42 [default = false]; - - // Is this file deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for everything in the file, or it will be completely ignored; in the very - // least, this is a formalization for deprecating files. - optional bool deprecated = 23 [default = false]; - - // Enables the use of arenas for the proto messages in this file. This applies - // only to generated classes for C++. - optional bool cc_enable_arenas = 31 [default = true]; - - // Sets the objective c class prefix which is prepended to all objective c - // generated classes from this .proto. There is no default. - optional string objc_class_prefix = 36; - - // Namespace for generated classes; defaults to the package. - optional string csharp_namespace = 37; - - // By default Swift generators will take the proto package and CamelCase it - // replacing '.' with underscore and use that to prefix the types/symbols - // defined. When this options is provided, they will use this value instead - // to prefix the types/symbols defined. - optional string swift_prefix = 39; - - // Sets the php class prefix which is prepended to all php generated classes - // from this .proto. Default is empty. - optional string php_class_prefix = 40; - - // Use this option to change the namespace of php generated classes. Default - // is empty. When this option is empty, the package name will be used for - // determining the namespace. - optional string php_namespace = 41; - - // Use this option to change the namespace of php generated metadata classes. - // Default is empty. When this option is empty, the proto file name will be - // used for determining the namespace. - optional string php_metadata_namespace = 44; - - // Use this option to change the package of ruby generated classes. Default - // is empty. When this option is not set, the package name will be used for - // determining the ruby package. - optional string ruby_package = 45; - - // The parser stores options it doesn't recognize here. - // See the documentation for the "Options" section above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. - // See the documentation for the "Options" section above. - extensions 1000 to max; - - reserved 38; -} - -message MessageOptions { - // Set true to use the old proto1 MessageSet wire format for extensions. - // This is provided for backwards-compatibility with the MessageSet wire - // format. You should not use this for any other reason: It's less - // efficient, has fewer features, and is more complicated. - // - // The message must be defined exactly as follows: - // message Foo { - // option message_set_wire_format = true; - // extensions 4 to max; - // } - // Note that the message cannot have any defined fields; MessageSets only - // have extensions. - // - // All extensions of your type must be singular messages; e.g. they cannot - // be int32s, enums, or repeated messages. - // - // Because this is an option, the above two restrictions are not enforced by - // the protocol compiler. - optional bool message_set_wire_format = 1 [default = false]; - - // Disables the generation of the standard "descriptor()" accessor, which can - // conflict with a field of the same name. This is meant to make migration - // from proto1 easier; new code should avoid fields named "descriptor". - optional bool no_standard_descriptor_accessor = 2 [default = false]; - - // Is this message deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the message, or it will be completely ignored; in the very least, - // this is a formalization for deprecating messages. - optional bool deprecated = 3 [default = false]; - - reserved 4, 5, 6; - - // NOTE: Do not set the option in .proto files. Always use the maps syntax - // instead. The option should only be implicitly set by the proto compiler - // parser. - // - // Whether the message is an automatically generated map entry type for the - // maps field. - // - // For maps fields: - // map map_field = 1; - // The parsed descriptor looks like: - // message MapFieldEntry { - // option map_entry = true; - // optional KeyType key = 1; - // optional ValueType value = 2; - // } - // repeated MapFieldEntry map_field = 1; - // - // Implementations may choose not to generate the map_entry=true message, but - // use a native map in the target language to hold the keys and values. - // The reflection APIs in such implementations still need to work as - // if the field is a repeated message field. - optional bool map_entry = 7; - - reserved 8; // javalite_serializable - reserved 9; // javanano_as_lite - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message FieldOptions { - // The ctype option instructs the C++ code generator to use a different - // representation of the field than it normally would. See the specific - // options below. This option is not yet implemented in the open source - // release -- sorry, we'll try to include it in a future version! - optional CType ctype = 1 [default = STRING]; - enum CType { - // Default mode. - STRING = 0; - - CORD = 1; - - STRING_PIECE = 2; - } - // The packed option can be enabled for repeated primitive fields to enable - // a more efficient representation on the wire. Rather than repeatedly - // writing the tag and type for each element, the entire array is encoded as - // a single length-delimited blob. In proto3, only explicit setting it to - // false will avoid using packed encoding. - optional bool packed = 2; - - // The jstype option determines the JavaScript type used for values of the - // field. The option is permitted only for 64 bit integral and fixed types - // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING - // is represented as JavaScript string, which avoids loss of precision that - // can happen when a large value is converted to a floating point JavaScript. - // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to - // use the JavaScript "number" type. The behavior of the default option - // JS_NORMAL is implementation dependent. - // - // This option is an enum to permit additional types to be added, e.g. - // goog.math.Integer. - optional JSType jstype = 6 [default = JS_NORMAL]; - enum JSType { - // Use the default type. - JS_NORMAL = 0; - - // Use JavaScript strings. - JS_STRING = 1; - - // Use JavaScript numbers. - JS_NUMBER = 2; - } - - // Should this field be parsed lazily? Lazy applies only to message-type - // fields. It means that when the outer message is initially parsed, the - // inner message's contents will not be parsed but instead stored in encoded - // form. The inner message will actually be parsed when it is first accessed. - // - // This is only a hint. Implementations are free to choose whether to use - // eager or lazy parsing regardless of the value of this option. However, - // setting this option true suggests that the protocol author believes that - // using lazy parsing on this field is worth the additional bookkeeping - // overhead typically needed to implement it. - // - // This option does not affect the public interface of any generated code; - // all method signatures remain the same. Furthermore, thread-safety of the - // interface is not affected by this option; const methods remain safe to - // call from multiple threads concurrently, while non-const methods continue - // to require exclusive access. - // - // Note that implementations may choose not to check required fields within - // a lazy sub-message. That is, calling IsInitialized() on the outer message - // may return true even if the inner message has missing required fields. - // This is necessary because otherwise the inner message would have to be - // parsed in order to perform the check, defeating the purpose of lazy - // parsing. An implementation which chooses not to check required fields - // must be consistent about it. That is, for any particular sub-message, the - // implementation must either *always* check its required fields, or *never* - // check its required fields, regardless of whether or not the message has - // been parsed. - // - // As of May 2022, lazy verifies the contents of the byte stream during - // parsing. An invalid byte stream will cause the overall parsing to fail. - optional bool lazy = 5 [default = false]; - - // unverified_lazy does no correctness checks on the byte stream. This should - // only be used where lazy with verification is prohibitive for performance - // reasons. - optional bool unverified_lazy = 15 [default = false]; - - // Is this field deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for accessors, or it will be completely ignored; in the very least, this - // is a formalization for deprecating fields. - optional bool deprecated = 3 [default = false]; - - // For Google-internal migration only. Do not use. - optional bool weak = 10 [default = false]; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; - - reserved 4; // removed jtype -} - -message OneofOptions { - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message EnumOptions { - - // Set this option to true to allow mapping different tag names to the same - // value. - optional bool allow_alias = 2; - - // Is this enum deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the enum, or it will be completely ignored; in the very least, this - // is a formalization for deprecating enums. - optional bool deprecated = 3 [default = false]; - - reserved 5; // javanano_as_lite - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message EnumValueOptions { - // Is this enum value deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the enum value, or it will be completely ignored; in the very least, - // this is a formalization for deprecating enum values. - optional bool deprecated = 1 [default = false]; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message ServiceOptions { - - // Note: Field numbers 1 through 32 are reserved for Google's internal RPC - // framework. We apologize for hoarding these numbers to ourselves, but - // we were already using them long before we decided to release Protocol - // Buffers. - - // Is this service deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the service, or it will be completely ignored; in the very least, - // this is a formalization for deprecating services. - optional bool deprecated = 33 [default = false]; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message MethodOptions { - - // Note: Field numbers 1 through 32 are reserved for Google's internal RPC - // framework. We apologize for hoarding these numbers to ourselves, but - // we were already using them long before we decided to release Protocol - // Buffers. - - // Is this method deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the method, or it will be completely ignored; in the very least, - // this is a formalization for deprecating methods. - optional bool deprecated = 33 [default = false]; - - // Is this method side-effect-free (or safe in HTTP parlance), or idempotent, - // or neither? HTTP based RPC implementation may choose GET verb for safe - // methods, and PUT verb for idempotent methods instead of the default POST. - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0; - NO_SIDE_EFFECTS = 1; // implies idempotent - IDEMPOTENT = 2; // idempotent, but may have side effects - } - optional IdempotencyLevel idempotency_level = 34 - [default = IDEMPOTENCY_UNKNOWN]; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -// A message representing a option the parser does not recognize. This only -// appears in options protos created by the compiler::Parser class. -// DescriptorPool resolves these when building Descriptor objects. Therefore, -// options protos in descriptor objects (e.g. returned by Descriptor::options(), -// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions -// in them. -message UninterpretedOption { - // The name of the uninterpreted option. Each string represents a segment in - // a dot-separated name. is_extension is true iff a segment represents an - // extension (denoted with parentheses in options specs in .proto files). - // E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents - // "foo.(bar.baz).moo". - message NamePart { - required string name_part = 1; - required bool is_extension = 2; - } - repeated NamePart name = 2; - - // The value of the uninterpreted option, in whatever type the tokenizer - // identified it as during parsing. Exactly one of these should be set. - optional string identifier_value = 3; - optional uint64 positive_int_value = 4; - optional int64 negative_int_value = 5; - optional double double_value = 6; - optional bytes string_value = 7; - optional string aggregate_value = 8; -} - -// =================================================================== -// Optional source code info - -// Encapsulates information about the original source file from which a -// FileDescriptorProto was generated. -message SourceCodeInfo { - // A Location identifies a piece of source code in a .proto file which - // corresponds to a particular definition. This information is intended - // to be useful to IDEs, code indexers, documentation generators, and similar - // tools. - // - // For example, say we have a file like: - // message Foo { - // optional string foo = 1; - // } - // Let's look at just the field definition: - // optional string foo = 1; - // ^ ^^ ^^ ^ ^^^ - // a bc de f ghi - // We have the following locations: - // span path represents - // [a,i) [ 4, 0, 2, 0 ] The whole field definition. - // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). - // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). - // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). - // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). - // - // Notes: - // - A location may refer to a repeated field itself (i.e. not to any - // particular index within it). This is used whenever a set of elements are - // logically enclosed in a single code segment. For example, an entire - // extend block (possibly containing multiple extension definitions) will - // have an outer location whose path refers to the "extensions" repeated - // field without an index. - // - Multiple locations may have the same path. This happens when a single - // logical declaration is spread out across multiple places. The most - // obvious example is the "extend" block again -- there may be multiple - // extend blocks in the same scope, each of which will have the same path. - // - A location's span is not always a subset of its parent's span. For - // example, the "extendee" of an extension declaration appears at the - // beginning of the "extend" block and is shared by all extensions within - // the block. - // - Just because a location's span is a subset of some other location's span - // does not mean that it is a descendant. For example, a "group" defines - // both a type and a field in a single declaration. Thus, the locations - // corresponding to the type and field and their components will overlap. - // - Code which tries to interpret locations should probably be designed to - // ignore those that it doesn't understand, as more types of locations could - // be recorded in the future. - repeated Location location = 1; - message Location { - // Identifies which part of the FileDescriptorProto was defined at this - // location. - // - // Each element is a field number or an index. They form a path from - // the root FileDescriptorProto to the place where the definition occurs. - // For example, this path: - // [ 4, 3, 2, 7, 1 ] - // refers to: - // file.message_type(3) // 4, 3 - // .field(7) // 2, 7 - // .name() // 1 - // This is because FileDescriptorProto.message_type has field number 4: - // repeated DescriptorProto message_type = 4; - // and DescriptorProto.field has field number 2: - // repeated FieldDescriptorProto field = 2; - // and FieldDescriptorProto.name has field number 1: - // optional string name = 1; - // - // Thus, the above path gives the location of a field name. If we removed - // the last element: - // [ 4, 3, 2, 7 ] - // this path refers to the whole field declaration (from the beginning - // of the label to the terminating semicolon). - repeated int32 path = 1 [packed = true]; - - // Always has exactly three or four elements: start line, start column, - // end line (optional, otherwise assumed same as start line), end column. - // These are packed into a single field for efficiency. Note that line - // and column numbers are zero-based -- typically you will want to add - // 1 to each before displaying to a user. - repeated int32 span = 2 [packed = true]; - - // If this SourceCodeInfo represents a complete declaration, these are any - // comments appearing before and after the declaration which appear to be - // attached to the declaration. - // - // A series of line comments appearing on consecutive lines, with no other - // tokens appearing on those lines, will be treated as a single comment. - // - // leading_detached_comments will keep paragraphs of comments that appear - // before (but not connected to) the current element. Each paragraph, - // separated by empty lines, will be one comment element in the repeated - // field. - // - // Only the comment content is provided; comment markers (e.g. //) are - // stripped out. For block comments, leading whitespace and an asterisk - // will be stripped from the beginning of each line other than the first. - // Newlines are included in the output. - // - // Examples: - // - // optional int32 foo = 1; // Comment attached to foo. - // // Comment attached to bar. - // optional int32 bar = 2; - // - // optional string baz = 3; - // // Comment attached to baz. - // // Another line attached to baz. - // - // // Comment attached to moo. - // // - // // Another line attached to moo. - // optional double moo = 4; - // - // // Detached comment for corge. This is not leading or trailing comments - // // to moo or corge because there are blank lines separating it from - // // both. - // - // // Detached comment for corge paragraph 2. - // - // optional string corge = 5; - // /* Block comment attached - // * to corge. Leading asterisks - // * will be removed. */ - // /* Block comment attached to - // * grault. */ - // optional int32 grault = 6; - // - // // ignored detached comments. - optional string leading_comments = 3; - optional string trailing_comments = 4; - repeated string leading_detached_comments = 6; - } -} - -// Describes the relationship between generated code and its original source -// file. A GeneratedCodeInfo message is associated with only one generated -// source file, but may contain references to different source .proto files. -message GeneratedCodeInfo { - // An Annotation connects some span of text in generated code to an element - // of its generating .proto file. - repeated Annotation annotation = 1; - message Annotation { - // Identifies the element in the original source .proto file. This field - // is formatted the same as SourceCodeInfo.Location.path. - repeated int32 path = 1 [packed = true]; - - // Identifies the filesystem path to the original source .proto. - optional string source_file = 2; - - // Identifies the starting offset in bytes in the generated code - // that relates to the identified object. - optional int32 begin = 3; - - // Identifies the ending offset in bytes in the generated code that - // relates to the identified object. The end offset should be one past - // the last relevant byte (so the length of the text = end - begin). - optional int32 end = 4; - - // Represents the identified object's effect on the element in the original - // .proto file. - enum Semantic { - // There is no effect or the effect is indescribable. - NONE = 0; - // The element is set or otherwise mutated. - SET = 1; - // An alias to the element is returned. - ALIAS = 2; - } - optional Semantic semantic = 5; - } -} diff --git a/proto/ibc/applications/fee/v1/ack.proto b/proto/ibc/applications/fee/v1/ack.proto index b6c20ac..2f3746d 100644 --- a/proto/ibc/applications/fee/v1/ack.proto +++ b/proto/ibc/applications/fee/v1/ack.proto @@ -2,16 +2,14 @@ syntax = "proto3"; package ibc.applications.fee.v1; -option go_package = "github.com/cosmos/ibc-go/v4/modules/apps/29-fee/types"; - -import "gogoproto/gogo.proto"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"; // IncentivizedAcknowledgement is the acknowledgement format to be used by applications wrapped in the fee middleware message IncentivizedAcknowledgement { // the underlying app acknowledgement bytes - bytes app_acknowledgement = 1 [(gogoproto.moretags) = "yaml:\"app_acknowledgement\""]; + bytes app_acknowledgement = 1; // the relayer address which submits the recv packet message - string forward_relayer_address = 2 [(gogoproto.moretags) = "yaml:\"forward_relayer_address\""]; + string forward_relayer_address = 2; // success flag of the base application callback - bool underlying_app_success = 3 [(gogoproto.moretags) = "yaml:\"underlying_app_successl\""]; + bool underlying_app_success = 3; } diff --git a/proto/ibc/applications/fee/v1/fee.proto b/proto/ibc/applications/fee/v1/fee.proto index d85ebcf..867e884 100644 --- a/proto/ibc/applications/fee/v1/fee.proto +++ b/proto/ibc/applications/fee/v1/fee.proto @@ -2,40 +2,46 @@ syntax = "proto3"; package ibc.applications.fee.v1; -option go_package = "github.com/cosmos/ibc-go/v4/modules/apps/29-fee/types"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"; +import "amino/amino.proto"; import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; import "ibc/core/channel/v1/channel.proto"; +import "cosmos/msg/v1/msg.proto"; // Fee defines the ICS29 receive, acknowledgement and timeout fees message Fee { // the packet receive fee repeated cosmos.base.v1beta1.Coin recv_fee = 1 [ - (gogoproto.moretags) = "yaml:\"recv_fee\"", (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (amino.encoding) = "legacy_coins" ]; + // the packet acknowledgement fee repeated cosmos.base.v1beta1.Coin ack_fee = 2 [ - (gogoproto.moretags) = "yaml:\"ack_fee\"", (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (amino.encoding) = "legacy_coins" ]; + // the packet timeout fee repeated cosmos.base.v1beta1.Coin timeout_fee = 3 [ - (gogoproto.moretags) = "yaml:\"timeout_fee\"", (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (amino.encoding) = "legacy_coins" ]; } // PacketFee contains ICS29 relayer fees, refund address and optional list of permitted relayers message PacketFee { + option (cosmos.msg.v1.signer) = "refund_address"; + // fee encapsulates the recv, ack and timeout fees associated with an IBC packet Fee fee = 1 [(gogoproto.nullable) = false]; // the refund address for unspent fees - string refund_address = 2 [(gogoproto.moretags) = "yaml:\"refund_address\""]; + string refund_address = 2; // optional list of relayers permitted to receive fees repeated string relayers = 3; } @@ -43,14 +49,13 @@ message PacketFee { // PacketFees contains a list of type PacketFee message PacketFees { // list of packet fees - repeated PacketFee packet_fees = 1 [(gogoproto.moretags) = "yaml:\"packet_fees\"", (gogoproto.nullable) = false]; + repeated PacketFee packet_fees = 1 [(gogoproto.nullable) = false]; } // IdentifiedPacketFees contains a list of type PacketFee and associated PacketId message IdentifiedPacketFees { // unique packet identifier comprised of the channel ID, port ID and sequence - ibc.core.channel.v1.PacketId packet_id = 1 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"packet_id\""]; + ibc.core.channel.v1.PacketId packet_id = 1 [(gogoproto.nullable) = false]; // list of packet fees - repeated PacketFee packet_fees = 2 [(gogoproto.moretags) = "yaml:\"packet_fees\"", (gogoproto.nullable) = false]; + repeated PacketFee packet_fees = 2 [(gogoproto.nullable) = false]; } diff --git a/proto/ibc/applications/fee/v1/genesis.proto b/proto/ibc/applications/fee/v1/genesis.proto index 9bce6ac..e48ceb5 100644 --- a/proto/ibc/applications/fee/v1/genesis.proto +++ b/proto/ibc/applications/fee/v1/genesis.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.applications.fee.v1; -option go_package = "github.com/cosmos/ibc-go/v4/modules/apps/29-fee/types"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"; import "gogoproto/gogo.proto"; import "ibc/applications/fee/v1/fee.proto"; @@ -11,34 +11,29 @@ import "ibc/core/channel/v1/channel.proto"; // GenesisState defines the ICS29 fee middleware genesis state message GenesisState { // list of identified packet fees - repeated IdentifiedPacketFees identified_fees = 1 - [(gogoproto.moretags) = "yaml:\"identified_fees\"", (gogoproto.nullable) = false]; + repeated IdentifiedPacketFees identified_fees = 1 [(gogoproto.nullable) = false]; // list of fee enabled channels - repeated FeeEnabledChannel fee_enabled_channels = 2 - [(gogoproto.moretags) = "yaml:\"fee_enabled_channels\"", (gogoproto.nullable) = false]; + repeated FeeEnabledChannel fee_enabled_channels = 2 [(gogoproto.nullable) = false]; // list of registered payees - repeated RegisteredPayee registered_payees = 3 - [(gogoproto.moretags) = "yaml:\"registered_payees\"", (gogoproto.nullable) = false]; + repeated RegisteredPayee registered_payees = 3 [(gogoproto.nullable) = false]; // list of registered counterparty payees - repeated RegisteredCounterpartyPayee registered_counterparty_payees = 4 - [(gogoproto.moretags) = "yaml:\"registered_counterparty_payees\"", (gogoproto.nullable) = false]; + repeated RegisteredCounterpartyPayee registered_counterparty_payees = 4 [(gogoproto.nullable) = false]; // list of forward relayer addresses - repeated ForwardRelayerAddress forward_relayers = 5 - [(gogoproto.moretags) = "yaml:\"forward_relayers\"", (gogoproto.nullable) = false]; + repeated ForwardRelayerAddress forward_relayers = 5 [(gogoproto.nullable) = false]; } // FeeEnabledChannel contains the PortID & ChannelID for a fee enabled channel message FeeEnabledChannel { // unique port identifier - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + string port_id = 1; // unique channel identifier - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string channel_id = 2; } // RegisteredPayee contains the relayer address and payee address for a specific channel message RegisteredPayee { // unique channel identifier - string channel_id = 1 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string channel_id = 1; // the relayer address string relayer = 2; // the payee address @@ -49,11 +44,11 @@ message RegisteredPayee { // for recv fee distribution) message RegisteredCounterpartyPayee { // unique channel identifier - string channel_id = 1 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string channel_id = 1; // the relayer address string relayer = 2; // the counterparty payee address - string counterparty_payee = 3 [(gogoproto.moretags) = "yaml:\"counterparty_payee\""]; + string counterparty_payee = 3; } // ForwardRelayerAddress contains the forward relayer address and PacketId used for async acknowledgements @@ -61,6 +56,5 @@ message ForwardRelayerAddress { // the forward relayer address string address = 1; // unique packet identifer comprised of the channel ID, port ID and sequence - ibc.core.channel.v1.PacketId packet_id = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"packet_id\""]; + ibc.core.channel.v1.PacketId packet_id = 2 [(gogoproto.nullable) = false]; } diff --git a/proto/ibc/applications/fee/v1/metadata.proto b/proto/ibc/applications/fee/v1/metadata.proto index e1ec1b1..1e82e7c 100644 --- a/proto/ibc/applications/fee/v1/metadata.proto +++ b/proto/ibc/applications/fee/v1/metadata.proto @@ -2,15 +2,13 @@ syntax = "proto3"; package ibc.applications.fee.v1; -option go_package = "github.com/cosmos/ibc-go/v4/modules/apps/29-fee/types"; - -import "gogoproto/gogo.proto"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"; // Metadata defines the ICS29 channel specific metadata encoded into the channel version bytestring // See ICS004: https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#Versioning message Metadata { // fee_version defines the ICS29 fee version - string fee_version = 1 [(gogoproto.moretags) = "yaml:\"fee_version\""]; + string fee_version = 1; // app_version defines the underlying application version, which may or may not be a JSON encoded bytestring - string app_version = 2 [(gogoproto.moretags) = "yaml:\"app_version\""]; + string app_version = 2; } diff --git a/proto/ibc/applications/fee/v1/query.proto b/proto/ibc/applications/fee/v1/query.proto index 41b8c6b..726370e 100644 --- a/proto/ibc/applications/fee/v1/query.proto +++ b/proto/ibc/applications/fee/v1/query.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.applications.fee.v1; -option go_package = "github.com/cosmos/ibc-go/v4/modules/apps/29-fee/types"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; @@ -83,6 +83,8 @@ message QueryIncentivizedPacketsRequest { message QueryIncentivizedPacketsResponse { // list of identified fees for incentivized packets repeated ibc.applications.fee.v1.IdentifiedPacketFees incentivized_packets = 1 [(gogoproto.nullable) = false]; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; } // QueryIncentivizedPacketRequest defines the request type for the IncentivizedPacket rpc @@ -114,6 +116,8 @@ message QueryIncentivizedPacketsForChannelRequest { message QueryIncentivizedPacketsForChannelResponse { // Map of all incentivized_packets repeated ibc.applications.fee.v1.IdentifiedPacketFees incentivized_packets = 1; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; } // QueryTotalRecvFeesRequest defines the request type for the TotalRecvFees rpc @@ -125,11 +129,8 @@ message QueryTotalRecvFeesRequest { // QueryTotalRecvFeesResponse defines the response type for the TotalRecvFees rpc message QueryTotalRecvFeesResponse { // the total packet receive fees - repeated cosmos.base.v1beta1.Coin recv_fees = 1 [ - (gogoproto.moretags) = "yaml:\"recv_fees\"", - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; + repeated cosmos.base.v1beta1.Coin recv_fees = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; } // QueryTotalAckFeesRequest defines the request type for the TotalAckFees rpc @@ -141,11 +142,8 @@ message QueryTotalAckFeesRequest { // QueryTotalAckFeesResponse defines the response type for the TotalAckFees rpc message QueryTotalAckFeesResponse { // the total packet acknowledgement fees - repeated cosmos.base.v1beta1.Coin ack_fees = 1 [ - (gogoproto.moretags) = "yaml:\"ack_fees\"", - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; + repeated cosmos.base.v1beta1.Coin ack_fees = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; } // QueryTotalTimeoutFeesRequest defines the request type for the TotalTimeoutFees rpc @@ -157,17 +155,14 @@ message QueryTotalTimeoutFeesRequest { // QueryTotalTimeoutFeesResponse defines the response type for the TotalTimeoutFees rpc message QueryTotalTimeoutFeesResponse { // the total packet timeout fees - repeated cosmos.base.v1beta1.Coin timeout_fees = 1 [ - (gogoproto.moretags) = "yaml:\"timeout_fees\"", - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; + repeated cosmos.base.v1beta1.Coin timeout_fees = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; } // QueryPayeeRequest defines the request type for the Payee rpc message QueryPayeeRequest { // unique channel identifier - string channel_id = 1 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string channel_id = 1; // the relayer address to which the distribution address is registered string relayer = 2; } @@ -175,13 +170,13 @@ message QueryPayeeRequest { // QueryPayeeResponse defines the response type for the Payee rpc message QueryPayeeResponse { // the payee address to which packet fees are paid out - string payee_address = 1 [(gogoproto.moretags) = "yaml:\"payee_address\""]; + string payee_address = 1; } // QueryCounterpartyPayeeRequest defines the request type for the CounterpartyPayee rpc message QueryCounterpartyPayeeRequest { // unique channel identifier - string channel_id = 1 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string channel_id = 1; // the relayer address to which the counterparty is registered string relayer = 2; } @@ -189,7 +184,7 @@ message QueryCounterpartyPayeeRequest { // QueryCounterpartyPayeeResponse defines the response type for the CounterpartyPayee rpc message QueryCounterpartyPayeeResponse { // the counterparty payee address used to compensate forward relaying - string counterparty_payee = 1 [(gogoproto.moretags) = "yaml:\"counterparty_payee\""]; + string counterparty_payee = 1; } // QueryFeeEnabledChannelsRequest defines the request type for the FeeEnabledChannels rpc @@ -203,20 +198,21 @@ message QueryFeeEnabledChannelsRequest { // QueryFeeEnabledChannelsResponse defines the response type for the FeeEnabledChannels rpc message QueryFeeEnabledChannelsResponse { // list of fee enabled channels - repeated ibc.applications.fee.v1.FeeEnabledChannel fee_enabled_channels = 1 - [(gogoproto.moretags) = "yaml:\"fee_enabled_channels\"", (gogoproto.nullable) = false]; + repeated ibc.applications.fee.v1.FeeEnabledChannel fee_enabled_channels = 1 [(gogoproto.nullable) = false]; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; } // QueryFeeEnabledChannelRequest defines the request type for the FeeEnabledChannel rpc message QueryFeeEnabledChannelRequest { // unique port identifier - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + string port_id = 1; // unique channel identifier - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string channel_id = 2; } // QueryFeeEnabledChannelResponse defines the response type for the FeeEnabledChannel rpc message QueryFeeEnabledChannelResponse { // boolean flag representing the fee enabled channel status - bool fee_enabled = 1 [(gogoproto.moretags) = "yaml:\"fee_enabled\""]; + bool fee_enabled = 1; } diff --git a/proto/ibc/applications/fee/v1/tx.proto b/proto/ibc/applications/fee/v1/tx.proto index 8d6fca5..e59dddf 100644 --- a/proto/ibc/applications/fee/v1/tx.proto +++ b/proto/ibc/applications/fee/v1/tx.proto @@ -2,14 +2,18 @@ syntax = "proto3"; package ibc.applications.fee.v1; -option go_package = "github.com/cosmos/ibc-go/v4/modules/apps/29-fee/types"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"; +import "amino/amino.proto"; import "gogoproto/gogo.proto"; import "ibc/applications/fee/v1/fee.proto"; import "ibc/core/channel/v1/channel.proto"; +import "cosmos/msg/v1/msg.proto"; // Msg defines the ICS29 Msg service. service Msg { + option (cosmos.msg.v1.service) = true; + // RegisterPayee defines a rpc handler method for MsgRegisterPayee // RegisterPayee is called by the relayer on each channelEnd and allows them to set an optional // payee to which reverse and timeout relayer packet fees will be paid out. The payee should be registered on @@ -39,13 +43,15 @@ service Msg { // MsgRegisterPayee defines the request type for the RegisterPayee rpc message MsgRegisterPayee { - option (gogoproto.equal) = false; + option (amino.name) = "cosmos-sdk/MsgRegisterPayee"; + option (cosmos.msg.v1.signer) = "relayer"; + option (gogoproto.goproto_getters) = false; // unique port identifier - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + string port_id = 1; // unique channel identifier - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string channel_id = 2; // the relayer address string relayer = 3; // the payee address @@ -57,17 +63,19 @@ message MsgRegisterPayeeResponse {} // MsgRegisterCounterpartyPayee defines the request type for the RegisterCounterpartyPayee rpc message MsgRegisterCounterpartyPayee { - option (gogoproto.equal) = false; + option (amino.name) = "cosmos-sdk/MsgRegisterCounterpartyPayee"; + option (cosmos.msg.v1.signer) = "relayer"; + option (gogoproto.goproto_getters) = false; // unique port identifier - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + string port_id = 1; // unique channel identifier - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string channel_id = 2; // the relayer address string relayer = 3; // the counterparty payee address - string counterparty_payee = 4 [(gogoproto.moretags) = "yaml:\"counterparty_payee\""]; + string counterparty_payee = 4; } // MsgRegisterCounterpartyPayeeResponse defines the response type for the RegisterCounterpartyPayee rpc @@ -77,15 +85,17 @@ message MsgRegisterCounterpartyPayeeResponse {} // This Msg can be used to pay for a packet at the next sequence send & should be combined with the Msg that will be // paid for message MsgPayPacketFee { - option (gogoproto.equal) = false; + option (amino.name) = "cosmos-sdk/MsgPayPacketFee"; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; // fee encapsulates the recv, ack and timeout fees associated with an IBC packet - ibc.applications.fee.v1.Fee fee = 1 [(gogoproto.nullable) = false]; + ibc.applications.fee.v1.Fee fee = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // the source port unique identifier - string source_port_id = 2 [(gogoproto.moretags) = "yaml:\"source_port_id\""]; + string source_port_id = 2; // the source channel unique identifer - string source_channel_id = 3 [(gogoproto.moretags) = "yaml:\"source_channel_id\""]; + string source_channel_id = 3; // account address to refund fee if necessary string signer = 4; // optional list of relayers permitted to the receive packet fees @@ -98,14 +108,14 @@ message MsgPayPacketFeeResponse {} // MsgPayPacketFeeAsync defines the request type for the PayPacketFeeAsync rpc // This Msg can be used to pay for a packet at a specified sequence (instead of the next sequence send) message MsgPayPacketFeeAsync { - option (gogoproto.equal) = false; + option (amino.name) = "cosmos-sdk/MsgPayPacketFeeAsync"; + option (cosmos.msg.v1.signer) = "packet_fee"; option (gogoproto.goproto_getters) = false; // unique packet identifier comprised of the channel ID, port ID and sequence - ibc.core.channel.v1.PacketId packet_id = 1 - [(gogoproto.moretags) = "yaml:\"packet_id\"", (gogoproto.nullable) = false]; + ibc.core.channel.v1.PacketId packet_id = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // the packet fee associated with a particular IBC packet - PacketFee packet_fee = 2 [(gogoproto.moretags) = "yaml:\"packet_fee\"", (gogoproto.nullable) = false]; + PacketFee packet_fee = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // MsgPayPacketFeeAsyncResponse defines the response type for the PayPacketFeeAsync rpc diff --git a/proto/ibc/applications/interchain_accounts/controller/v1/controller.proto b/proto/ibc/applications/interchain_accounts/controller/v1/controller.proto index c7abd9f..2e6bbe1 100644 --- a/proto/ibc/applications/interchain_accounts/controller/v1/controller.proto +++ b/proto/ibc/applications/interchain_accounts/controller/v1/controller.proto @@ -2,13 +2,11 @@ syntax = "proto3"; package ibc.applications.interchain_accounts.controller.v1; -option go_package = "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/controller/types"; - -import "gogoproto/gogo.proto"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types"; // Params defines the set of on-chain interchain accounts parameters. // The following parameters may be used to disable the controller submodule. message Params { // controller_enabled enables or disables the controller submodule. - bool controller_enabled = 1 [(gogoproto.moretags) = "yaml:\"controller_enabled\""]; + bool controller_enabled = 1; } diff --git a/proto/ibc/applications/interchain_accounts/controller/v1/query.proto b/proto/ibc/applications/interchain_accounts/controller/v1/query.proto index 1f38efd..31885fc 100644 --- a/proto/ibc/applications/interchain_accounts/controller/v1/query.proto +++ b/proto/ibc/applications/interchain_accounts/controller/v1/query.proto @@ -2,10 +2,9 @@ syntax = "proto3"; package ibc.applications.interchain_accounts.controller.v1; -option go_package = "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/controller/types"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types"; import "ibc/applications/interchain_accounts/controller/v1/controller.proto"; -import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; // Query provides defines the gRPC querier service. @@ -25,7 +24,7 @@ service Query { // QueryInterchainAccountRequest is the request type for the Query/InterchainAccount RPC method. message QueryInterchainAccountRequest { string owner = 1; - string connection_id = 2 [(gogoproto.moretags) = "yaml:\"connection_id\""]; + string connection_id = 2; } // QueryInterchainAccountResponse the response type for the Query/InterchainAccount RPC method. diff --git a/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto b/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto new file mode 100644 index 0000000..ec5c2e6 --- /dev/null +++ b/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto @@ -0,0 +1,82 @@ +syntax = "proto3"; + +package ibc.applications.interchain_accounts.controller.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types"; + +import "gogoproto/gogo.proto"; +import "ibc/applications/interchain_accounts/v1/packet.proto"; +import "ibc/applications/interchain_accounts/controller/v1/controller.proto"; +import "cosmos/msg/v1/msg.proto"; +import "ibc/core/channel/v1/channel.proto"; + +// Msg defines the 27-interchain-accounts/controller Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // RegisterInterchainAccount defines a rpc handler for MsgRegisterInterchainAccount. + rpc RegisterInterchainAccount(MsgRegisterInterchainAccount) returns (MsgRegisterInterchainAccountResponse); + // SendTx defines a rpc handler for MsgSendTx. + rpc SendTx(MsgSendTx) returns (MsgSendTxResponse); + // UpdateParams defines a rpc handler for MsgUpdateParams. + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgRegisterInterchainAccount defines the payload for Msg/RegisterAccount +message MsgRegisterInterchainAccount { + option (cosmos.msg.v1.signer) = "owner"; + + option (gogoproto.goproto_getters) = false; + + string owner = 1; + string connection_id = 2; + string version = 3; + ibc.core.channel.v1.Order ordering = 4; +} + +// MsgRegisterInterchainAccountResponse defines the response for Msg/RegisterAccount +message MsgRegisterInterchainAccountResponse { + option (gogoproto.goproto_getters) = false; + + string channel_id = 1; + string port_id = 2; +} + +// MsgSendTx defines the payload for Msg/SendTx +message MsgSendTx { + option (cosmos.msg.v1.signer) = "owner"; + + option (gogoproto.goproto_getters) = false; + + string owner = 1; + string connection_id = 2; + ibc.applications.interchain_accounts.v1.InterchainAccountPacketData packet_data = 3 [(gogoproto.nullable) = false]; + // Relative timeout timestamp provided will be added to the current block time during transaction execution. + // The timeout timestamp must be non-zero. + uint64 relative_timeout = 4; +} + +// MsgSendTxResponse defines the response for MsgSendTx +message MsgSendTxResponse { + option (gogoproto.goproto_getters) = false; + + uint64 sequence = 1; +} + +// MsgUpdateParams defines the payload for Msg/UpdateParams +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + // signer address + string signer = 1; + + // params defines the 27-interchain-accounts/controller parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the response for Msg/UpdateParams +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/proto/ibc/applications/interchain_accounts/genesis/v1/genesis.proto b/proto/ibc/applications/interchain_accounts/genesis/v1/genesis.proto new file mode 100644 index 0000000..4393e5b --- /dev/null +++ b/proto/ibc/applications/interchain_accounts/genesis/v1/genesis.proto @@ -0,0 +1,47 @@ +syntax = "proto3"; + +package ibc.applications.interchain_accounts.genesis.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/genesis/types"; + +import "gogoproto/gogo.proto"; +import "ibc/applications/interchain_accounts/controller/v1/controller.proto"; +import "ibc/applications/interchain_accounts/host/v1/host.proto"; + +// GenesisState defines the interchain accounts genesis state +message GenesisState { + ControllerGenesisState controller_genesis_state = 1 [(gogoproto.nullable) = false]; + HostGenesisState host_genesis_state = 2 [(gogoproto.nullable) = false]; +} + +// ControllerGenesisState defines the interchain accounts controller genesis state +message ControllerGenesisState { + repeated ActiveChannel active_channels = 1 [(gogoproto.nullable) = false]; + repeated RegisteredInterchainAccount interchain_accounts = 2 [(gogoproto.nullable) = false]; + repeated string ports = 3; + ibc.applications.interchain_accounts.controller.v1.Params params = 4 [(gogoproto.nullable) = false]; +} + +// HostGenesisState defines the interchain accounts host genesis state +message HostGenesisState { + repeated ActiveChannel active_channels = 1 [(gogoproto.nullable) = false]; + repeated RegisteredInterchainAccount interchain_accounts = 2 [(gogoproto.nullable) = false]; + string port = 3; + ibc.applications.interchain_accounts.host.v1.Params params = 4 [(gogoproto.nullable) = false]; +} + +// ActiveChannel contains a connection ID, port ID and associated active channel ID, as well as a boolean flag to +// indicate if the channel is middleware enabled +message ActiveChannel { + string connection_id = 1; + string port_id = 2; + string channel_id = 3; + bool is_middleware_enabled = 4; +} + +// RegisteredInterchainAccount contains a connection ID, port ID and associated interchain account address +message RegisteredInterchainAccount { + string connection_id = 1; + string port_id = 2; + string account_address = 3; +} \ No newline at end of file diff --git a/proto/ibc/applications/interchain_accounts/host/v1/host.proto b/proto/ibc/applications/interchain_accounts/host/v1/host.proto index e73510e..9165f36 100644 --- a/proto/ibc/applications/interchain_accounts/host/v1/host.proto +++ b/proto/ibc/applications/interchain_accounts/host/v1/host.proto @@ -2,15 +2,24 @@ syntax = "proto3"; package ibc.applications.interchain_accounts.host.v1; -option go_package = "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/types"; - -import "gogoproto/gogo.proto"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types"; // Params defines the set of on-chain interchain accounts parameters. // The following parameters may be used to disable the host submodule. message Params { // host_enabled enables or disables the host submodule. - bool host_enabled = 1 [(gogoproto.moretags) = "yaml:\"host_enabled\""]; + bool host_enabled = 1; // allow_messages defines a list of sdk message typeURLs allowed to be executed on a host chain. - repeated string allow_messages = 2 [(gogoproto.moretags) = "yaml:\"allow_messages\""]; + repeated string allow_messages = 2; +} + +// QueryRequest defines the parameters for a particular query request +// by an interchain account. +message QueryRequest { + // path defines the path of the query request as defined by ADR-021. + // https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-021-protobuf-query-encoding.md#custom-query-registration-and-routing + string path = 1; + // data defines the payload of the query request as defined by ADR-021. + // https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-021-protobuf-query-encoding.md#custom-query-registration-and-routing + bytes data = 2; } diff --git a/proto/ibc/applications/interchain_accounts/host/v1/query.proto b/proto/ibc/applications/interchain_accounts/host/v1/query.proto index 02d17d3..6f206a1 100644 --- a/proto/ibc/applications/interchain_accounts/host/v1/query.proto +++ b/proto/ibc/applications/interchain_accounts/host/v1/query.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.applications.interchain_accounts.host.v1; -option go_package = "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/types"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types"; import "google/api/annotations.proto"; import "ibc/applications/interchain_accounts/host/v1/host.proto"; diff --git a/proto/ibc/applications/interchain_accounts/host/v1/tx.proto b/proto/ibc/applications/interchain_accounts/host/v1/tx.proto new file mode 100644 index 0000000..22e8c9b --- /dev/null +++ b/proto/ibc/applications/interchain_accounts/host/v1/tx.proto @@ -0,0 +1,60 @@ +syntax = "proto3"; + +package ibc.applications.interchain_accounts.host.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types"; + +import "gogoproto/gogo.proto"; +import "cosmos/msg/v1/msg.proto"; +import "ibc/applications/interchain_accounts/host/v1/host.proto"; + +// Msg defines the 27-interchain-accounts/host Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // UpdateParams defines a rpc handler for MsgUpdateParams. + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + + // ModuleQuerySafe defines a rpc handler for MsgModuleQuerySafe. + rpc ModuleQuerySafe(MsgModuleQuerySafe) returns (MsgModuleQuerySafeResponse); +} + +// MsgUpdateParams defines the payload for Msg/UpdateParams +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + // signer address + string signer = 1; + + // params defines the 27-interchain-accounts/host parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the response for Msg/UpdateParams +message MsgUpdateParamsResponse {} + +// MsgModuleQuerySafe defines the payload for Msg/ModuleQuerySafe +message MsgModuleQuerySafe { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + // signer address + string signer = 1; + + // requests defines the module safe queries to execute. + repeated QueryRequest requests = 2; +} + +// MsgModuleQuerySafeResponse defines the response for Msg/ModuleQuerySafe +message MsgModuleQuerySafeResponse { + // height at which the responses were queried + uint64 height = 1; + + // protobuf encoded responses for each query + repeated bytes responses = 2; +} diff --git a/proto/ibc/applications/interchain_accounts/v1/account.proto b/proto/ibc/applications/interchain_accounts/v1/account.proto index 2748b93..4a6947c 100644 --- a/proto/ibc/applications/interchain_accounts/v1/account.proto +++ b/proto/ibc/applications/interchain_accounts/v1/account.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.applications.interchain_accounts.v1; -option go_package = "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/types"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; @@ -12,9 +12,8 @@ import "cosmos/auth/v1beta1/auth.proto"; message InterchainAccount { option (gogoproto.goproto_getters) = false; option (gogoproto.goproto_stringer) = false; - option (cosmos_proto.implements_interface) = "InterchainAccountI"; + option (cosmos_proto.implements_interface) = "ibc.applications.interchain_accounts.v1.InterchainAccountI"; - cosmos.auth.v1beta1.BaseAccount base_account = 1 - [(gogoproto.embed) = true, (gogoproto.moretags) = "yaml:\"base_account\""]; - string account_owner = 2 [(gogoproto.moretags) = "yaml:\"account_owner\""]; + cosmos.auth.v1beta1.BaseAccount base_account = 1 [(gogoproto.embed) = true]; + string account_owner = 2; } diff --git a/proto/ibc/applications/interchain_accounts/v1/metadata.proto b/proto/ibc/applications/interchain_accounts/v1/metadata.proto index 6a4b4ab..df72b41 100644 --- a/proto/ibc/applications/interchain_accounts/v1/metadata.proto +++ b/proto/ibc/applications/interchain_accounts/v1/metadata.proto @@ -2,9 +2,7 @@ syntax = "proto3"; package ibc.applications.interchain_accounts.v1; -option go_package = "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/types"; - -import "gogoproto/gogo.proto"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types"; // Metadata defines a set of protocol specific data encoded into the ICS27 channel version bytestring // See ICS004: https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#Versioning @@ -12,9 +10,9 @@ message Metadata { // version defines the ICS27 protocol version string version = 1; // controller_connection_id is the connection identifier associated with the controller chain - string controller_connection_id = 2 [(gogoproto.moretags) = "yaml:\"controller_connection_id\""]; + string controller_connection_id = 2; // host_connection_id is the connection identifier associated with the host chain - string host_connection_id = 3 [(gogoproto.moretags) = "yaml:\"host_connection_id\""]; + string host_connection_id = 3; // address defines the interchain account address to be fulfilled upon the OnChanOpenTry handshake step // NOTE: the address field is empty on the OnChanOpenInit handshake step string address = 4; diff --git a/proto/ibc/applications/interchain_accounts/v1/packet.proto b/proto/ibc/applications/interchain_accounts/v1/packet.proto index 8e09a9d..f75a146 100644 --- a/proto/ibc/applications/interchain_accounts/v1/packet.proto +++ b/proto/ibc/applications/interchain_accounts/v1/packet.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.applications.interchain_accounts.v1; -option go_package = "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/types"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types"; import "google/protobuf/any.proto"; import "gogoproto/gogo.proto"; diff --git a/proto/ibc/applications/transfer/v1/authz.proto b/proto/ibc/applications/transfer/v1/authz.proto new file mode 100644 index 0000000..5c4b71d --- /dev/null +++ b/proto/ibc/applications/transfer/v1/authz.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; + +package ibc.applications.transfer.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +// Allocation defines the spend limit for a particular port and channel +message Allocation { + // the port on which the packet will be sent + string source_port = 1; + // the channel by which the packet will be sent + string source_channel = 2; + // spend limitation on the channel + repeated cosmos.base.v1beta1.Coin spend_limit = 3 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + // allow list of receivers, an empty allow list permits any receiver address + repeated string allow_list = 4; + // allow list of memo strings, an empty list prohibits all memo strings; + // a list only with "*" permits any memo string + repeated string allowed_packet_data = 5; +} + +// TransferAuthorization allows the grantee to spend up to spend_limit coins from +// the granter's account for ibc transfer on a specific channel +message TransferAuthorization { + option (cosmos_proto.implements_interface) = "cosmos.authz.v1beta1.Authorization"; + + // port and channel amounts + repeated Allocation allocations = 1 [(gogoproto.nullable) = false]; +} diff --git a/proto/ibc/applications/transfer/v1/genesis.proto b/proto/ibc/applications/transfer/v1/genesis.proto index 34672fd..f7d707f 100644 --- a/proto/ibc/applications/transfer/v1/genesis.proto +++ b/proto/ibc/applications/transfer/v1/genesis.proto @@ -2,18 +2,19 @@ syntax = "proto3"; package ibc.applications.transfer.v1; -option go_package = "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"; import "ibc/applications/transfer/v1/transfer.proto"; +import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; // GenesisState defines the ibc-transfer genesis state message GenesisState { - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - repeated DenomTrace denom_traces = 2 [ - (gogoproto.castrepeated) = "Traces", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"denom_traces\"" - ]; - Params params = 3 [(gogoproto.nullable) = false]; + string port_id = 1; + repeated DenomTrace denom_traces = 2 [(gogoproto.castrepeated) = "Traces", (gogoproto.nullable) = false]; + Params params = 3 [(gogoproto.nullable) = false]; + // total_escrowed contains the total amount of tokens escrowed + // by the transfer module + repeated cosmos.base.v1beta1.Coin total_escrowed = 4 + [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; } diff --git a/proto/ibc/applications/transfer/v1/query.proto b/proto/ibc/applications/transfer/v1/query.proto index 52f2f24..7882967 100644 --- a/proto/ibc/applications/transfer/v1/query.proto +++ b/proto/ibc/applications/transfer/v1/query.proto @@ -3,11 +3,12 @@ syntax = "proto3"; package ibc.applications.transfer.v1; import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; import "ibc/applications/transfer/v1/transfer.proto"; import "google/api/annotations.proto"; -option go_package = "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"; // Query provides defines the gRPC querier service. service Query { @@ -35,6 +36,11 @@ service Query { rpc EscrowAddress(QueryEscrowAddressRequest) returns (QueryEscrowAddressResponse) { option (google.api.http).get = "/ibc/apps/transfer/v1/channels/{channel_id}/ports/{port_id}/escrow_address"; } + + // TotalEscrowForDenom returns the total amount of tokens in escrow based on the denom. + rpc TotalEscrowForDenom(QueryTotalEscrowForDenomRequest) returns (QueryTotalEscrowForDenomResponse) { + option (google.api.http).get = "/ibc/apps/transfer/v1/denoms/{denom=**}/total_escrow"; + } } // QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC @@ -102,4 +108,14 @@ message QueryEscrowAddressRequest { message QueryEscrowAddressResponse { // the escrow account address string escrow_address = 1; -} \ No newline at end of file +} + +// QueryTotalEscrowForDenomRequest is the request type for TotalEscrowForDenom RPC method. +message QueryTotalEscrowForDenomRequest { + string denom = 1; +} + +// QueryTotalEscrowForDenomResponse is the response type for TotalEscrowForDenom RPC method. +message QueryTotalEscrowForDenomResponse { + cosmos.base.v1beta1.Coin amount = 1 [(gogoproto.nullable) = false]; +} diff --git a/proto/ibc/applications/transfer/v1/transfer.proto b/proto/ibc/applications/transfer/v1/transfer.proto index 1f92e81..7f77237 100644 --- a/proto/ibc/applications/transfer/v1/transfer.proto +++ b/proto/ibc/applications/transfer/v1/transfer.proto @@ -2,9 +2,7 @@ syntax = "proto3"; package ibc.applications.transfer.v1; -option go_package = "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"; - -import "gogoproto/gogo.proto"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"; // DenomTrace contains the base denomination for ICS20 fungible tokens and the // source tracing information path. @@ -23,8 +21,8 @@ message DenomTrace { message Params { // send_enabled enables or disables all cross-chain token transfers from this // chain. - bool send_enabled = 1 [(gogoproto.moretags) = "yaml:\"send_enabled\""]; + bool send_enabled = 1; // receive_enabled enables or disables all cross-chain token transfers to this // chain. - bool receive_enabled = 2 [(gogoproto.moretags) = "yaml:\"receive_enabled\""]; + bool receive_enabled = 2; } diff --git a/proto/ibc/applications/transfer/v1/tx.proto b/proto/ibc/applications/transfer/v1/tx.proto index 44e068d..42c70d3 100644 --- a/proto/ibc/applications/transfer/v1/tx.proto +++ b/proto/ibc/applications/transfer/v1/tx.proto @@ -2,48 +2,78 @@ syntax = "proto3"; package ibc.applications.transfer.v1; -option go_package = "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"; +import "amino/amino.proto"; import "gogoproto/gogo.proto"; +import "cosmos/msg/v1/msg.proto"; import "cosmos/base/v1beta1/coin.proto"; import "ibc/core/client/v1/client.proto"; +import "ibc/applications/transfer/v1/transfer.proto"; // Msg defines the ibc/transfer Msg service. service Msg { + option (cosmos.msg.v1.service) = true; + // Transfer defines a rpc handler method for MsgTransfer. rpc Transfer(MsgTransfer) returns (MsgTransferResponse); + + // UpdateParams defines a rpc handler for MsgUpdateParams. + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } // MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between // ICS20 enabled chains. See ICS Spec here: // https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures message MsgTransfer { - option (gogoproto.equal) = false; + option (amino.name) = "cosmos-sdk/MsgTransfer"; + option (cosmos.msg.v1.signer) = "sender"; + option (gogoproto.goproto_getters) = false; // the port on which the packet will be sent - string source_port = 1 [(gogoproto.moretags) = "yaml:\"source_port\""]; + string source_port = 1; // the channel by which the packet will be sent - string source_channel = 2 [(gogoproto.moretags) = "yaml:\"source_channel\""]; + string source_channel = 2; // the tokens to be transferred - cosmos.base.v1beta1.Coin token = 3 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.Coin token = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // the sender address string sender = 4; // the recipient address on the destination chain string receiver = 5; // Timeout height relative to the current block height. // The timeout is disabled when set to 0. - ibc.core.client.v1.Height timeout_height = 6 - [(gogoproto.moretags) = "yaml:\"timeout_height\"", (gogoproto.nullable) = false]; + ibc.core.client.v1.Height timeout_height = 6 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // Timeout timestamp in absolute nanoseconds since unix epoch. // The timeout is disabled when set to 0. - uint64 timeout_timestamp = 7 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; + uint64 timeout_timestamp = 7; // optional memo string memo = 8; } // MsgTransferResponse defines the Msg/Transfer response type. message MsgTransferResponse { + option (gogoproto.goproto_getters) = false; + // sequence number of the transfer packet sent uint64 sequence = 1; } + +// MsgUpdateParams is the Msg/UpdateParams request type. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + // signer address + string signer = 1; + + // params defines the transfer 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. +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/proto/ibc/applications/transfer/v2/packet.proto b/proto/ibc/applications/transfer/v2/packet.proto index 129815e..bff35bd 100644 --- a/proto/ibc/applications/transfer/v2/packet.proto +++ b/proto/ibc/applications/transfer/v2/packet.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.applications.transfer.v2; -option go_package = "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"; // FungibleTokenPacketData defines a struct for the packet payload // See FungibleTokenPacketData spec: diff --git a/proto/ibc/core/channel/v1/channel.proto b/proto/ibc/core/channel/v1/channel.proto index 646884d..05a18fe 100644 --- a/proto/ibc/core/channel/v1/channel.proto +++ b/proto/ibc/core/channel/v1/channel.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.channel.v1; -option go_package = "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"; import "gogoproto/gogo.proto"; import "ibc/core/client/v1/client.proto"; @@ -21,9 +21,12 @@ message Channel { Counterparty counterparty = 3 [(gogoproto.nullable) = false]; // list of connection identifiers, in order, along which packets sent on // this channel will travel - repeated string connection_hops = 4 [(gogoproto.moretags) = "yaml:\"connection_hops\""]; + repeated string connection_hops = 4; // opaque channel version, which is agreed upon during the handshake string version = 5; + // upgrade sequence indicates the latest upgrade attempt performed by this channel + // the value of 0 indicates the channel has never been upgraded + uint64 upgrade_sequence = 6; } // IdentifiedChannel defines a channel with additional port and channel @@ -39,17 +42,20 @@ message IdentifiedChannel { Counterparty counterparty = 3 [(gogoproto.nullable) = false]; // list of connection identifiers, in order, along which packets sent on // this channel will travel - repeated string connection_hops = 4 [(gogoproto.moretags) = "yaml:\"connection_hops\""]; + repeated string connection_hops = 4; // opaque channel version, which is agreed upon during the handshake string version = 5; // port identifier string port_id = 6; // channel identifier string channel_id = 7; + // upgrade sequence indicates the latest upgrade attempt performed by this channel + // the value of 0 indicates the channel has never been upgraded + uint64 upgrade_sequence = 8; } // State defines if a channel is in one of the following states: -// CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. +// CLOSED, INIT, TRYOPEN, OPEN, FLUSHING, FLUSHCOMPLETE or UNINITIALIZED. enum State { option (gogoproto.goproto_enum_prefix) = false; @@ -65,6 +71,10 @@ enum State { // A channel has been closed and can no longer be used to send or receive // packets. STATE_CLOSED = 4 [(gogoproto.enumvalue_customname) = "CLOSED"]; + // A channel has just accepted the upgrade handshake attempt and is flushing in-flight packets. + STATE_FLUSHING = 5 [(gogoproto.enumvalue_customname) = "FLUSHING"]; + // A channel has just completed flushing any in-flight packets. + STATE_FLUSHCOMPLETE = 6 [(gogoproto.enumvalue_customname) = "FLUSHCOMPLETE"]; } // Order defines if a channel is ORDERED or UNORDERED @@ -85,9 +95,9 @@ message Counterparty { option (gogoproto.goproto_getters) = false; // port on the counterparty chain which owns the other end of the channel. - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + string port_id = 1; // channel end on the counterparty chain - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string channel_id = 2; } // Packet defines a type that carries data across different chains through IBC @@ -99,20 +109,19 @@ message Packet { // with a later sequence number. uint64 sequence = 1; // identifies the port on the sending chain. - string source_port = 2 [(gogoproto.moretags) = "yaml:\"source_port\""]; + string source_port = 2; // identifies the channel end on the sending chain. - string source_channel = 3 [(gogoproto.moretags) = "yaml:\"source_channel\""]; + string source_channel = 3; // identifies the port on the receiving chain. - string destination_port = 4 [(gogoproto.moretags) = "yaml:\"destination_port\""]; + string destination_port = 4; // identifies the channel end on the receiving chain. - string destination_channel = 5 [(gogoproto.moretags) = "yaml:\"destination_channel\""]; + string destination_channel = 5; // actual opaque bytes transferred directly to the application module bytes data = 6; // block height after which the packet times out - ibc.core.client.v1.Height timeout_height = 7 - [(gogoproto.moretags) = "yaml:\"timeout_height\"", (gogoproto.nullable) = false]; + ibc.core.client.v1.Height timeout_height = 7 [(gogoproto.nullable) = false]; // block timestamp (in nanoseconds) after which the packet times out - uint64 timeout_timestamp = 8 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; + uint64 timeout_timestamp = 8; } // PacketState defines the generic type necessary to retrieve and store @@ -123,9 +132,9 @@ message PacketState { option (gogoproto.goproto_getters) = false; // channel port identifier. - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + string port_id = 1; // channel unique identifier. - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string channel_id = 2; // packet sequence. uint64 sequence = 3; // embedded data that represents packet state. @@ -139,9 +148,9 @@ message PacketId { option (gogoproto.goproto_getters) = false; // channel port identifier - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + string port_id = 1; // channel unique identifier - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string channel_id = 2; // packet sequence uint64 sequence = 3; } @@ -160,3 +169,19 @@ message Acknowledgement { string error = 22; } } + +// Timeout defines an execution deadline structure for 04-channel handlers. +// This includes packet lifecycle handlers as well as the upgrade handshake handlers. +// A valid Timeout contains either one or both of a timestamp and block height (sequence). +message Timeout { + // block height after which the packet or upgrade times out + ibc.core.client.v1.Height height = 1 [(gogoproto.nullable) = false]; + // block timestamp (in nanoseconds) after which the packet or upgrade times out + uint64 timestamp = 2; +} + +// Params defines the set of IBC channel parameters. +message Params { + // the relative timeout after which channel upgrades will time out. + Timeout upgrade_timeout = 1 [(gogoproto.nullable) = false]; +} diff --git a/proto/ibc/core/channel/v1/genesis.proto b/proto/ibc/core/channel/v1/genesis.proto index 1c0ff6e..665b2b1 100644 --- a/proto/ibc/core/channel/v1/genesis.proto +++ b/proto/ibc/core/channel/v1/genesis.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.channel.v1; -option go_package = "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"; import "gogoproto/gogo.proto"; import "ibc/core/channel/v1/channel.proto"; @@ -13,20 +13,18 @@ message GenesisState { repeated PacketState acknowledgements = 2 [(gogoproto.nullable) = false]; repeated PacketState commitments = 3 [(gogoproto.nullable) = false]; repeated PacketState receipts = 4 [(gogoproto.nullable) = false]; - repeated PacketSequence send_sequences = 5 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"send_sequences\""]; - repeated PacketSequence recv_sequences = 6 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"recv_sequences\""]; - repeated PacketSequence ack_sequences = 7 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"ack_sequences\""]; + repeated PacketSequence send_sequences = 5 [(gogoproto.nullable) = false]; + repeated PacketSequence recv_sequences = 6 [(gogoproto.nullable) = false]; + repeated PacketSequence ack_sequences = 7 [(gogoproto.nullable) = false]; // the sequence for the next generated channel identifier - uint64 next_channel_sequence = 8 [(gogoproto.moretags) = "yaml:\"next_channel_sequence\""]; + uint64 next_channel_sequence = 8; + Params params = 9 [(gogoproto.nullable) = false]; } // PacketSequence defines the genesis type necessary to retrieve and store // next send and receive sequences. message PacketSequence { - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string port_id = 1; + string channel_id = 2; uint64 sequence = 3; } diff --git a/proto/ibc/core/channel/v1/query.proto b/proto/ibc/core/channel/v1/query.proto index 9866331..f89d212 100644 --- a/proto/ibc/core/channel/v1/query.proto +++ b/proto/ibc/core/channel/v1/query.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.channel.v1; -option go_package = "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"; import "ibc/core/client/v1/client.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; @@ -10,6 +10,7 @@ import "ibc/core/channel/v1/channel.proto"; import "google/api/annotations.proto"; import "google/protobuf/any.proto"; import "gogoproto/gogo.proto"; +import "ibc/core/channel/v1/upgrade.proto"; // Query provides defines the gRPC querier service service Query { @@ -98,6 +99,29 @@ service Query { option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" "ports/{port_id}/next_sequence"; } + + // NextSequenceSend returns the next send sequence for a given channel. + rpc NextSequenceSend(QueryNextSequenceSendRequest) returns (QueryNextSequenceSendResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" + "ports/{port_id}/next_sequence_send"; + } + + // UpgradeError returns the error receipt if the upgrade handshake failed. + rpc UpgradeError(QueryUpgradeErrorRequest) returns (QueryUpgradeErrorResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" + "ports/{port_id}/upgrade_error"; + } + + // Upgrade returns the upgrade for a given port and channel id. + rpc Upgrade(QueryUpgradeRequest) returns (QueryUpgradeResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" + "ports/{port_id}/upgrade"; + } + + // ChannelParams queries all parameters of the ibc channel submodule. + rpc ChannelParams(QueryChannelParamsRequest) returns (QueryChannelParamsResponse) { + option (google.api.http).get = "/ibc/core/channel/v1/params"; + } } // QueryChannelRequest is the request type for the Query/Channel RPC method @@ -364,7 +388,7 @@ message QueryNextSequenceReceiveRequest { string channel_id = 2; } -// QuerySequenceResponse is the request type for the +// QuerySequenceResponse is the response type for the // Query/QueryNextSequenceReceiveResponse RPC method message QueryNextSequenceReceiveResponse { // next sequence receive number @@ -374,3 +398,62 @@ message QueryNextSequenceReceiveResponse { // height at which the proof was retrieved ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; } + +// QueryNextSequenceSendRequest is the request type for the +// Query/QueryNextSequenceSend RPC method +message QueryNextSequenceSendRequest { + // port unique identifier + string port_id = 1; + // channel unique identifier + string channel_id = 2; +} + +// QueryNextSequenceSendResponse is the request type for the +// Query/QueryNextSequenceSend RPC method +message QueryNextSequenceSendResponse { + // next sequence send number + uint64 next_sequence_send = 1; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} + +// QueryUpgradeErrorRequest is the request type for the Query/QueryUpgradeError RPC method +message QueryUpgradeErrorRequest { + string port_id = 1; + string channel_id = 2; +} + +// QueryUpgradeErrorResponse is the response type for the Query/QueryUpgradeError RPC method +message QueryUpgradeErrorResponse { + ErrorReceipt error_receipt = 1 [(gogoproto.nullable) = false]; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} + +// QueryUpgradeRequest is the request type for the QueryUpgradeRequest RPC method +message QueryUpgradeRequest { + string port_id = 1; + string channel_id = 2; +} + +// QueryUpgradeResponse is the response type for the QueryUpgradeResponse RPC method +message QueryUpgradeResponse { + Upgrade upgrade = 1 [(gogoproto.nullable) = false]; + // merkle proof of existence + bytes proof = 2; + // height at which the proof was retrieved + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; +} + +// QueryChannelParamsRequest is the request type for the Query/ChannelParams RPC method. +message QueryChannelParamsRequest {} + +// QueryChannelParamsResponse is the response type for the Query/ChannelParams RPC method. +message QueryChannelParamsResponse { + // params defines the parameters of the module. + Params params = 1; +} \ No newline at end of file diff --git a/proto/ibc/core/channel/v1/tx.proto b/proto/ibc/core/channel/v1/tx.proto index 75248ae..3f30e8b 100644 --- a/proto/ibc/core/channel/v1/tx.proto +++ b/proto/ibc/core/channel/v1/tx.proto @@ -2,14 +2,18 @@ syntax = "proto3"; package ibc.core.channel.v1; -option go_package = "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"; import "gogoproto/gogo.proto"; +import "cosmos/msg/v1/msg.proto"; import "ibc/core/client/v1/client.proto"; import "ibc/core/channel/v1/channel.proto"; +import "ibc/core/channel/v1/upgrade.proto"; // Msg defines the ibc/channel Msg service. service Msg { + option (cosmos.msg.v1.service) = true; + // ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. rpc ChannelOpenInit(MsgChannelOpenInit) returns (MsgChannelOpenInitResponse); @@ -40,6 +44,33 @@ service Msg { // Acknowledgement defines a rpc handler method for MsgAcknowledgement. rpc Acknowledgement(MsgAcknowledgement) returns (MsgAcknowledgementResponse); + + // ChannelUpgradeInit defines a rpc handler method for MsgChannelUpgradeInit. + rpc ChannelUpgradeInit(MsgChannelUpgradeInit) returns (MsgChannelUpgradeInitResponse); + + // ChannelUpgradeTry defines a rpc handler method for MsgChannelUpgradeTry. + rpc ChannelUpgradeTry(MsgChannelUpgradeTry) returns (MsgChannelUpgradeTryResponse); + + // ChannelUpgradeAck defines a rpc handler method for MsgChannelUpgradeAck. + rpc ChannelUpgradeAck(MsgChannelUpgradeAck) returns (MsgChannelUpgradeAckResponse); + + // ChannelUpgradeConfirm defines a rpc handler method for MsgChannelUpgradeConfirm. + rpc ChannelUpgradeConfirm(MsgChannelUpgradeConfirm) returns (MsgChannelUpgradeConfirmResponse); + + // ChannelUpgradeOpen defines a rpc handler method for MsgChannelUpgradeOpen. + rpc ChannelUpgradeOpen(MsgChannelUpgradeOpen) returns (MsgChannelUpgradeOpenResponse); + + // ChannelUpgradeTimeout defines a rpc handler method for MsgChannelUpgradeTimeout. + rpc ChannelUpgradeTimeout(MsgChannelUpgradeTimeout) returns (MsgChannelUpgradeTimeoutResponse); + + // ChannelUpgradeCancel defines a rpc handler method for MsgChannelUpgradeCancel. + rpc ChannelUpgradeCancel(MsgChannelUpgradeCancel) returns (MsgChannelUpgradeCancelResponse); + + // UpdateChannelParams defines a rpc handler method for MsgUpdateParams. + rpc UpdateChannelParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + + // PruneAcknowledgements defines a rpc handler method for MsgPruneAcknowledgements. + rpc PruneAcknowledgements(MsgPruneAcknowledgements) returns (MsgPruneAcknowledgementsResponse); } // ResponseResultType defines the possible outcomes of the execution of a message @@ -52,22 +83,27 @@ enum ResponseResultType { RESPONSE_RESULT_TYPE_NOOP = 1 [(gogoproto.enumvalue_customname) = "NOOP"]; // The message was executed successfully RESPONSE_RESULT_TYPE_SUCCESS = 2 [(gogoproto.enumvalue_customname) = "SUCCESS"]; + // The message was executed unsuccessfully + RESPONSE_RESULT_TYPE_FAILURE = 3 [(gogoproto.enumvalue_customname) = "FAILURE"]; } // MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It // is called by a relayer on Chain A. message MsgChannelOpenInit { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + string port_id = 1; Channel channel = 2 [(gogoproto.nullable) = false]; string signer = 3; } // MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. message MsgChannelOpenInitResponse { - string channel_id = 1 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + option (gogoproto.goproto_getters) = false; + + string channel_id = 1; string version = 2; } @@ -75,40 +111,46 @@ message MsgChannelOpenInitResponse { // on Chain B. The version field within the Channel field has been deprecated. Its // value will be ignored by core IBC. message MsgChannelOpenTry { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + string port_id = 1; // Deprecated: this field is unused. Crossing hello's are no longer supported in core IBC. - string previous_channel_id = 2 [deprecated = true, (gogoproto.moretags) = "yaml:\"previous_channel_id\""]; + string previous_channel_id = 2 [deprecated = true]; // NOTE: the version field within the channel has been deprecated. Its value will be ignored by core IBC. Channel channel = 3 [(gogoproto.nullable) = false]; - string counterparty_version = 4 [(gogoproto.moretags) = "yaml:\"counterparty_version\""]; - bytes proof_init = 5 [(gogoproto.moretags) = "yaml:\"proof_init\""]; - ibc.core.client.v1.Height proof_height = 6 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 7; + string counterparty_version = 4; + bytes proof_init = 5; + ibc.core.client.v1.Height proof_height = 6 [(gogoproto.nullable) = false]; + string signer = 7; } // MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. message MsgChannelOpenTryResponse { - string version = 1; + option (gogoproto.goproto_getters) = false; + + string version = 1; + string channel_id = 2; } // MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge // the change of channel state to TRYOPEN on Chain B. +// WARNING: a channel upgrade MUST NOT initialize an upgrade for this channel +// in the same block as executing this message otherwise the counterparty will +// be incapable of opening. message MsgChannelOpenAck { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - string counterparty_channel_id = 3 [(gogoproto.moretags) = "yaml:\"counterparty_channel_id\""]; - string counterparty_version = 4 [(gogoproto.moretags) = "yaml:\"counterparty_version\""]; - bytes proof_try = 5 [(gogoproto.moretags) = "yaml:\"proof_try\""]; - ibc.core.client.v1.Height proof_height = 6 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 7; + string port_id = 1; + string channel_id = 2; + string counterparty_channel_id = 3; + string counterparty_version = 4; + bytes proof_try = 5; + ibc.core.client.v1.Height proof_height = 6 [(gogoproto.nullable) = false]; + string signer = 7; } // MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. @@ -117,15 +159,15 @@ message MsgChannelOpenAckResponse {} // MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to // acknowledge the change of channel state to OPEN on Chain A. message MsgChannelOpenConfirm { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - bytes proof_ack = 3 [(gogoproto.moretags) = "yaml:\"proof_ack\""]; - ibc.core.client.v1.Height proof_height = 4 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 5; + string port_id = 1; + string channel_id = 2; + bytes proof_ack = 3; + ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false]; + string signer = 5; } // MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response @@ -135,11 +177,12 @@ message MsgChannelOpenConfirmResponse {} // MsgChannelCloseInit defines a msg sent by a Relayer to Chain A // to close a channel with Chain B. message MsgChannelCloseInit { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string port_id = 1; + string channel_id = 2; string signer = 3; } @@ -149,15 +192,16 @@ message MsgChannelCloseInitResponse {} // MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B // to acknowledge the change of channel state to CLOSED on Chain A. message MsgChannelCloseConfirm { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - bytes proof_init = 3 [(gogoproto.moretags) = "yaml:\"proof_init\""]; - ibc.core.client.v1.Height proof_height = 4 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 5; + string port_id = 1; + string channel_id = 2; + bytes proof_init = 3; + ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false]; + string signer = 5; + uint64 counterparty_upgrade_sequence = 6; } // MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response @@ -166,14 +210,14 @@ message MsgChannelCloseConfirmResponse {} // MsgRecvPacket receives incoming IBC packet message MsgRecvPacket { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; Packet packet = 1 [(gogoproto.nullable) = false]; - bytes proof_commitment = 2 [(gogoproto.moretags) = "yaml:\"proof_commitment\""]; - ibc.core.client.v1.Height proof_height = 3 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 4; + bytes proof_commitment = 2; + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; + string signer = 4; } // MsgRecvPacketResponse defines the Msg/RecvPacket response type. @@ -185,15 +229,15 @@ message MsgRecvPacketResponse { // MsgTimeout receives timed-out packet message MsgTimeout { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - Packet packet = 1 [(gogoproto.nullable) = false]; - bytes proof_unreceived = 2 [(gogoproto.moretags) = "yaml:\"proof_unreceived\""]; - ibc.core.client.v1.Height proof_height = 3 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - uint64 next_sequence_recv = 4 [(gogoproto.moretags) = "yaml:\"next_sequence_recv\""]; - string signer = 5; + Packet packet = 1 [(gogoproto.nullable) = false]; + bytes proof_unreceived = 2; + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; + uint64 next_sequence_recv = 4; + string signer = 5; } // MsgTimeoutResponse defines the Msg/Timeout response type. @@ -205,16 +249,17 @@ message MsgTimeoutResponse { // MsgTimeoutOnClose timed-out packet upon counterparty channel closure. message MsgTimeoutOnClose { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - Packet packet = 1 [(gogoproto.nullable) = false]; - bytes proof_unreceived = 2 [(gogoproto.moretags) = "yaml:\"proof_unreceived\""]; - bytes proof_close = 3 [(gogoproto.moretags) = "yaml:\"proof_close\""]; - ibc.core.client.v1.Height proof_height = 4 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - uint64 next_sequence_recv = 5 [(gogoproto.moretags) = "yaml:\"next_sequence_recv\""]; - string signer = 6; + Packet packet = 1 [(gogoproto.nullable) = false]; + bytes proof_unreceived = 2; + bytes proof_close = 3; + ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false]; + uint64 next_sequence_recv = 5; + string signer = 6; + uint64 counterparty_upgrade_sequence = 7; } // MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. @@ -226,15 +271,15 @@ message MsgTimeoutOnCloseResponse { // MsgAcknowledgement receives incoming IBC acknowledgement message MsgAcknowledgement { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; Packet packet = 1 [(gogoproto.nullable) = false]; bytes acknowledgement = 2; - bytes proof_acked = 3 [(gogoproto.moretags) = "yaml:\"proof_acked\""]; - ibc.core.client.v1.Height proof_height = 4 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 5; + bytes proof_acked = 3; + ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false]; + string signer = 5; } // MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. @@ -243,3 +288,182 @@ message MsgAcknowledgementResponse { ResponseResultType result = 1; } + +// MsgChannelUpgradeInit defines the request type for the ChannelUpgradeInit rpc +// WARNING: Initializing a channel upgrade in the same block as opening the channel +// may result in the counterparty being incapable of opening. +message MsgChannelUpgradeInit { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + string port_id = 1; + string channel_id = 2; + UpgradeFields fields = 3 [(gogoproto.nullable) = false]; + string signer = 4; +} + +// MsgChannelUpgradeInitResponse defines the MsgChannelUpgradeInit response type +message MsgChannelUpgradeInitResponse { + option (gogoproto.goproto_getters) = false; + + Upgrade upgrade = 1 [(gogoproto.nullable) = false]; + uint64 upgrade_sequence = 2; +} + +// MsgChannelUpgradeTry defines the request type for the ChannelUpgradeTry rpc +message MsgChannelUpgradeTry { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + string port_id = 1; + string channel_id = 2; + repeated string proposed_upgrade_connection_hops = 3; + UpgradeFields counterparty_upgrade_fields = 4 [(gogoproto.nullable) = false]; + uint64 counterparty_upgrade_sequence = 5; + bytes proof_channel = 6; + bytes proof_upgrade = 7; + ibc.core.client.v1.Height proof_height = 8 [(gogoproto.nullable) = false]; + string signer = 9; +} + +// MsgChannelUpgradeTryResponse defines the MsgChannelUpgradeTry response type +message MsgChannelUpgradeTryResponse { + option (gogoproto.goproto_getters) = false; + + Upgrade upgrade = 1 [(gogoproto.nullable) = false]; + uint64 upgrade_sequence = 2; + ResponseResultType result = 3; +} + +// MsgChannelUpgradeAck defines the request type for the ChannelUpgradeAck rpc +message MsgChannelUpgradeAck { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + string port_id = 1; + string channel_id = 2; + Upgrade counterparty_upgrade = 3 [(gogoproto.nullable) = false]; + bytes proof_channel = 4; + bytes proof_upgrade = 5; + ibc.core.client.v1.Height proof_height = 6 [(gogoproto.nullable) = false]; + string signer = 7; +} + +// MsgChannelUpgradeAckResponse defines MsgChannelUpgradeAck response type +message MsgChannelUpgradeAckResponse { + option (gogoproto.goproto_getters) = false; + + ResponseResultType result = 1; +} + +// MsgChannelUpgradeConfirm defines the request type for the ChannelUpgradeConfirm rpc +message MsgChannelUpgradeConfirm { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + string port_id = 1; + string channel_id = 2; + State counterparty_channel_state = 3; + Upgrade counterparty_upgrade = 4 [(gogoproto.nullable) = false]; + bytes proof_channel = 5; + bytes proof_upgrade = 6; + ibc.core.client.v1.Height proof_height = 7 [(gogoproto.nullable) = false]; + string signer = 8; +} + +// MsgChannelUpgradeConfirmResponse defines MsgChannelUpgradeConfirm response type +message MsgChannelUpgradeConfirmResponse { + option (gogoproto.goproto_getters) = false; + + ResponseResultType result = 1; +} + +// MsgChannelUpgradeOpen defines the request type for the ChannelUpgradeOpen rpc +message MsgChannelUpgradeOpen { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + string port_id = 1; + string channel_id = 2; + State counterparty_channel_state = 3; + uint64 counterparty_upgrade_sequence = 4; + bytes proof_channel = 5; + ibc.core.client.v1.Height proof_height = 6 [(gogoproto.nullable) = false]; + string signer = 7; +} + +// MsgChannelUpgradeOpenResponse defines the MsgChannelUpgradeOpen response type +message MsgChannelUpgradeOpenResponse {} + +// MsgChannelUpgradeTimeout defines the request type for the ChannelUpgradeTimeout rpc +message MsgChannelUpgradeTimeout { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + string port_id = 1; + string channel_id = 2; + Channel counterparty_channel = 3 [(gogoproto.nullable) = false]; + bytes proof_channel = 4; + ibc.core.client.v1.Height proof_height = 5 [(gogoproto.nullable) = false]; + string signer = 6; +} + +// MsgChannelUpgradeTimeoutRepsonse defines the MsgChannelUpgradeTimeout response type +message MsgChannelUpgradeTimeoutResponse {} + +// MsgChannelUpgradeCancel defines the request type for the ChannelUpgradeCancel rpc +message MsgChannelUpgradeCancel { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + string port_id = 1; + string channel_id = 2; + ErrorReceipt error_receipt = 3 [(gogoproto.nullable) = false]; + bytes proof_error_receipt = 4; + ibc.core.client.v1.Height proof_height = 5 [(gogoproto.nullable) = false]; + string signer = 6; +} + +// MsgChannelUpgradeCancelResponse defines the MsgChannelUpgradeCancel response type +message MsgChannelUpgradeCancelResponse {} + +// MsgUpdateParams is the MsgUpdateParams request type. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + option (gogoproto.goproto_getters) = false; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1; + + // params defines the channel parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the MsgUpdateParams response type. +message MsgUpdateParamsResponse {} + +// MsgPruneAcknowledgements defines the request type for the PruneAcknowledgements rpc. +message MsgPruneAcknowledgements { + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; + + string port_id = 1; + string channel_id = 2; + uint64 limit = 3; + string signer = 4; +} + +// MsgPruneAcknowledgementsResponse defines the response type for the PruneAcknowledgements rpc. +message MsgPruneAcknowledgementsResponse { + // Number of sequences pruned (includes both packet acknowledgements and packet receipts where appropriate). + uint64 total_pruned_sequences = 1; + // Number of sequences left after pruning. + uint64 total_remaining_sequences = 2; +} diff --git a/proto/ibc/core/channel/v1/upgrade.proto b/proto/ibc/core/channel/v1/upgrade.proto new file mode 100644 index 0000000..81530ed --- /dev/null +++ b/proto/ibc/core/channel/v1/upgrade.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; + +package ibc.core.channel.v1; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"; + +import "gogoproto/gogo.proto"; +import "ibc/core/channel/v1/channel.proto"; + +// Upgrade is a verifiable type which contains the relevant information +// for an attempted upgrade. It provides the proposed changes to the channel +// end, the timeout for this upgrade attempt and the next packet sequence +// which allows the counterparty to efficiently know the highest sequence it has received. +// The next sequence send is used for pruning and upgrading from unordered to ordered channels. +message Upgrade { + option (gogoproto.goproto_getters) = false; + + UpgradeFields fields = 1 [(gogoproto.nullable) = false]; + Timeout timeout = 2 [(gogoproto.nullable) = false]; + uint64 next_sequence_send = 3; +} + +// UpgradeFields are the fields in a channel end which may be changed +// during a channel upgrade. +message UpgradeFields { + option (gogoproto.goproto_getters) = false; + + Order ordering = 1; + repeated string connection_hops = 2; + string version = 3; +} + +// ErrorReceipt defines a type which encapsulates the upgrade sequence and error associated with the +// upgrade handshake failure. When a channel upgrade handshake is aborted both chains are expected to increment to the +// next sequence. +message ErrorReceipt { + option (gogoproto.goproto_getters) = false; + + // the channel upgrade sequence + uint64 sequence = 1; + // the error message detailing the cause of failure + string message = 2; +} diff --git a/proto/ibc/core/client/v1/client.proto b/proto/ibc/core/client/v1/client.proto index 2ec41ed..7a09e36 100644 --- a/proto/ibc/core/client/v1/client.proto +++ b/proto/ibc/core/client/v1/client.proto @@ -2,20 +2,20 @@ syntax = "proto3"; package ibc.core.client.v1; -option go_package = "github.com/cosmos/ibc-go/v4/modules/core/02-client/types"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; import "cosmos/upgrade/v1beta1/upgrade.proto"; import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; // IdentifiedClientState defines a client state with an additional client // identifier field. message IdentifiedClientState { // client identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + string client_id = 1; // client state - google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""]; + google.protobuf.Any client_state = 2; } // ConsensusStateWithHeight defines a consensus state with an additional height @@ -24,26 +24,58 @@ message ConsensusStateWithHeight { // consensus state height Height height = 1 [(gogoproto.nullable) = false]; // consensus state - google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; + google.protobuf.Any consensus_state = 2; } // ClientConsensusStates defines all the stored consensus states for a given // client. message ClientConsensusStates { // client identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + string client_id = 1; // consensus states and their heights associated with the client - repeated ConsensusStateWithHeight consensus_states = 2 - [(gogoproto.moretags) = "yaml:\"consensus_states\"", (gogoproto.nullable) = false]; + repeated ConsensusStateWithHeight consensus_states = 2 [(gogoproto.nullable) = false]; } -// ClientUpdateProposal is a governance proposal. If it passes, the substitute +// Height is a monotonically increasing data type +// that can be compared against another Height for the purposes of updating and +// freezing clients +// +// Normally the RevisionHeight is incremented at each height while keeping +// RevisionNumber the same. However some consensus algorithms may choose to +// reset the height in certain conditions e.g. hard forks, state-machine +// breaking changes In these cases, the RevisionNumber is incremented so that +// height continues to be monitonically increasing even as the RevisionHeight +// gets reset +message Height { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + // the revision that the client is currently on + uint64 revision_number = 1; + // the height within the given revision + uint64 revision_height = 2; +} + +// Params defines the set of IBC light client parameters. +message Params { + // allowed_clients defines the list of allowed client state types which can be created + // and interacted with. If a client type is removed from the allowed clients list, usage + // of this client will be disabled until it is added again to the list. + repeated string allowed_clients = 1; +} + +// ClientUpdateProposal is a legacy governance proposal. If it passes, the substitute // client's latest consensus state is copied over to the subject client. The proposal // handler may fail if the subject and the substitute do not match in client and // chain parameters (with exception to latest height, frozen height, and chain-id). +// +// Deprecated: Please use MsgRecoverClient in favour of this message type. message ClientUpdateProposal { - option (gogoproto.goproto_getters) = false; + option deprecated = true; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + option (gogoproto.goproto_getters) = false; + // the title of the update proposal string title = 1; // the description of the proposal @@ -57,11 +89,15 @@ message ClientUpdateProposal { // UpgradeProposal is a gov Content type for initiating an IBC breaking // upgrade. +// +// Deprecated: Please use MsgIBCSoftwareUpgrade in favour of this message type. message UpgradeProposal { + option deprecated = true; + + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; option (gogoproto.goproto_getters) = false; option (gogoproto.goproto_stringer) = false; option (gogoproto.equal) = true; - option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; string title = 1; string description = 2; @@ -75,29 +111,3 @@ message UpgradeProposal { // planned chain upgrades google.protobuf.Any upgraded_client_state = 4 [(gogoproto.moretags) = "yaml:\"upgraded_client_state\""]; } - -// Height is a monotonically increasing data type -// that can be compared against another Height for the purposes of updating and -// freezing clients -// -// Normally the RevisionHeight is incremented at each height while keeping -// RevisionNumber the same. However some consensus algorithms may choose to -// reset the height in certain conditions e.g. hard forks, state-machine -// breaking changes In these cases, the RevisionNumber is incremented so that -// height continues to be monitonically increasing even as the RevisionHeight -// gets reset -message Height { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - // the revision that the client is currently on - uint64 revision_number = 1 [(gogoproto.moretags) = "yaml:\"revision_number\""]; - // the height within the given revision - uint64 revision_height = 2 [(gogoproto.moretags) = "yaml:\"revision_height\""]; -} - -// Params defines the set of IBC light client parameters. -message Params { - // allowed_clients defines the list of allowed client state types. - repeated string allowed_clients = 1 [(gogoproto.moretags) = "yaml:\"allowed_clients\""]; -} diff --git a/proto/ibc/core/client/v1/genesis.proto b/proto/ibc/core/client/v1/genesis.proto index b2930c4..43610b0 100644 --- a/proto/ibc/core/client/v1/genesis.proto +++ b/proto/ibc/core/client/v1/genesis.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.client.v1; -option go_package = "github.com/cosmos/ibc-go/v4/modules/core/02-client/types"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"; import "ibc/core/client/v1/client.proto"; import "gogoproto/gogo.proto"; @@ -13,19 +13,16 @@ message GenesisState { repeated IdentifiedClientState clients = 1 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "IdentifiedClientStates"]; // consensus states from each client - repeated ClientConsensusStates clients_consensus = 2 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "ClientsConsensusStates", - (gogoproto.moretags) = "yaml:\"clients_consensus\"" - ]; + repeated ClientConsensusStates clients_consensus = 2 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "ClientsConsensusStates"]; // metadata from each client - repeated IdentifiedGenesisMetadata clients_metadata = 3 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"clients_metadata\""]; - Params params = 4 [(gogoproto.nullable) = false]; - // create localhost on initialization - bool create_localhost = 5 [(gogoproto.moretags) = "yaml:\"create_localhost\""]; + repeated IdentifiedGenesisMetadata clients_metadata = 3 [(gogoproto.nullable) = false]; + Params params = 4 [(gogoproto.nullable) = false]; + // Deprecated: create_localhost has been deprecated. + // The localhost client is automatically created at genesis. + bool create_localhost = 5 [deprecated = true]; // the sequence for the next generated client identifier - uint64 next_client_sequence = 6 [(gogoproto.moretags) = "yaml:\"next_client_sequence\""]; + uint64 next_client_sequence = 6; } // GenesisMetadata defines the genesis type for metadata that clients may return @@ -42,7 +39,6 @@ message GenesisMetadata { // IdentifiedGenesisMetadata has the client metadata with the corresponding // client id. message IdentifiedGenesisMetadata { - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - repeated GenesisMetadata client_metadata = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"client_metadata\""]; + string client_id = 1; + repeated GenesisMetadata client_metadata = 2 [(gogoproto.nullable) = false]; } diff --git a/proto/ibc/core/client/v1/query.proto b/proto/ibc/core/client/v1/query.proto index 2c9618b..10377d9 100644 --- a/proto/ibc/core/client/v1/query.proto +++ b/proto/ibc/core/client/v1/query.proto @@ -2,10 +2,12 @@ syntax = "proto3"; package ibc.core.client.v1; -option go_package = "github.com/cosmos/ibc-go/v4/modules/core/02-client/types"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"; import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos/query/v1/query.proto"; import "ibc/core/client/v1/client.proto"; +import "ibc/core/commitment/v1/commitment.proto"; import "google/protobuf/any.proto"; import "google/api/annotations.proto"; import "gogoproto/gogo.proto"; @@ -46,9 +48,9 @@ service Query { option (google.api.http).get = "/ibc/core/client/v1/client_status/{client_id}"; } - // ClientParams queries all parameters of the ibc client. + // ClientParams queries all parameters of the ibc client submodule. rpc ClientParams(QueryClientParamsRequest) returns (QueryClientParamsResponse) { - option (google.api.http).get = "/ibc/client/v1/params"; + option (google.api.http).get = "/ibc/core/client/v1/params"; } // UpgradedClientState queries an Upgraded IBC light client. @@ -60,6 +62,15 @@ service Query { rpc UpgradedConsensusState(QueryUpgradedConsensusStateRequest) returns (QueryUpgradedConsensusStateResponse) { option (google.api.http).get = "/ibc/core/client/v1/upgraded_consensus_states"; } + + // VerifyMembership queries an IBC light client for proof verification of a value at a given key path. + rpc VerifyMembership(QueryVerifyMembershipRequest) returns (QueryVerifyMembershipResponse) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http) = { + post: "/ibc/core/client/v1/verify_membership" + body: "*" + }; + } } // QueryClientStateRequest is the request type for the Query/ClientState RPC @@ -205,3 +216,27 @@ message QueryUpgradedConsensusStateResponse { // Consensus state associated with the request identifier google.protobuf.Any upgraded_consensus_state = 1; } + +// QueryVerifyMembershipRequest is the request type for the Query/VerifyMembership RPC method +message QueryVerifyMembershipRequest { + // client unique identifier. + string client_id = 1; + // the proof to be verified by the client. + bytes proof = 2; + // the height of the commitment root at which the proof is verified. + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; + // the commitment key path. + ibc.core.commitment.v1.MerklePath merkle_path = 4 [(gogoproto.nullable) = false]; + // the value which is proven. + bytes value = 5; + // optional time delay + uint64 time_delay = 6; + // optional block delay + uint64 block_delay = 7; +} + +// QueryVerifyMembershipResponse is the response type for the Query/VerifyMembership RPC method +message QueryVerifyMembershipResponse { + // boolean indicating success or failure of proof verification. + bool success = 1; +} \ No newline at end of file diff --git a/proto/ibc/core/client/v1/tx.proto b/proto/ibc/core/client/v1/tx.proto index 11dfdad..b504ab6 100644 --- a/proto/ibc/core/client/v1/tx.proto +++ b/proto/ibc/core/client/v1/tx.proto @@ -2,13 +2,18 @@ syntax = "proto3"; package ibc.core.client.v1; -option go_package = "github.com/cosmos/ibc-go/v4/modules/core/02-client/types"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos/upgrade/v1beta1/upgrade.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; +import "ibc/core/client/v1/client.proto"; // Msg defines the ibc/client Msg service. service Msg { + option (cosmos.msg.v1.service) = true; + // CreateClient defines a rpc handler method for MsgCreateClient. rpc CreateClient(MsgCreateClient) returns (MsgCreateClientResponse); @@ -20,18 +25,28 @@ service Msg { // SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. rpc SubmitMisbehaviour(MsgSubmitMisbehaviour) returns (MsgSubmitMisbehaviourResponse); + + // RecoverClient defines a rpc handler method for MsgRecoverClient. + rpc RecoverClient(MsgRecoverClient) returns (MsgRecoverClientResponse); + + // IBCSoftwareUpgrade defines a rpc handler method for MsgIBCSoftwareUpgrade. + rpc IBCSoftwareUpgrade(MsgIBCSoftwareUpgrade) returns (MsgIBCSoftwareUpgradeResponse); + + // UpdateClientParams defines a rpc handler method for MsgUpdateParams. + rpc UpdateClientParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } // MsgCreateClient defines a message to create an IBC client message MsgCreateClient { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; // light client state - google.protobuf.Any client_state = 1 [(gogoproto.moretags) = "yaml:\"client_state\""]; + google.protobuf.Any client_state = 1; // consensus state associated with the client that corresponds to a given // height. - google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; + google.protobuf.Any consensus_state = 2; // signer address string signer = 3; } @@ -40,15 +55,16 @@ message MsgCreateClient { message MsgCreateClientResponse {} // MsgUpdateClient defines an sdk.Msg to update a IBC client state using -// the given header. +// the given client message. message MsgUpdateClient { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; // client unique identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - // header to update the light client - google.protobuf.Any header = 2; + string client_id = 1; + // client message to update the light client + google.protobuf.Any client_message = 2; // signer address string signer = 3; } @@ -59,20 +75,21 @@ message MsgUpdateClientResponse {} // MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client // state message MsgUpgradeClient { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; // client unique identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + string client_id = 1; // upgraded client state - google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""]; + google.protobuf.Any client_state = 2; // upgraded consensus state, only contains enough information to serve as a // basis of trust in update logic - google.protobuf.Any consensus_state = 3 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; + google.protobuf.Any consensus_state = 3; // proof that old chain committed to new client - bytes proof_upgrade_client = 4 [(gogoproto.moretags) = "yaml:\"proof_upgrade_client\""]; + bytes proof_upgrade_client = 4; // proof that old chain committed to new consensus state - bytes proof_upgrade_consensus_state = 5 [(gogoproto.moretags) = "yaml:\"proof_upgrade_consensus_state\""]; + bytes proof_upgrade_consensus_state = 5; // signer address string signer = 6; } @@ -82,12 +99,15 @@ message MsgUpgradeClientResponse {} // MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for // light client misbehaviour. +// This message has been deprecated. Use MsgUpdateClient instead. message MsgSubmitMisbehaviour { - option (gogoproto.equal) = false; + option deprecated = true; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; // client unique identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + string client_id = 1; // misbehaviour used for freezing the light client google.protobuf.Any misbehaviour = 2; // signer address @@ -97,3 +117,59 @@ message MsgSubmitMisbehaviour { // MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response // type. message MsgSubmitMisbehaviourResponse {} + +// MsgRecoverClient defines the message used to recover a frozen or expired client. +message MsgRecoverClient { + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "signer"; + + // the client identifier for the client to be updated if the proposal passes + string subject_client_id = 1; + // the substitute client identifier for the client which will replace the subject + // client + string substitute_client_id = 2; + + // signer address + string signer = 3; +} + +// MsgRecoverClientResponse defines the Msg/RecoverClient response type. +message MsgRecoverClientResponse {} + +// MsgIBCSoftwareUpgrade defines the message used to schedule an upgrade of an IBC client using a v1 governance proposal +message MsgIBCSoftwareUpgrade { + option (cosmos.msg.v1.signer) = "signer"; + cosmos.upgrade.v1beta1.Plan plan = 1 [(gogoproto.nullable) = false]; + // An UpgradedClientState must be provided to perform an IBC breaking upgrade. + // This will make the chain commit to the correct upgraded (self) client state + // before the upgrade occurs, so that connecting chains can verify that the + // new upgraded client is valid by verifying a proof on the previous version + // of the chain. This will allow IBC connections to persist smoothly across + // planned chain upgrades. Correspondingly, the UpgradedClientState field has been + // deprecated in the Cosmos SDK to allow for this logic to exist solely in + // the 02-client module. + google.protobuf.Any upgraded_client_state = 2; + // signer address + string signer = 3; +} + +// MsgIBCSoftwareUpgradeResponse defines the Msg/IBCSoftwareUpgrade response type. +message MsgIBCSoftwareUpgradeResponse {} + +// MsgUpdateParams defines the sdk.Msg type to update the client parameters. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + // signer address + string signer = 1; + + // params defines the client parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the MsgUpdateParams response type. +message MsgUpdateParamsResponse {} diff --git a/proto/ibc/core/commitment/v1/commitment.proto b/proto/ibc/core/commitment/v1/commitment.proto index b6a68a9..b4753be 100644 --- a/proto/ibc/core/commitment/v1/commitment.proto +++ b/proto/ibc/core/commitment/v1/commitment.proto @@ -2,10 +2,10 @@ syntax = "proto3"; package ibc.core.commitment.v1; -option go_package = "github.com/cosmos/ibc-go/v4/modules/core/23-commitment/types"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/23-commitment/types"; import "gogoproto/gogo.proto"; -import "proofs.proto"; +import "cosmos/ics23/v1/proofs.proto"; // MerkleRoot defines a merkle root hash. // In the Cosmos SDK, the AppHash of a block header becomes the root. @@ -19,16 +19,14 @@ message MerkleRoot { // The constructed key from the Path and the key will be append(Path.KeyPath, // append(Path.KeyPrefix, key...)) message MerklePrefix { - bytes key_prefix = 1 [(gogoproto.moretags) = "yaml:\"key_prefix\""]; + bytes key_prefix = 1; } // MerklePath is the path used to verify commitment proofs, which can be an // arbitrary structured object (defined by a commitment type). // MerklePath is represented from root-to-leaf message MerklePath { - option (gogoproto.goproto_stringer) = false; - - repeated string key_path = 1 [(gogoproto.moretags) = "yaml:\"key_path\""]; + repeated string key_path = 1; } // MerkleProof is a wrapper type over a chain of CommitmentProofs. @@ -37,5 +35,5 @@ message MerklePath { // should be succinct. // MerkleProofs are ordered from leaf-to-root message MerkleProof { - repeated ics23.CommitmentProof proofs = 1; + repeated cosmos.ics23.v1.CommitmentProof proofs = 1; } diff --git a/proto/ibc/core/connection/v1/connection.proto b/proto/ibc/core/connection/v1/connection.proto index 8360af9..852f399 100644 --- a/proto/ibc/core/connection/v1/connection.proto +++ b/proto/ibc/core/connection/v1/connection.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.connection.v1; -option go_package = "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types"; import "gogoproto/gogo.proto"; import "ibc/core/commitment/v1/commitment.proto"; @@ -17,7 +17,7 @@ import "ibc/core/commitment/v1/commitment.proto"; message ConnectionEnd { option (gogoproto.goproto_getters) = false; // client associated with this connection. - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + string client_id = 1; // IBC version which can be utilised to determine encodings or protocols for // channels or packets utilising this connection. repeated Version versions = 2; @@ -28,7 +28,7 @@ message ConnectionEnd { // delay period that must pass before a consensus state can be used for // packet-verification NOTE: delay period logic is only implemented by some // clients. - uint64 delay_period = 5 [(gogoproto.moretags) = "yaml:\"delay_period\""]; + uint64 delay_period = 5; } // IdentifiedConnection defines a connection with additional connection @@ -36,9 +36,9 @@ message ConnectionEnd { message IdentifiedConnection { option (gogoproto.goproto_getters) = false; // connection identifier. - string id = 1 [(gogoproto.moretags) = "yaml:\"id\""]; + string id = 1; // client associated with this connection. - string client_id = 2 [(gogoproto.moretags) = "yaml:\"client_id\""]; + string client_id = 2; // IBC version which can be utilised to determine encodings or protocols for // channels or packets utilising this connection repeated Version versions = 3; @@ -47,7 +47,7 @@ message IdentifiedConnection { // counterparty chain associated with this connection. Counterparty counterparty = 5 [(gogoproto.nullable) = false]; // delay period associated with this connection. - uint64 delay_period = 6 [(gogoproto.moretags) = "yaml:\"delay_period\""]; + uint64 delay_period = 6; } // State defines if a connection is in one of the following states: @@ -72,10 +72,10 @@ message Counterparty { // identifies the client on the counterparty chain associated with a given // connection. - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + string client_id = 1; // identifies the connection end on the counterparty chain associated with a // given connection. - string connection_id = 2 [(gogoproto.moretags) = "yaml:\"connection_id\""]; + string connection_id = 2; // commitment merkle prefix of the counterparty chain. ibc.core.commitment.v1.MerklePrefix prefix = 3 [(gogoproto.nullable) = false]; } @@ -89,7 +89,7 @@ message ClientPaths { // ConnectionPaths define all the connection paths for a given client state. message ConnectionPaths { // client state unique identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + string client_id = 1; // list of connection paths repeated string paths = 2; } @@ -110,5 +110,5 @@ message Params { // maximum expected time per block (in nanoseconds), used to enforce block delay. This parameter should reflect the // largest amount of time that the chain might reasonably take to produce the next block under normal operating // conditions. A safe choice is 3-5x the expected time per block. - uint64 max_expected_time_per_block = 1 [(gogoproto.moretags) = "yaml:\"max_expected_time_per_block\""]; + uint64 max_expected_time_per_block = 1; } diff --git a/proto/ibc/core/connection/v1/genesis.proto b/proto/ibc/core/connection/v1/genesis.proto index f616ae6..a5eb6b3 100644 --- a/proto/ibc/core/connection/v1/genesis.proto +++ b/proto/ibc/core/connection/v1/genesis.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.connection.v1; -option go_package = "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types"; import "gogoproto/gogo.proto"; import "ibc/core/connection/v1/connection.proto"; @@ -10,9 +10,8 @@ import "ibc/core/connection/v1/connection.proto"; // GenesisState defines the ibc connection submodule's genesis state. message GenesisState { repeated IdentifiedConnection connections = 1 [(gogoproto.nullable) = false]; - repeated ConnectionPaths client_connection_paths = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"client_connection_paths\""]; + repeated ConnectionPaths client_connection_paths = 2 [(gogoproto.nullable) = false]; // the sequence for the next generated connection identifier - uint64 next_connection_sequence = 3 [(gogoproto.moretags) = "yaml:\"next_connection_sequence\""]; + uint64 next_connection_sequence = 3; Params params = 4 [(gogoproto.nullable) = false]; } diff --git a/proto/ibc/core/connection/v1/query.proto b/proto/ibc/core/connection/v1/query.proto index 129f30a..c0f1a6f 100644 --- a/proto/ibc/core/connection/v1/query.proto +++ b/proto/ibc/core/connection/v1/query.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.connection.v1; -option go_package = "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types"; import "gogoproto/gogo.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; @@ -41,6 +41,11 @@ service Query { option (google.api.http).get = "/ibc/core/connection/v1/connections/{connection_id}/consensus_state/" "revision/{revision_number}/height/{revision_height}"; } + + // ConnectionParams queries all parameters of the ibc connection submodule. + rpc ConnectionParams(QueryConnectionParamsRequest) returns (QueryConnectionParamsResponse) { + option (google.api.http).get = "/ibc/core/connection/v1/params"; + } } // QueryConnectionRequest is the request type for the Query/Connection RPC @@ -101,7 +106,7 @@ message QueryClientConnectionsResponse { // Query/ConnectionClientState RPC method message QueryConnectionClientStateRequest { // connection identifier - string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; + string connection_id = 1; } // QueryConnectionClientStateResponse is the response type for the @@ -119,7 +124,7 @@ message QueryConnectionClientStateResponse { // Query/ConnectionConsensusState RPC method message QueryConnectionConsensusStateRequest { // connection identifier - string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; + string connection_id = 1; uint64 revision_number = 2; uint64 revision_height = 3; } @@ -136,3 +141,12 @@ message QueryConnectionConsensusStateResponse { // height at which the proof was retrieved ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false]; } + +// QueryConnectionParamsRequest is the request type for the Query/ConnectionParams RPC method. +message QueryConnectionParamsRequest {} + +// QueryConnectionParamsResponse is the response type for the Query/ConnectionParams RPC method. +message QueryConnectionParamsResponse { + // params defines the parameters of the module. + Params params = 1; +} \ No newline at end of file diff --git a/proto/ibc/core/connection/v1/tx.proto b/proto/ibc/core/connection/v1/tx.proto index b2fea63..3ba8ff4 100644 --- a/proto/ibc/core/connection/v1/tx.proto +++ b/proto/ibc/core/connection/v1/tx.proto @@ -2,15 +2,18 @@ syntax = "proto3"; package ibc.core.connection.v1; -option go_package = "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types"; import "gogoproto/gogo.proto"; +import "cosmos/msg/v1/msg.proto"; import "google/protobuf/any.proto"; import "ibc/core/client/v1/client.proto"; import "ibc/core/connection/v1/connection.proto"; // Msg defines the ibc/connection Msg service. service Msg { + option (cosmos.msg.v1.service) = true; + // ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. rpc ConnectionOpenInit(MsgConnectionOpenInit) returns (MsgConnectionOpenInitResponse); @@ -23,18 +26,23 @@ service Msg { // ConnectionOpenConfirm defines a rpc handler method for // MsgConnectionOpenConfirm. rpc ConnectionOpenConfirm(MsgConnectionOpenConfirm) returns (MsgConnectionOpenConfirmResponse); + + // UpdateConnectionParams defines a rpc handler method for + // MsgUpdateParams. + rpc UpdateConnectionParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); } // MsgConnectionOpenInit defines the msg sent by an account on Chain A to // initialize a connection with Chain B. message MsgConnectionOpenInit { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + string client_id = 1; Counterparty counterparty = 2 [(gogoproto.nullable) = false]; Version version = 3; - uint64 delay_period = 4 [(gogoproto.moretags) = "yaml:\"delay_period\""]; + uint64 delay_period = 4; string signer = 5; } @@ -45,28 +53,29 @@ message MsgConnectionOpenInitResponse {} // MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a // connection on Chain B. message MsgConnectionOpenTry { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + string client_id = 1; // Deprecated: this field is unused. Crossing hellos are no longer supported in core IBC. - string previous_connection_id = 2 [deprecated = true, (gogoproto.moretags) = "yaml:\"previous_connection_id\""]; - google.protobuf.Any client_state = 3 [(gogoproto.moretags) = "yaml:\"client_state\""]; - Counterparty counterparty = 4 [(gogoproto.nullable) = false]; - uint64 delay_period = 5 [(gogoproto.moretags) = "yaml:\"delay_period\""]; - repeated Version counterparty_versions = 6 [(gogoproto.moretags) = "yaml:\"counterparty_versions\""]; - ibc.core.client.v1.Height proof_height = 7 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; + string previous_connection_id = 2 [deprecated = true]; + google.protobuf.Any client_state = 3; + Counterparty counterparty = 4 [(gogoproto.nullable) = false]; + uint64 delay_period = 5; + repeated Version counterparty_versions = 6; + ibc.core.client.v1.Height proof_height = 7 [(gogoproto.nullable) = false]; // proof of the initialization the connection on Chain A: `UNITIALIZED -> // INIT` - bytes proof_init = 8 [(gogoproto.moretags) = "yaml:\"proof_init\""]; + bytes proof_init = 8; // proof of client state included in message - bytes proof_client = 9 [(gogoproto.moretags) = "yaml:\"proof_client\""]; + bytes proof_client = 9; // proof of client consensus state - bytes proof_consensus = 10 [(gogoproto.moretags) = "yaml:\"proof_consensus\""]; - ibc.core.client.v1.Height consensus_height = 11 - [(gogoproto.moretags) = "yaml:\"consensus_height\"", (gogoproto.nullable) = false]; - string signer = 12; + bytes proof_consensus = 10; + ibc.core.client.v1.Height consensus_height = 11 [(gogoproto.nullable) = false]; + string signer = 12; + // optional proof data for host state machines that are unable to introspect their own consensus state + bytes host_consensus_state_proof = 13; } // MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. @@ -75,25 +84,26 @@ message MsgConnectionOpenTryResponse {} // MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to // acknowledge the change of connection state to TRYOPEN on Chain B. message MsgConnectionOpenAck { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; - string counterparty_connection_id = 2 [(gogoproto.moretags) = "yaml:\"counterparty_connection_id\""]; - Version version = 3; - google.protobuf.Any client_state = 4 [(gogoproto.moretags) = "yaml:\"client_state\""]; - ibc.core.client.v1.Height proof_height = 5 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; + string connection_id = 1; + string counterparty_connection_id = 2; + Version version = 3; + google.protobuf.Any client_state = 4; + ibc.core.client.v1.Height proof_height = 5 [(gogoproto.nullable) = false]; // proof of the initialization the connection on Chain B: `UNITIALIZED -> // TRYOPEN` - bytes proof_try = 6 [(gogoproto.moretags) = "yaml:\"proof_try\""]; + bytes proof_try = 6; // proof of client state included in message - bytes proof_client = 7 [(gogoproto.moretags) = "yaml:\"proof_client\""]; + bytes proof_client = 7; // proof of client consensus state - bytes proof_consensus = 8 [(gogoproto.moretags) = "yaml:\"proof_consensus\""]; - ibc.core.client.v1.Height consensus_height = 9 - [(gogoproto.moretags) = "yaml:\"consensus_height\"", (gogoproto.nullable) = false]; - string signer = 10; + bytes proof_consensus = 8; + ibc.core.client.v1.Height consensus_height = 9 [(gogoproto.nullable) = false]; + string signer = 10; + // optional proof data for host state machines that are unable to introspect their own consensus state + bytes host_consensus_state_proof = 11; } // MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. @@ -102,17 +112,35 @@ message MsgConnectionOpenAckResponse {} // MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to // acknowledge the change of connection state to OPEN on Chain A. message MsgConnectionOpenConfirm { - option (gogoproto.equal) = false; + option (cosmos.msg.v1.signer) = "signer"; + option (gogoproto.goproto_getters) = false; - string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; + string connection_id = 1; // proof for the change of the connection state on Chain A: `INIT -> OPEN` - bytes proof_ack = 2 [(gogoproto.moretags) = "yaml:\"proof_ack\""]; - ibc.core.client.v1.Height proof_height = 3 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 4; + bytes proof_ack = 2; + ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; + string signer = 4; } // MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm // response type. message MsgConnectionOpenConfirmResponse {} + +// MsgUpdateParams defines the sdk.Msg type to update the connection parameters. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "signer"; + + option (gogoproto.goproto_getters) = false; + + // signer address + string signer = 1; + + // params defines the connection parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the MsgUpdateParams response type. +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/proto/ibc/core/types/v1/genesis.proto b/proto/ibc/core/types/v1/genesis.proto index 4cc931d..4b34f68 100644 --- a/proto/ibc/core/types/v1/genesis.proto +++ b/proto/ibc/core/types/v1/genesis.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.core.types.v1; -option go_package = "github.com/cosmos/ibc-go/v4/modules/core/types"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/types"; import "gogoproto/gogo.proto"; import "ibc/core/client/v1/genesis.proto"; @@ -12,12 +12,9 @@ import "ibc/core/channel/v1/genesis.proto"; // GenesisState defines the ibc module's genesis state. message GenesisState { // ICS002 - Clients genesis state - ibc.core.client.v1.GenesisState client_genesis = 1 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"client_genesis\""]; + ibc.core.client.v1.GenesisState client_genesis = 1 [(gogoproto.nullable) = false]; // ICS003 - Connections genesis state - ibc.core.connection.v1.GenesisState connection_genesis = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"connection_genesis\""]; + ibc.core.connection.v1.GenesisState connection_genesis = 2 [(gogoproto.nullable) = false]; // ICS004 - Channel genesis state - ibc.core.channel.v1.GenesisState channel_genesis = 3 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"channel_genesis\""]; + ibc.core.channel.v1.GenesisState channel_genesis = 3 [(gogoproto.nullable) = false]; } diff --git a/proto/ibc/lightclients/localhost/v2/localhost.proto b/proto/ibc/lightclients/localhost/v2/localhost.proto new file mode 100644 index 0000000..635db85 --- /dev/null +++ b/proto/ibc/lightclients/localhost/v2/localhost.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; + +package ibc.lightclients.localhost.v2; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/light-clients/09-localhost;localhost"; + +import "ibc/core/client/v1/client.proto"; +import "gogoproto/gogo.proto"; + +// ClientState defines the 09-localhost client state +message ClientState { + option (gogoproto.goproto_getters) = false; + + // the latest block height + ibc.core.client.v1.Height latest_height = 1 [(gogoproto.nullable) = false]; +} diff --git a/proto/ibc/lightclients/solomachine/v2/solomachine.proto b/proto/ibc/lightclients/solomachine/v2/solomachine.proto index c735fdd..9dc2690 100644 --- a/proto/ibc/lightclients/solomachine/v2/solomachine.proto +++ b/proto/ibc/lightclients/solomachine/v2/solomachine.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package ibc.lightclients.solomachine.v2; -option go_package = "github.com/cosmos/ibc-go/v4/modules/light-clients/06-solomachine/types"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/core/02-client/migrations/v7"; import "ibc/core/connection/v1/connection.proto"; import "ibc/core/channel/v1/channel.proto"; @@ -16,11 +16,11 @@ message ClientState { // latest sequence of the client state uint64 sequence = 1; // frozen sequence of the solo machine - bool is_frozen = 2 [(gogoproto.moretags) = "yaml:\"is_frozen\""]; - ConsensusState consensus_state = 3 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; + bool is_frozen = 2; + ConsensusState consensus_state = 3; // when set to true, will allow governance to update a solo machine client. // The client will be unfrozen if it is frozen. - bool allow_update_after_proposal = 4 [(gogoproto.moretags) = "yaml:\"allow_update_after_proposal\""]; + bool allow_update_after_proposal = 4; } // ConsensusState defines a solo machine consensus state. The sequence of a @@ -29,7 +29,7 @@ message ClientState { message ConsensusState { option (gogoproto.goproto_getters) = false; // public key of the solo machine - google.protobuf.Any public_key = 1 [(gogoproto.moretags) = "yaml:\"public_key\""]; + google.protobuf.Any public_key = 1; // diversifier allows the same public key to be re-used across different solo // machine clients (potentially on different chains) without being considered // misbehaviour. @@ -44,18 +44,18 @@ message Header { uint64 sequence = 1; uint64 timestamp = 2; bytes signature = 3; - google.protobuf.Any new_public_key = 4 [(gogoproto.moretags) = "yaml:\"new_public_key\""]; - string new_diversifier = 5 [(gogoproto.moretags) = "yaml:\"new_diversifier\""]; + google.protobuf.Any new_public_key = 4; + string new_diversifier = 5; } // Misbehaviour defines misbehaviour for a solo machine which consists // of a sequence and two signatures over different messages at that sequence. message Misbehaviour { option (gogoproto.goproto_getters) = false; - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + string client_id = 1; uint64 sequence = 2; - SignatureAndData signature_one = 3 [(gogoproto.moretags) = "yaml:\"signature_one\""]; - SignatureAndData signature_two = 4 [(gogoproto.moretags) = "yaml:\"signature_two\""]; + SignatureAndData signature_one = 3; + SignatureAndData signature_two = 4; } // SignatureAndData contains a signature and the data signed over to create that @@ -63,7 +63,7 @@ message Misbehaviour { message SignatureAndData { option (gogoproto.goproto_getters) = false; bytes signature = 1; - DataType data_type = 2 [(gogoproto.moretags) = "yaml:\"data_type\""]; + DataType data_type = 2; bytes data = 3; uint64 timestamp = 4; } @@ -72,7 +72,7 @@ message SignatureAndData { // signature. message TimestampedSignatureData { option (gogoproto.goproto_getters) = false; - bytes signature_data = 1 [(gogoproto.moretags) = "yaml:\"signature_data\""]; + bytes signature_data = 1; uint64 timestamp = 2; } @@ -84,7 +84,7 @@ message SignBytes { uint64 timestamp = 2; string diversifier = 3; // type of the data used - DataType data_type = 4 [(gogoproto.moretags) = "yaml:\"data_type\""]; + DataType data_type = 4; // marshaled data bytes data = 5; } @@ -121,9 +121,9 @@ message HeaderData { option (gogoproto.goproto_getters) = false; // header public key - google.protobuf.Any new_pub_key = 1 [(gogoproto.moretags) = "yaml:\"new_pub_key\""]; + google.protobuf.Any new_pub_key = 1; // header diversifier - string new_diversifier = 2 [(gogoproto.moretags) = "yaml:\"new_diversifier\""]; + string new_diversifier = 2; } // ClientStateData returns the SignBytes data for client state verification. @@ -131,7 +131,7 @@ message ClientStateData { option (gogoproto.goproto_getters) = false; bytes path = 1; - google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""]; + google.protobuf.Any client_state = 2; } // ConsensusStateData returns the SignBytes data for consensus state @@ -140,7 +140,7 @@ message ConsensusStateData { option (gogoproto.goproto_getters) = false; bytes path = 1; - google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; + google.protobuf.Any consensus_state = 2; } // ConnectionStateData returns the SignBytes data for connection state @@ -185,5 +185,5 @@ message PacketReceiptAbsenceData { // sequence to be received. message NextSequenceRecvData { bytes path = 1; - uint64 next_seq_recv = 2 [(gogoproto.moretags) = "yaml:\"next_seq_recv\""]; + uint64 next_seq_recv = 2; } diff --git a/proto/ibc/lightclients/solomachine/v3/solomachine.proto b/proto/ibc/lightclients/solomachine/v3/solomachine.proto new file mode 100644 index 0000000..194905b --- /dev/null +++ b/proto/ibc/lightclients/solomachine/v3/solomachine.proto @@ -0,0 +1,99 @@ +syntax = "proto3"; + +package ibc.lightclients.solomachine.v3; + +option go_package = "github.com/cosmos/ibc-go/v8/modules/light-clients/06-solomachine;solomachine"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; + +// ClientState defines a solo machine client that tracks the current consensus +// state and if the client is frozen. +message ClientState { + option (gogoproto.goproto_getters) = false; + // latest sequence of the client state + uint64 sequence = 1; + // frozen sequence of the solo machine + bool is_frozen = 2; + ConsensusState consensus_state = 3; +} + +// ConsensusState defines a solo machine consensus state. The sequence of a +// consensus state is contained in the "height" key used in storing the +// consensus state. +message ConsensusState { + option (gogoproto.goproto_getters) = false; + // public key of the solo machine + google.protobuf.Any public_key = 1; + // diversifier allows the same public key to be re-used across different solo + // machine clients (potentially on different chains) without being considered + // misbehaviour. + string diversifier = 2; + uint64 timestamp = 3; +} + +// Header defines a solo machine consensus header +message Header { + option (gogoproto.goproto_getters) = false; + + uint64 timestamp = 1; + bytes signature = 2; + google.protobuf.Any new_public_key = 3; + string new_diversifier = 4; +} + +// Misbehaviour defines misbehaviour for a solo machine which consists +// of a sequence and two signatures over different messages at that sequence. +message Misbehaviour { + option (gogoproto.goproto_getters) = false; + + uint64 sequence = 1; + SignatureAndData signature_one = 2; + SignatureAndData signature_two = 3; +} + +// SignatureAndData contains a signature and the data signed over to create that +// signature. +message SignatureAndData { + option (gogoproto.goproto_getters) = false; + + bytes signature = 1; + bytes path = 2; + bytes data = 3; + uint64 timestamp = 4; +} + +// TimestampedSignatureData contains the signature data and the timestamp of the +// signature. +message TimestampedSignatureData { + option (gogoproto.goproto_getters) = false; + + bytes signature_data = 1; + uint64 timestamp = 2; +} + +// SignBytes defines the signed bytes used for signature verification. +message SignBytes { + option (gogoproto.goproto_getters) = false; + + // the sequence number + uint64 sequence = 1; + // the proof timestamp + uint64 timestamp = 2; + // the public key diversifier + string diversifier = 3; + // the standardised path bytes + bytes path = 4; + // the marshaled data bytes + bytes data = 5; +} + +// HeaderData returns the SignBytes data for update verification. +message HeaderData { + option (gogoproto.goproto_getters) = false; + + // header public key + google.protobuf.Any new_pub_key = 1; + // header diversifier + string new_diversifier = 2; +} diff --git a/proto/ibc/lightclients/tendermint/v1/tendermint.proto b/proto/ibc/lightclients/tendermint/v1/tendermint.proto index 55a4e06..5053612 100644 --- a/proto/ibc/lightclients/tendermint/v1/tendermint.proto +++ b/proto/ibc/lightclients/tendermint/v1/tendermint.proto @@ -2,11 +2,11 @@ syntax = "proto3"; package ibc.lightclients.tendermint.v1; -option go_package = "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types"; +option go_package = "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint;tendermint"; import "tendermint/types/validator.proto"; import "tendermint/types/types.proto"; -import "proofs.proto"; +import "cosmos/ics23/v1/proofs.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; import "ibc/core/client/v1/client.proto"; @@ -19,29 +19,21 @@ message ClientState { option (gogoproto.goproto_getters) = false; string chain_id = 1; - Fraction trust_level = 2 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"trust_level\""]; + Fraction trust_level = 2 [(gogoproto.nullable) = false]; // duration of the period since the LastestTimestamp during which the // submitted headers are valid for upgrade - google.protobuf.Duration trusting_period = 3 - [(gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.moretags) = "yaml:\"trusting_period\""]; + google.protobuf.Duration trusting_period = 3 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; // duration of the staking unbonding period - google.protobuf.Duration unbonding_period = 4 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.moretags) = "yaml:\"unbonding_period\"" - ]; + google.protobuf.Duration unbonding_period = 4 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; // defines how much new (untrusted) header's Time can drift into the future. - google.protobuf.Duration max_clock_drift = 5 - [(gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.moretags) = "yaml:\"max_clock_drift\""]; + google.protobuf.Duration max_clock_drift = 5 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; // Block height when the client was frozen due to a misbehaviour - ibc.core.client.v1.Height frozen_height = 6 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"frozen_height\""]; + ibc.core.client.v1.Height frozen_height = 6 [(gogoproto.nullable) = false]; // Latest height the client was updated to - ibc.core.client.v1.Height latest_height = 7 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"latest_height\""]; + ibc.core.client.v1.Height latest_height = 7 [(gogoproto.nullable) = false]; // Proof specifications used in verifying counterparty state - repeated ics23.ProofSpec proof_specs = 8 [(gogoproto.moretags) = "yaml:\"proof_specs\""]; + repeated cosmos.ics23.v1.ProofSpec proof_specs = 8; // Path at which next upgraded client will be committed. // Each element corresponds to the key for a single CommitmentProof in the @@ -50,13 +42,12 @@ message ClientState { // under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using // the default upgrade module, upgrade_path should be []string{"upgrade", // "upgradedIBCState"}` - repeated string upgrade_path = 9 [(gogoproto.moretags) = "yaml:\"upgrade_path\""]; + repeated string upgrade_path = 9; // allow_update_after_expiry is deprecated - bool allow_update_after_expiry = 10 [deprecated = true, (gogoproto.moretags) = "yaml:\"allow_update_after_expiry\""]; + bool allow_update_after_expiry = 10 [deprecated = true]; // allow_update_after_misbehaviour is deprecated - bool allow_update_after_misbehaviour = 11 - [deprecated = true, (gogoproto.moretags) = "yaml:\"allow_update_after_misbehaviour\""]; + bool allow_update_after_misbehaviour = 11 [deprecated = true]; } // ConsensusState defines the consensus state from Tendermint. @@ -67,11 +58,8 @@ message ConsensusState { // was stored. google.protobuf.Timestamp timestamp = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; // commitment root (i.e app hash) - ibc.core.commitment.v1.MerkleRoot root = 2 [(gogoproto.nullable) = false]; - bytes next_validators_hash = 3 [ - (gogoproto.casttype) = "github.com/tendermint/tendermint/libs/bytes.HexBytes", - (gogoproto.moretags) = "yaml:\"next_validators_hash\"" - ]; + ibc.core.commitment.v1.MerkleRoot root = 2 [(gogoproto.nullable) = false]; + bytes next_validators_hash = 3 [(gogoproto.casttype) = "github.com/cometbft/cometbft/libs/bytes.HexBytes"]; } // Misbehaviour is a wrapper over two conflicting Headers @@ -79,9 +67,10 @@ message ConsensusState { message Misbehaviour { option (gogoproto.goproto_getters) = false; - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - Header header_1 = 2 [(gogoproto.customname) = "Header1", (gogoproto.moretags) = "yaml:\"header_1\""]; - Header header_2 = 3 [(gogoproto.customname) = "Header2", (gogoproto.moretags) = "yaml:\"header_2\""]; + // ClientID is deprecated + string client_id = 1 [deprecated = true]; + Header header_1 = 2 [(gogoproto.customname) = "Header1"]; + Header header_2 = 3 [(gogoproto.customname) = "Header2"]; } // Header defines the Tendermint client consensus Header. @@ -97,13 +86,11 @@ message Misbehaviour { // hash to TrustedConsensusState.NextValidatorsHash since that is the last // trusted validator set at the TrustedHeight. message Header { - .tendermint.types.SignedHeader signed_header = 1 - [(gogoproto.embed) = true, (gogoproto.moretags) = "yaml:\"signed_header\""]; + .tendermint.types.SignedHeader signed_header = 1 [(gogoproto.embed) = true]; - .tendermint.types.ValidatorSet validator_set = 2 [(gogoproto.moretags) = "yaml:\"validator_set\""]; - ibc.core.client.v1.Height trusted_height = 3 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"trusted_height\""]; - .tendermint.types.ValidatorSet trusted_validators = 4 [(gogoproto.moretags) = "yaml:\"trusted_validators\""]; + .tendermint.types.ValidatorSet validator_set = 2; + ibc.core.client.v1.Height trusted_height = 3 [(gogoproto.nullable) = false]; + .tendermint.types.ValidatorSet trusted_validators = 4; } // Fraction defines the protobuf message type for tmmath.Fraction that only diff --git a/proto/ibc/lightclients/wasm/v1/genesis.proto b/proto/ibc/lightclients/wasm/v1/genesis.proto new file mode 100644 index 0000000..637ba16 --- /dev/null +++ b/proto/ibc/lightclients/wasm/v1/genesis.proto @@ -0,0 +1,20 @@ + +syntax = "proto3"; +package ibc.lightclients.wasm.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types"; + +// GenesisState defines 08-wasm's keeper genesis state +message GenesisState { + // uploaded light client wasm contracts + repeated Contract contracts = 1 [(gogoproto.nullable) = false]; +} + +// Contract stores contract code +message Contract { + option (gogoproto.goproto_getters) = false; + // contract byte code + bytes code_bytes = 1; +} \ No newline at end of file diff --git a/proto/ibc/lightclients/wasm/v1/query.proto b/proto/ibc/lightclients/wasm/v1/query.proto new file mode 100644 index 0000000..bbbed29 --- /dev/null +++ b/proto/ibc/lightclients/wasm/v1/query.proto @@ -0,0 +1,46 @@ +syntax = "proto3"; +package ibc.lightclients.wasm.v1; + +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; + +option go_package = "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types"; + +// Query service for wasm module +service Query { + // Get all Wasm checksums + rpc Checksums(QueryChecksumsRequest) returns (QueryChecksumsResponse) { + option (google.api.http).get = "/ibc/lightclients/wasm/v1/checksums"; + } + + // Get Wasm code for given checksum + rpc Code(QueryCodeRequest) returns (QueryCodeResponse) { + option (google.api.http).get = "/ibc/lightclients/wasm/v1/checksums/{checksum}/code"; + } +} + +// QueryChecksumsRequest is the request type for the Query/Checksums RPC method. +message QueryChecksumsRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryChecksumsResponse is the response type for the Query/Checksums RPC method. +message QueryChecksumsResponse { + // checksums is a list of the hex encoded checksums of all wasm codes stored. + repeated string checksums = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryCodeRequest is the request type for the Query/Code RPC method. +message QueryCodeRequest { + // checksum is a hex encoded string of the code stored. + string checksum = 1; +} + +// QueryCodeResponse is the response type for the Query/Code RPC method. +message QueryCodeResponse { + bytes data = 1; +} diff --git a/proto/ibc/lightclients/wasm/v1/tx.proto b/proto/ibc/lightclients/wasm/v1/tx.proto new file mode 100644 index 0000000..d2fc465 --- /dev/null +++ b/proto/ibc/lightclients/wasm/v1/tx.proto @@ -0,0 +1,66 @@ +syntax = "proto3"; +package ibc.lightclients.wasm.v1; + +option go_package = "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types"; + +import "cosmos/msg/v1/msg.proto"; + +// Msg defines the ibc/08-wasm Msg service. +service Msg { + option (cosmos.msg.v1.service) = true; + + // StoreCode defines a rpc handler method for MsgStoreCode. + rpc StoreCode(MsgStoreCode) returns (MsgStoreCodeResponse); + + // RemoveChecksum defines a rpc handler method for MsgRemoveChecksum. + rpc RemoveChecksum(MsgRemoveChecksum) returns (MsgRemoveChecksumResponse); + + // MigrateContract defines a rpc handler method for MsgMigrateContract. + rpc MigrateContract(MsgMigrateContract) returns (MsgMigrateContractResponse); +} + +// MsgStoreCode defines the request type for the StoreCode rpc. +message MsgStoreCode { + option (cosmos.msg.v1.signer) = "signer"; + + // signer address + string signer = 1; + // wasm byte code of light client contract. It can be raw or gzip compressed + bytes wasm_byte_code = 2; +} + +// MsgStoreCodeResponse defines the response type for the StoreCode rpc +message MsgStoreCodeResponse { + // checksum is the sha256 hash of the stored code + bytes checksum = 1; +} + +// MsgRemoveChecksum defines the request type for the MsgRemoveChecksum rpc. +message MsgRemoveChecksum { + option (cosmos.msg.v1.signer) = "signer"; + + // signer address + string signer = 1; + // checksum is the sha256 hash to be removed from the store + bytes checksum = 2; +} + +// MsgStoreChecksumResponse defines the response type for the StoreCode rpc +message MsgRemoveChecksumResponse {} + +// MsgMigrateContract defines the request type for the MigrateContract rpc. +message MsgMigrateContract { + option (cosmos.msg.v1.signer) = "signer"; + + // signer address + string signer = 1; + // the client id of the contract + string client_id = 2; + // checksum is the sha256 hash of the new wasm byte code for the contract + bytes checksum = 3; + // the json encoded message to be passed to the contract on migration + bytes msg = 4; +} + +// MsgMigrateContractResponse defines the response type for the MigrateContract rpc +message MsgMigrateContractResponse {} diff --git a/proto/ibc/lightclients/wasm/v1/wasm.proto b/proto/ibc/lightclients/wasm/v1/wasm.proto new file mode 100644 index 0000000..b6a45e3 --- /dev/null +++ b/proto/ibc/lightclients/wasm/v1/wasm.proto @@ -0,0 +1,43 @@ + +syntax = "proto3"; +package ibc.lightclients.wasm.v1; + +import "gogoproto/gogo.proto"; +import "ibc/core/client/v1/client.proto"; + +option go_package = "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types"; + +// Wasm light client's Client state +message ClientState { + option (gogoproto.goproto_getters) = false; + // bytes encoding the client state of the underlying light client + // implemented as a Wasm contract. + bytes data = 1; + bytes checksum = 2; + ibc.core.client.v1.Height latest_height = 3 [(gogoproto.nullable) = false]; +} + +// Wasm light client's ConsensusState +message ConsensusState { + option (gogoproto.goproto_getters) = false; + // bytes encoding the consensus state of the underlying light client + // implemented as a Wasm contract. + bytes data = 1; +} + +// Wasm light client message (either header(s) or misbehaviour) +message ClientMessage { + option (gogoproto.goproto_getters) = false; + + bytes data = 1; +} + +// Checksums defines a list of all checksums that are stored +// +// Deprecated: This message is deprecated in favor of storing the checksums +// using a Collections.KeySet. +message Checksums { + option deprecated = true; + + repeated bytes checksums = 1; +} \ No newline at end of file diff --git a/proto/proofs.proto b/proto/proofs.proto deleted file mode 100644 index da43503..0000000 --- a/proto/proofs.proto +++ /dev/null @@ -1,234 +0,0 @@ -syntax = "proto3"; - -package ics23; -option go_package = "github.com/confio/ics23/go"; - -enum HashOp { - // NO_HASH is the default if no data passed. Note this is an illegal argument some places. - NO_HASH = 0; - SHA256 = 1; - SHA512 = 2; - KECCAK = 3; - RIPEMD160 = 4; - BITCOIN = 5; // ripemd160(sha256(x)) -} - -/** -LengthOp defines how to process the key and value of the LeafOp -to include length information. After encoding the length with the given -algorithm, the length will be prepended to the key and value bytes. -(Each one with it's own encoded length) -*/ -enum LengthOp { - // NO_PREFIX don't include any length info - NO_PREFIX = 0; - // VAR_PROTO uses protobuf (and go-amino) varint encoding of the length - VAR_PROTO = 1; - // VAR_RLP uses rlp int encoding of the length - VAR_RLP = 2; - // FIXED32_BIG uses big-endian encoding of the length as a 32 bit integer - FIXED32_BIG = 3; - // FIXED32_LITTLE uses little-endian encoding of the length as a 32 bit integer - FIXED32_LITTLE = 4; - // FIXED64_BIG uses big-endian encoding of the length as a 64 bit integer - FIXED64_BIG = 5; - // FIXED64_LITTLE uses little-endian encoding of the length as a 64 bit integer - FIXED64_LITTLE = 6; - // REQUIRE_32_BYTES is like NONE, but will fail if the input is not exactly 32 bytes (sha256 output) - REQUIRE_32_BYTES = 7; - // REQUIRE_64_BYTES is like NONE, but will fail if the input is not exactly 64 bytes (sha512 output) - REQUIRE_64_BYTES = 8; -} - -/** -ExistenceProof takes a key and a value and a set of steps to perform on it. -The result of peforming all these steps will provide a "root hash", which can -be compared to the value in a header. - -Since it is computationally infeasible to produce a hash collission for any of the used -cryptographic hash functions, if someone can provide a series of operations to transform -a given key and value into a root hash that matches some trusted root, these key and values -must be in the referenced merkle tree. - -The only possible issue is maliablity in LeafOp, such as providing extra prefix data, -which should be controlled by a spec. Eg. with lengthOp as NONE, - prefix = FOO, key = BAR, value = CHOICE -and - prefix = F, key = OOBAR, value = CHOICE -would produce the same value. - -With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field -in the ProofSpec is valuable to prevent this mutability. And why all trees should -length-prefix the data before hashing it. -*/ -message ExistenceProof { - bytes key = 1; - bytes value = 2; - LeafOp leaf = 3; - repeated InnerOp path = 4; -} - -/* -NonExistenceProof takes a proof of two neighbors, one left of the desired key, -one right of the desired key. If both proofs are valid AND they are neighbors, -then there is no valid proof for the given key. -*/ -message NonExistenceProof { - bytes key = 1; // TODO: remove this as unnecessary??? we prove a range - ExistenceProof left = 2; - ExistenceProof right = 3; -} - -/* -CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages -*/ -message CommitmentProof { - oneof proof { - ExistenceProof exist = 1; - NonExistenceProof nonexist = 2; - BatchProof batch = 3; - CompressedBatchProof compressed = 4; - } -} - -/** -LeafOp represents the raw key-value data we wish to prove, and -must be flexible to represent the internal transformation from -the original key-value pairs into the basis hash, for many existing -merkle trees. - -key and value are passed in. So that the signature of this operation is: - leafOp(key, value) -> output - -To process this, first prehash the keys and values if needed (ANY means no hash in this case): - hkey = prehashKey(key) - hvalue = prehashValue(value) - -Then combine the bytes, and hash it - output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) -*/ -message LeafOp { - HashOp hash = 1; - HashOp prehash_key = 2; - HashOp prehash_value = 3; - LengthOp length = 4; - // prefix is a fixed bytes that may optionally be included at the beginning to differentiate - // a leaf node from an inner node. - bytes prefix = 5; -} - -/** -InnerOp represents a merkle-proof step that is not a leaf. -It represents concatenating two children and hashing them to provide the next result. - -The result of the previous step is passed in, so the signature of this op is: - innerOp(child) -> output - -The result of applying InnerOp should be: - output = op.hash(op.prefix || child || op.suffix) - - where the || operator is concatenation of binary data, -and child is the result of hashing all the tree below this step. - -Any special data, like prepending child with the length, or prepending the entire operation with -some value to differentiate from leaf nodes, should be included in prefix and suffix. -If either of prefix or suffix is empty, we just treat it as an empty string -*/ -message InnerOp { - HashOp hash = 1; - bytes prefix = 2; - bytes suffix = 3; -} - - -/** -ProofSpec defines what the expected parameters are for a given proof type. -This can be stored in the client and used to validate any incoming proofs. - - verify(ProofSpec, Proof) -> Proof | Error - -As demonstrated in tests, if we don't fix the algorithm used to calculate the -LeafHash for a given tree, there are many possible key-value pairs that can -generate a given hash (by interpretting the preimage differently). -We need this for proper security, requires client knows a priori what -tree format server uses. But not in code, rather a configuration object. -*/ -message ProofSpec { - // any field in the ExistenceProof must be the same as in this spec. - // except Prefix, which is just the first bytes of prefix (spec can be longer) - LeafOp leaf_spec = 1; - InnerSpec inner_spec = 2; - // max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) - int32 max_depth = 3; - // min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) - int32 min_depth = 4; -} - -/* -InnerSpec contains all store-specific structure info to determine if two proofs from a -given store are neighbors. - -This enables: - - isLeftMost(spec: InnerSpec, op: InnerOp) - isRightMost(spec: InnerSpec, op: InnerOp) - isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp) -*/ -message InnerSpec { - // Child order is the ordering of the children node, must count from 0 - // iavl tree is [0, 1] (left then right) - // merk is [0, 2, 1] (left, right, here) - repeated int32 child_order = 1; - int32 child_size = 2; - int32 min_prefix_length = 3; - int32 max_prefix_length = 4; - // empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0) - bytes empty_child = 5; - // hash is the algorithm that must be used for each InnerOp - HashOp hash = 6; -} - -/* -BatchProof is a group of multiple proof types than can be compressed -*/ -message BatchProof { - repeated BatchEntry entries = 1; -} - -// Use BatchEntry not CommitmentProof, to avoid recursion -message BatchEntry { - oneof proof { - ExistenceProof exist = 1; - NonExistenceProof nonexist = 2; - } -} - - -/****** all items here are compressed forms *******/ - -message CompressedBatchProof { - repeated CompressedBatchEntry entries = 1; - repeated InnerOp lookup_inners = 2; -} - -// Use BatchEntry not CommitmentProof, to avoid recursion -message CompressedBatchEntry { - oneof proof { - CompressedExistenceProof exist = 1; - CompressedNonExistenceProof nonexist = 2; - } -} - -message CompressedExistenceProof { - bytes key = 1; - bytes value = 2; - LeafOp leaf = 3; - // these are indexes into the lookup_inners table in CompressedBatchProof - repeated int32 path = 4; -} - -message CompressedNonExistenceProof { - bytes key = 1; // TODO: remove this as unnecessary??? we prove a range - CompressedExistenceProof left = 2; - CompressedExistenceProof right = 3; -} diff --git a/proto/tendermint/abci/types.proto b/proto/tendermint/abci/types.proto index 44f8611..78eecce 100644 --- a/proto/tendermint/abci/types.proto +++ b/proto/tendermint/abci/types.proto @@ -1,42 +1,62 @@ syntax = "proto3"; package tendermint.abci; -option go_package = "github.com/tendermint/tendermint/abci/types"; +option go_package = "github.com/cometbft/cometbft/abci/types"; // For more information on gogo.proto, see: -// https://github.com/gogo/protobuf/blob/master/extensions.md +// https://github.com/cosmos/gogoproto/blob/master/extensions.md import "tendermint/crypto/proof.proto"; -import "tendermint/types/types.proto"; import "tendermint/crypto/keys.proto"; import "tendermint/types/params.proto"; +import "tendermint/types/validator.proto"; import "google/protobuf/timestamp.proto"; import "gogoproto/gogo.proto"; -// This file is copied from http://github.com/tendermint/abci // NOTE: When using custom types, mind the warnings. -// https://github.com/gogo/protobuf/blob/master/custom_types.md#warnings-and-issues +// https://github.com/cosmos/gogoproto/blob/master/custom_types.md#warnings-and-issues + +service ABCI { + rpc Echo(RequestEcho) returns (ResponseEcho); + rpc Flush(RequestFlush) returns (ResponseFlush); + rpc Info(RequestInfo) returns (ResponseInfo); + rpc CheckTx(RequestCheckTx) returns (ResponseCheckTx); + rpc Query(RequestQuery) returns (ResponseQuery); + rpc Commit(RequestCommit) returns (ResponseCommit); + rpc InitChain(RequestInitChain) returns (ResponseInitChain); + rpc ListSnapshots(RequestListSnapshots) returns (ResponseListSnapshots); + rpc OfferSnapshot(RequestOfferSnapshot) returns (ResponseOfferSnapshot); + rpc LoadSnapshotChunk(RequestLoadSnapshotChunk) returns (ResponseLoadSnapshotChunk); + rpc ApplySnapshotChunk(RequestApplySnapshotChunk) returns (ResponseApplySnapshotChunk); + rpc PrepareProposal(RequestPrepareProposal) returns (ResponsePrepareProposal); + rpc ProcessProposal(RequestProcessProposal) returns (ResponseProcessProposal); + rpc ExtendVote(RequestExtendVote) returns (ResponseExtendVote); + rpc VerifyVoteExtension(RequestVerifyVoteExtension) returns (ResponseVerifyVoteExtension); + rpc FinalizeBlock(RequestFinalizeBlock) returns (ResponseFinalizeBlock); +} //---------------------------------------- // Request types message Request { oneof value { - RequestEcho echo = 1; - RequestFlush flush = 2; - RequestInfo info = 3; - RequestSetOption set_option = 4; - RequestInitChain init_chain = 5; - RequestQuery query = 6; - RequestBeginBlock begin_block = 7; - RequestCheckTx check_tx = 8; - RequestDeliverTx deliver_tx = 9; - RequestEndBlock end_block = 10; - RequestCommit commit = 11; - RequestListSnapshots list_snapshots = 12; - RequestOfferSnapshot offer_snapshot = 13; - RequestLoadSnapshotChunk load_snapshot_chunk = 14; - RequestApplySnapshotChunk apply_snapshot_chunk = 15; + RequestEcho echo = 1; + RequestFlush flush = 2; + RequestInfo info = 3; + RequestInitChain init_chain = 5; + RequestQuery query = 6; + RequestCheckTx check_tx = 8; + RequestCommit commit = 11; + RequestListSnapshots list_snapshots = 12; + RequestOfferSnapshot offer_snapshot = 13; + RequestLoadSnapshotChunk load_snapshot_chunk = 14; + RequestApplySnapshotChunk apply_snapshot_chunk = 15; + RequestPrepareProposal prepare_proposal = 16; + RequestProcessProposal process_proposal = 17; + RequestExtendVote extend_vote = 18; + RequestVerifyVoteExtension verify_vote_extension = 19; + RequestFinalizeBlock finalize_block = 20; } + reserved 4, 7, 9, 10; // SetOption, BeginBlock, DeliverTx, EndBlock } message RequestEcho { @@ -49,22 +69,16 @@ message RequestInfo { string version = 1; uint64 block_version = 2; uint64 p2p_version = 3; -} - -// nondeterministic -message RequestSetOption { - string key = 1; - string value = 2; + string abci_version = 4; } message RequestInitChain { - google.protobuf.Timestamp time = 1 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - string chain_id = 2; - ConsensusParams consensus_params = 3; - repeated ValidatorUpdate validators = 4 [(gogoproto.nullable) = false]; - bytes app_state_bytes = 5; - int64 initial_height = 6; + google.protobuf.Timestamp time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + string chain_id = 2; + tendermint.types.ConsensusParams consensus_params = 3; + repeated ValidatorUpdate validators = 4 [(gogoproto.nullable) = false]; + bytes app_state_bytes = 5; + int64 initial_height = 6; } message RequestQuery { @@ -74,13 +88,6 @@ message RequestQuery { bool prove = 4; } -message RequestBeginBlock { - bytes hash = 1; - tendermint.types.Header header = 2 [(gogoproto.nullable) = false]; - LastCommitInfo last_commit_info = 3 [(gogoproto.nullable) = false]; - repeated Evidence byzantine_validators = 4 [(gogoproto.nullable) = false]; -} - enum CheckTxType { NEW = 0 [(gogoproto.enumvalue_customname) = "New"]; RECHECK = 1 [(gogoproto.enumvalue_customname) = "Recheck"]; @@ -91,14 +98,6 @@ message RequestCheckTx { CheckTxType type = 2; } -message RequestDeliverTx { - bytes tx = 1; -} - -message RequestEndBlock { - int64 height = 1; -} - message RequestCommit {} // lists available snapshots @@ -106,8 +105,8 @@ message RequestListSnapshots {} // offers a snapshot to the application message RequestOfferSnapshot { - Snapshot snapshot = 1; // snapshot offered by peers - bytes app_hash = 2; // light client-verified app hash for snapshot height + Snapshot snapshot = 1; // snapshot offered by peers + bytes app_hash = 2; // light client-verified app hash for snapshot height } // loads a snapshot chunk @@ -124,28 +123,97 @@ message RequestApplySnapshotChunk { string sender = 3; } +message RequestPrepareProposal { + // the modified transactions cannot exceed this size. + int64 max_tx_bytes = 1; + // txs is an array of transactions that will be included in a block, + // sent to the app for possible modifications. + repeated bytes txs = 2; + ExtendedCommitInfo local_last_commit = 3 [(gogoproto.nullable) = false]; + repeated Misbehavior misbehavior = 4 [(gogoproto.nullable) = false]; + int64 height = 5; + google.protobuf.Timestamp time = 6 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes next_validators_hash = 7; + // address of the public key of the validator proposing the block. + bytes proposer_address = 8; +} + +message RequestProcessProposal { + repeated bytes txs = 1; + CommitInfo proposed_last_commit = 2 [(gogoproto.nullable) = false]; + repeated Misbehavior misbehavior = 3 [(gogoproto.nullable) = false]; + // hash is the merkle root hash of the fields of the proposed block. + bytes hash = 4; + int64 height = 5; + google.protobuf.Timestamp time = 6 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes next_validators_hash = 7; + // address of the public key of the original proposer of the block. + bytes proposer_address = 8; +} + +// Extends a vote with application-injected data +message RequestExtendVote { + // the hash of the block that this vote may be referring to + bytes hash = 1; + // the height of the extended vote + int64 height = 2; + // info of the block that this vote may be referring to + google.protobuf.Timestamp time = 3 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + repeated bytes txs = 4; + CommitInfo proposed_last_commit = 5 [(gogoproto.nullable) = false]; + repeated Misbehavior misbehavior = 6 [(gogoproto.nullable) = false]; + bytes next_validators_hash = 7; + // address of the public key of the original proposer of the block. + bytes proposer_address = 8; +} + +// Verify the vote extension +message RequestVerifyVoteExtension { + // the hash of the block that this received vote corresponds to + bytes hash = 1; + // the validator that signed the vote extension + bytes validator_address = 2; + int64 height = 3; + bytes vote_extension = 4; +} + +message RequestFinalizeBlock { + repeated bytes txs = 1; + CommitInfo decided_last_commit = 2 [(gogoproto.nullable) = false]; + repeated Misbehavior misbehavior = 3 [(gogoproto.nullable) = false]; + // hash is the merkle root hash of the fields of the decided block. + bytes hash = 4; + int64 height = 5; + google.protobuf.Timestamp time = 6 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes next_validators_hash = 7; + // proposer_address is the address of the public key of the original proposer of the block. + bytes proposer_address = 8; +} + //---------------------------------------- // Response types message Response { oneof value { - ResponseException exception = 1; - ResponseEcho echo = 2; - ResponseFlush flush = 3; - ResponseInfo info = 4; - ResponseSetOption set_option = 5; - ResponseInitChain init_chain = 6; - ResponseQuery query = 7; - ResponseBeginBlock begin_block = 8; - ResponseCheckTx check_tx = 9; - ResponseDeliverTx deliver_tx = 10; - ResponseEndBlock end_block = 11; - ResponseCommit commit = 12; - ResponseListSnapshots list_snapshots = 13; - ResponseOfferSnapshot offer_snapshot = 14; - ResponseLoadSnapshotChunk load_snapshot_chunk = 15; - ResponseApplySnapshotChunk apply_snapshot_chunk = 16; + ResponseException exception = 1; + ResponseEcho echo = 2; + ResponseFlush flush = 3; + ResponseInfo info = 4; + ResponseInitChain init_chain = 6; + ResponseQuery query = 7; + ResponseCheckTx check_tx = 9; + ResponseCommit commit = 12; + ResponseListSnapshots list_snapshots = 13; + ResponseOfferSnapshot offer_snapshot = 14; + ResponseLoadSnapshotChunk load_snapshot_chunk = 15; + ResponseApplySnapshotChunk apply_snapshot_chunk = 16; + ResponsePrepareProposal prepare_proposal = 17; + ResponseProcessProposal process_proposal = 18; + ResponseExtendVote extend_vote = 19; + ResponseVerifyVoteExtension verify_vote_extension = 20; + ResponseFinalizeBlock finalize_block = 21; } + reserved 5, 8, 10, 11; // SetOption, BeginBlock, DeliverTx, EndBlock } // nondeterministic @@ -169,25 +237,17 @@ message ResponseInfo { bytes last_block_app_hash = 5; } -// nondeterministic -message ResponseSetOption { - uint32 code = 1; - // bytes data = 2; - string log = 3; - string info = 4; -} - message ResponseInitChain { - ConsensusParams consensus_params = 1; - repeated ValidatorUpdate validators = 2 [(gogoproto.nullable) = false]; - bytes app_hash = 3; + tendermint.types.ConsensusParams consensus_params = 1; + repeated ValidatorUpdate validators = 2 [(gogoproto.nullable) = false]; + bytes app_hash = 3; } message ResponseQuery { uint32 code = 1; // bytes data = 2; // use "value" instead. - string log = 3; // nondeterministic - string info = 4; // nondeterministic + string log = 3; // nondeterministic + string info = 4; // nondeterministic int64 index = 5; bytes key = 6; bytes value = 7; @@ -196,53 +256,24 @@ message ResponseQuery { string codespace = 10; } -message ResponseBeginBlock { - repeated Event events = 1 - [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; -} - message ResponseCheckTx { uint32 code = 1; bytes data = 2; - string log = 3; // nondeterministic - string info = 4; // nondeterministic + string log = 3; // nondeterministic + string info = 4; // nondeterministic int64 gas_wanted = 5 [json_name = "gas_wanted"]; int64 gas_used = 6 [json_name = "gas_used"]; - repeated Event events = 7 - [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; - string codespace = 8; - string sender = 9; - int64 priority = 10; + repeated Event events = 7 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; + string codespace = 8; - // mempool_error is set by CometBFT. - // ABCI applictions creating a ResponseCheckTX should not set mempool_error. - string mempool_error = 11; -} - -message ResponseDeliverTx { - uint32 code = 1; - bytes data = 2; - string log = 3; // nondeterministic - string info = 4; // nondeterministic - int64 gas_wanted = 5 [json_name = "gas_wanted"]; - int64 gas_used = 6 [json_name = "gas_used"]; - repeated Event events = 7 [ - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "events,omitempty" - ]; // nondeterministic - string codespace = 8; -} - -message ResponseEndBlock { - repeated ValidatorUpdate validator_updates = 1 [(gogoproto.nullable) = false]; - ConsensusParams consensus_param_updates = 2; - repeated Event events = 3 - [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; + // These reserved fields were used until v0.37 by the priority mempool (now + // removed). + reserved 9 to 11; + reserved "sender", "priority", "mempool_error"; } message ResponseCommit { - // reserve 1 - bytes data = 2; + reserved 1, 2; // data was previously returned here int64 retain_height = 3; } @@ -254,12 +285,12 @@ message ResponseOfferSnapshot { Result result = 1; enum Result { - UNKNOWN = 0; // Unknown result, abort all snapshot restoration - ACCEPT = 1; // Snapshot accepted, apply chunks - ABORT = 2; // Abort all snapshot restoration - REJECT = 3; // Reject this specific snapshot, try others - REJECT_FORMAT = 4; // Reject all snapshots of this format, try others - REJECT_SENDER = 5; // Reject all snapshots from the sender(s), try others + UNKNOWN = 0; // Unknown result, abort all snapshot restoration + ACCEPT = 1; // Snapshot accepted, apply chunks + ABORT = 2; // Abort all snapshot restoration + REJECT = 3; // Reject this specific snapshot, try others + REJECT_FORMAT = 4; // Reject all snapshots of this format, try others + REJECT_SENDER = 5; // Reject all snapshots from the sender(s), try others } } @@ -269,109 +300,174 @@ message ResponseLoadSnapshotChunk { message ResponseApplySnapshotChunk { Result result = 1; - repeated uint32 refetch_chunks = 2; // Chunks to refetch and reapply - repeated string reject_senders = 3; // Chunk senders to reject and ban + repeated uint32 refetch_chunks = 2; // Chunks to refetch and reapply + repeated string reject_senders = 3; // Chunk senders to reject and ban enum Result { - UNKNOWN = 0; // Unknown result, abort all snapshot restoration - ACCEPT = 1; // Chunk successfully accepted - ABORT = 2; // Abort all snapshot restoration - RETRY = 3; // Retry chunk (combine with refetch and reject) - RETRY_SNAPSHOT = 4; // Retry snapshot (combine with refetch and reject) - REJECT_SNAPSHOT = 5; // Reject this snapshot, try others + UNKNOWN = 0; // Unknown result, abort all snapshot restoration + ACCEPT = 1; // Chunk successfully accepted + ABORT = 2; // Abort all snapshot restoration + RETRY = 3; // Retry chunk (combine with refetch and reject) + RETRY_SNAPSHOT = 4; // Retry snapshot (combine with refetch and reject) + REJECT_SNAPSHOT = 5; // Reject this snapshot, try others } } -//---------------------------------------- -// Misc. +message ResponsePrepareProposal { + repeated bytes txs = 1; +} + +message ResponseProcessProposal { + ProposalStatus status = 1; -// ConsensusParams contains all consensus-relevant parameters -// that can be adjusted by the abci app -message ConsensusParams { - BlockParams block = 1; - tendermint.types.EvidenceParams evidence = 2; - tendermint.types.ValidatorParams validator = 3; - tendermint.types.VersionParams version = 4; + enum ProposalStatus { + UNKNOWN = 0; + ACCEPT = 1; + REJECT = 2; + } } -// BlockParams contains limits on the block size. -message BlockParams { - // Note: must be greater than 0 - int64 max_bytes = 1; - // Note: must be greater or equal to -1 - int64 max_gas = 2; +message ResponseExtendVote { + bytes vote_extension = 1; } -message LastCommitInfo { +message ResponseVerifyVoteExtension { + VerifyStatus status = 1; + + enum VerifyStatus { + UNKNOWN = 0; + ACCEPT = 1; + // Rejecting the vote extension will reject the entire precommit by the sender. + // Incorrectly implementing this thus has liveness implications as it may affect + // CometBFT's ability to receive 2/3+ valid votes to finalize the block. + // Honest nodes should never be rejected. + REJECT = 2; + } +} + +message ResponseFinalizeBlock { + // set of block events emmitted as part of executing the block + repeated Event events = 1 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; + // the result of executing each transaction including the events + // the particular transction emitted. This should match the order + // of the transactions delivered in the block itself + repeated ExecTxResult tx_results = 2; + // a list of updates to the validator set. These will reflect the validator set at current height + 2. + repeated ValidatorUpdate validator_updates = 3 [(gogoproto.nullable) = false]; + // updates to the consensus params, if any. + tendermint.types.ConsensusParams consensus_param_updates = 4; + // app_hash is the hash of the applications' state which is used to confirm that execution of the transactions was + // deterministic. It is up to the application to decide which algorithm to use. + bytes app_hash = 5; +} + +//---------------------------------------- +// Misc. + +message CommitInfo { int32 round = 1; repeated VoteInfo votes = 2 [(gogoproto.nullable) = false]; } +// ExtendedCommitInfo is similar to CommitInfo except that it is only used in +// the PrepareProposal request such that CometBFT can provide vote extensions +// to the application. +message ExtendedCommitInfo { + // The round at which the block proposer decided in the previous height. + int32 round = 1; + // List of validators' addresses in the last validator set with their voting + // information, including vote extensions. + repeated ExtendedVoteInfo votes = 2 [(gogoproto.nullable) = false]; +} + // Event allows application developers to attach additional information to -// ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. +// ResponseFinalizeBlock and ResponseCheckTx. // Later, transactions may be queried using these events. message Event { string type = 1; - repeated EventAttribute attributes = 2 [ - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "attributes,omitempty" - ]; + repeated EventAttribute attributes = 2 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "attributes,omitempty"]; } // EventAttribute is a single key-value pair, associated with an event. message EventAttribute { - bytes key = 1; - bytes value = 2; - bool index = 3; // nondeterministic + string key = 1; + string value = 2; + bool index = 3; // nondeterministic +} + +// ExecTxResult contains results of executing one individual transaction. +// +// * Its structure is equivalent to #ResponseDeliverTx which will be deprecated/deleted +message ExecTxResult { + uint32 code = 1; + bytes data = 2; + string log = 3; // nondeterministic + string info = 4; // nondeterministic + int64 gas_wanted = 5 [json_name = "gas_wanted"]; + int64 gas_used = 6 [json_name = "gas_used"]; + repeated Event events = 7 + [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; // nondeterministic + string codespace = 8; } // TxResult contains results of executing the transaction. // // One usage is indexing transaction results. message TxResult { - int64 height = 1; - uint32 index = 2; - bytes tx = 3; - ResponseDeliverTx result = 4 [(gogoproto.nullable) = false]; + int64 height = 1; + uint32 index = 2; + bytes tx = 3; + ExecTxResult result = 4 [(gogoproto.nullable) = false]; } //---------------------------------------- // Blockchain Types -// Validator message Validator { - bytes address = 1; // The first 20 bytes of SHA256(public key) + bytes address = 1; // The first 20 bytes of SHA256(public key) // PubKey pub_key = 2 [(gogoproto.nullable)=false]; - int64 power = 3; // The voting power + int64 power = 3; // The voting power } -// ValidatorUpdate message ValidatorUpdate { tendermint.crypto.PublicKey pub_key = 1 [(gogoproto.nullable) = false]; int64 power = 2; } -// VoteInfo message VoteInfo { - Validator validator = 1 [(gogoproto.nullable) = false]; - bool signed_last_block = 2; + Validator validator = 1 [(gogoproto.nullable) = false]; + tendermint.types.BlockIDFlag block_id_flag = 3; + + reserved 2; // signed_last_block } -enum EvidenceType { +message ExtendedVoteInfo { + // The validator that sent the vote. + Validator validator = 1 [(gogoproto.nullable) = false]; + // Non-deterministic extension provided by the sending validator's application. + bytes vote_extension = 3; + // Vote extension signature created by CometBFT + bytes extension_signature = 4; + // block_id_flag indicates whether the validator voted for a block, nil, or did not vote at all + tendermint.types.BlockIDFlag block_id_flag = 5; + + reserved 2; // signed_last_block +} + +enum MisbehaviorType { UNKNOWN = 0; DUPLICATE_VOTE = 1; LIGHT_CLIENT_ATTACK = 2; } -message Evidence { - EvidenceType type = 1; +message Misbehavior { + MisbehaviorType type = 1; // The offending validator Validator validator = 2 [(gogoproto.nullable) = false]; // The height when the offense occurred int64 height = 3; // The corresponding time where the offense occurred - google.protobuf.Timestamp time = 4 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp time = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; // Total voting power of the validator set in case the ABCI application does // not store historical validators. // https://github.com/tendermint/tendermint/issues/4581 @@ -382,32 +478,9 @@ message Evidence { // State Sync Types message Snapshot { - uint64 height = 1; // The height at which the snapshot was taken - uint32 format = 2; // The application-specific snapshot format - uint32 chunks = 3; // Number of chunks in the snapshot - bytes hash = 4; // Arbitrary snapshot hash, equal only if identical - bytes metadata = 5; // Arbitrary application metadata -} - -//---------------------------------------- -// Service Definition - -service ABCIApplication { - rpc Echo(RequestEcho) returns (ResponseEcho); - rpc Flush(RequestFlush) returns (ResponseFlush); - rpc Info(RequestInfo) returns (ResponseInfo); - rpc SetOption(RequestSetOption) returns (ResponseSetOption); - rpc DeliverTx(RequestDeliverTx) returns (ResponseDeliverTx); - rpc CheckTx(RequestCheckTx) returns (ResponseCheckTx); - rpc Query(RequestQuery) returns (ResponseQuery); - rpc Commit(RequestCommit) returns (ResponseCommit); - rpc InitChain(RequestInitChain) returns (ResponseInitChain); - rpc BeginBlock(RequestBeginBlock) returns (ResponseBeginBlock); - rpc EndBlock(RequestEndBlock) returns (ResponseEndBlock); - rpc ListSnapshots(RequestListSnapshots) returns (ResponseListSnapshots); - rpc OfferSnapshot(RequestOfferSnapshot) returns (ResponseOfferSnapshot); - rpc LoadSnapshotChunk(RequestLoadSnapshotChunk) - returns (ResponseLoadSnapshotChunk); - rpc ApplySnapshotChunk(RequestApplySnapshotChunk) - returns (ResponseApplySnapshotChunk); + uint64 height = 1; // The height at which the snapshot was taken + uint32 format = 2; // The application-specific snapshot format + uint32 chunks = 3; // Number of chunks in the snapshot + bytes hash = 4; // Arbitrary snapshot hash, equal only if identical + bytes metadata = 5; // Arbitrary application metadata } diff --git a/proto/tendermint/crypto/keys.proto b/proto/tendermint/crypto/keys.proto index 5b94dda..8fa192f 100644 --- a/proto/tendermint/crypto/keys.proto +++ b/proto/tendermint/crypto/keys.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.crypto; -option go_package = "github.com/tendermint/tendermint/proto/tendermint/crypto"; +option go_package = "github.com/cometbft/cometbft/proto/tendermint/crypto"; import "gogoproto/gogo.proto"; diff --git a/proto/tendermint/crypto/proof.proto b/proto/tendermint/crypto/proof.proto index 975df76..ae72195 100644 --- a/proto/tendermint/crypto/proof.proto +++ b/proto/tendermint/crypto/proof.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.crypto; -option go_package = "github.com/tendermint/tendermint/proto/tendermint/crypto"; +option go_package = "github.com/cometbft/cometbft/proto/tendermint/crypto"; import "gogoproto/gogo.proto"; diff --git a/proto/tendermint/libs/bits/types.proto b/proto/tendermint/libs/bits/types.proto index 3111d11..e6afc5e 100644 --- a/proto/tendermint/libs/bits/types.proto +++ b/proto/tendermint/libs/bits/types.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.libs.bits; -option go_package = "github.com/tendermint/tendermint/proto/tendermint/libs/bits"; +option go_package = "github.com/cometbft/cometbft/proto/tendermint/libs/bits"; message BitArray { int64 bits = 1; diff --git a/proto/tendermint/p2p/types.proto b/proto/tendermint/p2p/types.proto index 0d42ea4..157d8ba 100644 --- a/proto/tendermint/p2p/types.proto +++ b/proto/tendermint/p2p/types.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.p2p; -option go_package = "github.com/tendermint/tendermint/proto/tendermint/p2p"; +option go_package = "github.com/cometbft/cometbft/proto/tendermint/p2p"; import "gogoproto/gogo.proto"; diff --git a/proto/tendermint/types/block.proto b/proto/tendermint/types/block.proto index 84e9bb1..d531c06 100644 --- a/proto/tendermint/types/block.proto +++ b/proto/tendermint/types/block.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.types; -option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; +option go_package = "github.com/cometbft/cometbft/proto/tendermint/types"; import "gogoproto/gogo.proto"; import "tendermint/types/types.proto"; diff --git a/proto/tendermint/types/evidence.proto b/proto/tendermint/types/evidence.proto index 451b8dc..06f30ec 100644 --- a/proto/tendermint/types/evidence.proto +++ b/proto/tendermint/types/evidence.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.types; -option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; +option go_package = "github.com/cometbft/cometbft/proto/tendermint/types"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; @@ -30,7 +30,7 @@ message LightClientAttackEvidence { int64 common_height = 2; repeated tendermint.types.Validator byzantine_validators = 3; int64 total_voting_power = 4; - google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; } message EvidenceList { diff --git a/proto/tendermint/types/params.proto b/proto/tendermint/types/params.proto index 0de7d84..6a42d5e 100644 --- a/proto/tendermint/types/params.proto +++ b/proto/tendermint/types/params.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.types; -option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; +option go_package = "github.com/cometbft/cometbft/proto/tendermint/types"; import "gogoproto/gogo.proto"; import "google/protobuf/duration.proto"; @@ -11,10 +11,11 @@ option (gogoproto.equal_all) = true; // ConsensusParams contains consensus critical parameters that determine the // validity of blocks. message ConsensusParams { - BlockParams block = 1 [(gogoproto.nullable) = false]; - EvidenceParams evidence = 2 [(gogoproto.nullable) = false]; - ValidatorParams validator = 3 [(gogoproto.nullable) = false]; - VersionParams version = 4 [(gogoproto.nullable) = false]; + BlockParams block = 1; + EvidenceParams evidence = 2; + ValidatorParams validator = 3; + VersionParams version = 4; + ABCIParams abci = 5; } // BlockParams contains limits on the block size. @@ -25,11 +26,8 @@ message BlockParams { // Max gas per block. // Note: must be greater or equal to -1 int64 max_gas = 2; - // Minimum time increment between consecutive blocks (in milliseconds) If the - // block header timestamp is ahead of the system clock, decrease this value. - // - // Not exposed to the application. - int64 time_iota_ms = 3; + + reserved 3; // was TimeIotaMs see https://github.com/tendermint/tendermint/pull/5792 } // EvidenceParams determine how we handle evidence of malfeasance. @@ -45,8 +43,7 @@ message EvidenceParams { // It should correspond with an app's "unbonding period" or other similar // mechanism for handling [Nothing-At-Stake // attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). - google.protobuf.Duration max_age_duration = 2 - [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; + google.protobuf.Duration max_age_duration = 2 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; // This sets the maximum size of total evidence in bytes that can be committed in a single block. // and should fall comfortably under the max block bytes. @@ -68,7 +65,7 @@ message VersionParams { option (gogoproto.populate) = true; option (gogoproto.equal) = true; - uint64 app_version = 1; + uint64 app = 1; } // HashedParams is a subset of ConsensusParams. @@ -78,3 +75,17 @@ message HashedParams { int64 block_max_bytes = 1; int64 block_max_gas = 2; } + +// ABCIParams configure functionality specific to the Application Blockchain Interface. +message ABCIParams { + // vote_extensions_enable_height configures the first height during which + // vote extensions will be enabled. During this specified height, and for all + // subsequent heights, precommit messages that do not contain valid extension data + // will be considered invalid. Prior to this height, vote extensions will not + // be used or accepted by validators on the network. + // + // Once enabled, vote extensions will be created by the application in ExtendVote, + // passed to the application for validation in VerifyVoteExtension and given + // to the application to use when proposing a block during PrepareProposal. + int64 vote_extensions_enable_height = 1; +} diff --git a/proto/tendermint/types/types.proto b/proto/tendermint/types/types.proto index 3ce1694..a0d545a 100644 --- a/proto/tendermint/types/types.proto +++ b/proto/tendermint/types/types.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.types; -option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; +option go_package = "github.com/cometbft/cometbft/proto/tendermint/types"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; @@ -9,17 +9,6 @@ import "tendermint/crypto/proof.proto"; import "tendermint/version/types.proto"; import "tendermint/types/validator.proto"; -// BlockIdFlag indicates which BlcokID the signature is for -enum BlockIDFlag { - option (gogoproto.goproto_enum_stringer) = true; - option (gogoproto.goproto_enum_prefix) = false; - - BLOCK_ID_FLAG_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "BlockIDFlagUnknown"]; - BLOCK_ID_FLAG_ABSENT = 1 [(gogoproto.enumvalue_customname) = "BlockIDFlagAbsent"]; - BLOCK_ID_FLAG_COMMIT = 2 [(gogoproto.enumvalue_customname) = "BlockIDFlagCommit"]; - BLOCK_ID_FLAG_NIL = 3 [(gogoproto.enumvalue_customname) = "BlockIDFlagNil"]; -} - // SignedMsgType is a type of signed message in the consensus. enum SignedMsgType { option (gogoproto.goproto_enum_stringer) = true; @@ -66,19 +55,19 @@ message Header { BlockID last_block_id = 5 [(gogoproto.nullable) = false]; // hashes of block data - bytes last_commit_hash = 6; // commit from validators from the last block - bytes data_hash = 7; // transactions + bytes last_commit_hash = 6; // commit from validators from the last block + bytes data_hash = 7; // transactions // hashes from the app output from the prev block - bytes validators_hash = 8; // validators for the current block - bytes next_validators_hash = 9; // validators for the next block - bytes consensus_hash = 10; // consensus params for current block - bytes app_hash = 11; // state after txs from the previous block - bytes last_results_hash = 12; // root hash of all results from the txs from the previous block + bytes validators_hash = 8; // validators for the current block + bytes next_validators_hash = 9; // validators for the next block + bytes consensus_hash = 10; // consensus params for current block + bytes app_hash = 11; // state after txs from the previous block + bytes last_results_hash = 12; // root hash of all results from the txs from the previous block // consensus info - bytes evidence_hash = 13; // evidence included in the block - bytes proposer_address = 14; // original proposer of the block + bytes evidence_hash = 13; // evidence included in the block + bytes proposer_address = 14; // original proposer of the block } // Data contains the set of transactions included in the block @@ -89,19 +78,26 @@ message Data { repeated bytes txs = 1; } -// Vote represents a prevote, precommit, or commit vote from validators for +// Vote represents a prevote or precommit vote from validators for // consensus. message Vote { SignedMsgType type = 1; int64 height = 2; int32 round = 3; - BlockID block_id = 4 - [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; // zero if vote is nil. - google.protobuf.Timestamp timestamp = 5 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - bytes validator_address = 6; - int32 validator_index = 7; - bytes signature = 8; + BlockID block_id = 4 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; // zero if vote is nil. + google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes validator_address = 6; + int32 validator_index = 7; + // Vote signature by the validator if they participated in consensus for the + // associated block. + bytes signature = 8; + // Vote extension provided by the application. Only valid for precommit + // messages. + bytes extension = 9; + // Vote extension signature by the validator if they participated in + // consensus for the associated block. + // Only valid for precommit messages. + bytes extension_signature = 10; } // Commit contains the evidence that a block was committed by a set of validators. @@ -114,11 +110,31 @@ message Commit { // CommitSig is a part of the Vote included in a Commit. message CommitSig { - BlockIDFlag block_id_flag = 1; - bytes validator_address = 2; - google.protobuf.Timestamp timestamp = 3 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - bytes signature = 4; + tendermint.types.BlockIDFlag block_id_flag = 1; + bytes validator_address = 2; + google.protobuf.Timestamp timestamp = 3 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes signature = 4; +} + +message ExtendedCommit { + int64 height = 1; + int32 round = 2; + BlockID block_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; + repeated ExtendedCommitSig extended_signatures = 4 [(gogoproto.nullable) = false]; +} + +// ExtendedCommitSig retains all the same fields as CommitSig but adds vote +// extension-related fields. We use two signatures to ensure backwards compatibility. +// That is the digest of the original signature is still the same in prior versions +message ExtendedCommitSig { + tendermint.types.BlockIDFlag block_id_flag = 1; + bytes validator_address = 2; + google.protobuf.Timestamp timestamp = 3 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes signature = 4; + // Vote extension data + bytes extension = 5; + // Vote extension signature + bytes extension_signature = 6; } message Proposal { @@ -127,9 +143,8 @@ message Proposal { int32 round = 3; int32 pol_round = 4; BlockID block_id = 5 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; - google.protobuf.Timestamp timestamp = 6 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - bytes signature = 7; + google.protobuf.Timestamp timestamp = 6 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes signature = 7; } message SignedHeader { diff --git a/proto/tendermint/types/validator.proto b/proto/tendermint/types/validator.proto index 49860b9..cd5105f 100644 --- a/proto/tendermint/types/validator.proto +++ b/proto/tendermint/types/validator.proto @@ -1,11 +1,23 @@ syntax = "proto3"; package tendermint.types; -option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; +option go_package = "github.com/cometbft/cometbft/proto/tendermint/types"; import "gogoproto/gogo.proto"; import "tendermint/crypto/keys.proto"; +// BlockIdFlag indicates which BlockID the signature is for +enum BlockIDFlag { + option (gogoproto.goproto_enum_stringer) = true; + option (gogoproto.goproto_enum_prefix) = false; + + BLOCK_ID_FLAG_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "BlockIDFlagUnknown"]; // indicates an error condition + BLOCK_ID_FLAG_ABSENT = 1 [(gogoproto.enumvalue_customname) = "BlockIDFlagAbsent"]; // the vote was not received + BLOCK_ID_FLAG_COMMIT = 2 + [(gogoproto.enumvalue_customname) = "BlockIDFlagCommit"]; // voted for the block that received the majority + BLOCK_ID_FLAG_NIL = 3 [(gogoproto.enumvalue_customname) = "BlockIDFlagNil"]; // voted for nil +} + message ValidatorSet { repeated Validator validators = 1; Validator proposer = 2; diff --git a/proto/tendermint/version/types.proto b/proto/tendermint/version/types.proto index 6061868..3b6ef45 100644 --- a/proto/tendermint/version/types.proto +++ b/proto/tendermint/version/types.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.version; -option go_package = "github.com/tendermint/tendermint/proto/tendermint/version"; +option go_package = "github.com/cometbft/cometbft/proto/tendermint/version"; import "gogoproto/gogo.proto"; diff --git a/src/codegen/amino/amino.ts b/src/codegen/amino/amino.ts new file mode 100644 index 0000000..693da49 --- /dev/null +++ b/src/codegen/amino/amino.ts @@ -0,0 +1 @@ +export {} \ No newline at end of file diff --git a/src/codegen/amino/bundle.ts b/src/codegen/amino/bundle.ts new file mode 100644 index 0000000..d9ebdd1 --- /dev/null +++ b/src/codegen/amino/bundle.ts @@ -0,0 +1,4 @@ +import * as _0 from "./amino"; +export const amino = { + ..._0 +}; \ No newline at end of file diff --git a/src/codegen/capability/bundle.ts b/src/codegen/capability/bundle.ts new file mode 100644 index 0000000..b34342f --- /dev/null +++ b/src/codegen/capability/bundle.ts @@ -0,0 +1,8 @@ +import * as _1 from "./v1/capability"; +import * as _2 from "./v1/genesis"; +export namespace capability { + export const v1 = { + ..._1, + ..._2 + }; +} \ No newline at end of file diff --git a/src/codegen/capability/v1/capability.ts b/src/codegen/capability/v1/capability.ts new file mode 100644 index 0000000..08d8145 --- /dev/null +++ b/src/codegen/capability/v1/capability.ts @@ -0,0 +1,294 @@ +import { BinaryReader, BinaryWriter } from "../../binary"; +/** + * Capability defines an implementation of an object capability. The index + * provided to a Capability must be globally unique. + */ +export interface Capability { + index: bigint; +} +export interface CapabilityProtoMsg { + typeUrl: "/capability.v1.Capability"; + value: Uint8Array; +} +/** + * Capability defines an implementation of an object capability. The index + * provided to a Capability must be globally unique. + */ +export interface CapabilityAmino { + index?: string; +} +export interface CapabilityAminoMsg { + type: "/capability.v1.Capability"; + value: CapabilityAmino; +} +/** + * Capability defines an implementation of an object capability. The index + * provided to a Capability must be globally unique. + */ +export interface CapabilitySDKType { + index: bigint; +} +/** + * Owner defines a single capability owner. An owner is defined by the name of + * capability and the module name. + */ +export interface Owner { + module: string; + name: string; +} +export interface OwnerProtoMsg { + typeUrl: "/capability.v1.Owner"; + value: Uint8Array; +} +/** + * Owner defines a single capability owner. An owner is defined by the name of + * capability and the module name. + */ +export interface OwnerAmino { + module?: string; + name?: string; +} +export interface OwnerAminoMsg { + type: "/capability.v1.Owner"; + value: OwnerAmino; +} +/** + * Owner defines a single capability owner. An owner is defined by the name of + * capability and the module name. + */ +export interface OwnerSDKType { + module: string; + name: string; +} +/** + * CapabilityOwners defines a set of owners of a single Capability. The set of + * owners must be unique. + */ +export interface CapabilityOwners { + owners: Owner[]; +} +export interface CapabilityOwnersProtoMsg { + typeUrl: "/capability.v1.CapabilityOwners"; + value: Uint8Array; +} +/** + * CapabilityOwners defines a set of owners of a single Capability. The set of + * owners must be unique. + */ +export interface CapabilityOwnersAmino { + owners: OwnerAmino[]; +} +export interface CapabilityOwnersAminoMsg { + type: "/capability.v1.CapabilityOwners"; + value: CapabilityOwnersAmino; +} +/** + * CapabilityOwners defines a set of owners of a single Capability. The set of + * owners must be unique. + */ +export interface CapabilityOwnersSDKType { + owners: OwnerSDKType[]; +} +function createBaseCapability(): Capability { + return { + index: BigInt(0) + }; +} +export const Capability = { + typeUrl: "/capability.v1.Capability", + encode(message: Capability, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.index !== BigInt(0)) { + writer.uint32(8).uint64(message.index); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Capability { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCapability(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Capability { + const message = createBaseCapability(); + message.index = object.index !== undefined && object.index !== null ? BigInt(object.index.toString()) : BigInt(0); + return message; + }, + fromAmino(object: CapabilityAmino): Capability { + const message = createBaseCapability(); + if (object.index !== undefined && object.index !== null) { + message.index = BigInt(object.index); + } + return message; + }, + toAmino(message: Capability): CapabilityAmino { + const obj: any = {}; + obj.index = message.index !== BigInt(0) ? message.index.toString() : undefined; + return obj; + }, + fromAminoMsg(object: CapabilityAminoMsg): Capability { + return Capability.fromAmino(object.value); + }, + fromProtoMsg(message: CapabilityProtoMsg): Capability { + return Capability.decode(message.value); + }, + toProto(message: Capability): Uint8Array { + return Capability.encode(message).finish(); + }, + toProtoMsg(message: Capability): CapabilityProtoMsg { + return { + typeUrl: "/capability.v1.Capability", + value: Capability.encode(message).finish() + }; + } +}; +function createBaseOwner(): Owner { + return { + module: "", + name: "" + }; +} +export const Owner = { + typeUrl: "/capability.v1.Owner", + encode(message: Owner, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.module !== "") { + writer.uint32(10).string(message.module); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Owner { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOwner(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.module = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Owner { + const message = createBaseOwner(); + message.module = object.module ?? ""; + message.name = object.name ?? ""; + return message; + }, + fromAmino(object: OwnerAmino): Owner { + const message = createBaseOwner(); + if (object.module !== undefined && object.module !== null) { + message.module = object.module; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + return message; + }, + toAmino(message: Owner): OwnerAmino { + const obj: any = {}; + obj.module = message.module === "" ? undefined : message.module; + obj.name = message.name === "" ? undefined : message.name; + return obj; + }, + fromAminoMsg(object: OwnerAminoMsg): Owner { + return Owner.fromAmino(object.value); + }, + fromProtoMsg(message: OwnerProtoMsg): Owner { + return Owner.decode(message.value); + }, + toProto(message: Owner): Uint8Array { + return Owner.encode(message).finish(); + }, + toProtoMsg(message: Owner): OwnerProtoMsg { + return { + typeUrl: "/capability.v1.Owner", + value: Owner.encode(message).finish() + }; + } +}; +function createBaseCapabilityOwners(): CapabilityOwners { + return { + owners: [] + }; +} +export const CapabilityOwners = { + typeUrl: "/capability.v1.CapabilityOwners", + encode(message: CapabilityOwners, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.owners) { + Owner.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CapabilityOwners { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCapabilityOwners(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owners.push(Owner.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CapabilityOwners { + const message = createBaseCapabilityOwners(); + message.owners = object.owners?.map(e => Owner.fromPartial(e)) || []; + return message; + }, + fromAmino(object: CapabilityOwnersAmino): CapabilityOwners { + const message = createBaseCapabilityOwners(); + message.owners = object.owners?.map(e => Owner.fromAmino(e)) || []; + return message; + }, + toAmino(message: CapabilityOwners): CapabilityOwnersAmino { + const obj: any = {}; + if (message.owners) { + obj.owners = message.owners.map(e => e ? Owner.toAmino(e) : undefined); + } else { + obj.owners = message.owners; + } + return obj; + }, + fromAminoMsg(object: CapabilityOwnersAminoMsg): CapabilityOwners { + return CapabilityOwners.fromAmino(object.value); + }, + fromProtoMsg(message: CapabilityOwnersProtoMsg): CapabilityOwners { + return CapabilityOwners.decode(message.value); + }, + toProto(message: CapabilityOwners): Uint8Array { + return CapabilityOwners.encode(message).finish(); + }, + toProtoMsg(message: CapabilityOwners): CapabilityOwnersProtoMsg { + return { + typeUrl: "/capability.v1.CapabilityOwners", + value: CapabilityOwners.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/capability/v1/genesis.ts b/src/codegen/capability/v1/genesis.ts new file mode 100644 index 0000000..5f5846a --- /dev/null +++ b/src/codegen/capability/v1/genesis.ts @@ -0,0 +1,214 @@ +import { CapabilityOwners, CapabilityOwnersAmino, CapabilityOwnersSDKType } from "./capability"; +import { BinaryReader, BinaryWriter } from "../../binary"; +/** GenesisOwners defines the capability owners with their corresponding index. */ +export interface GenesisOwners { + /** index is the index of the capability owner. */ + index: bigint; + /** index_owners are the owners at the given index. */ + indexOwners: CapabilityOwners; +} +export interface GenesisOwnersProtoMsg { + typeUrl: "/capability.v1.GenesisOwners"; + value: Uint8Array; +} +/** GenesisOwners defines the capability owners with their corresponding index. */ +export interface GenesisOwnersAmino { + /** index is the index of the capability owner. */ + index?: string; + /** index_owners are the owners at the given index. */ + index_owners: CapabilityOwnersAmino; +} +export interface GenesisOwnersAminoMsg { + type: "/capability.v1.GenesisOwners"; + value: GenesisOwnersAmino; +} +/** GenesisOwners defines the capability owners with their corresponding index. */ +export interface GenesisOwnersSDKType { + index: bigint; + index_owners: CapabilityOwnersSDKType; +} +/** GenesisState defines the capability module's genesis state. */ +export interface GenesisState { + /** index is the capability global index. */ + index: bigint; + /** + * owners represents a map from index to owners of the capability index + * index key is string to allow amino marshalling. + */ + owners: GenesisOwners[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/capability.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the capability module's genesis state. */ +export interface GenesisStateAmino { + /** index is the capability global index. */ + index?: string; + /** + * owners represents a map from index to owners of the capability index + * index key is string to allow amino marshalling. + */ + owners: GenesisOwnersAmino[]; +} +export interface GenesisStateAminoMsg { + type: "/capability.v1.GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the capability module's genesis state. */ +export interface GenesisStateSDKType { + index: bigint; + owners: GenesisOwnersSDKType[]; +} +function createBaseGenesisOwners(): GenesisOwners { + return { + index: BigInt(0), + indexOwners: CapabilityOwners.fromPartial({}) + }; +} +export const GenesisOwners = { + typeUrl: "/capability.v1.GenesisOwners", + encode(message: GenesisOwners, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.index !== BigInt(0)) { + writer.uint32(8).uint64(message.index); + } + if (message.indexOwners !== undefined) { + CapabilityOwners.encode(message.indexOwners, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisOwners { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisOwners(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.uint64(); + break; + case 2: + message.indexOwners = CapabilityOwners.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisOwners { + const message = createBaseGenesisOwners(); + message.index = object.index !== undefined && object.index !== null ? BigInt(object.index.toString()) : BigInt(0); + message.indexOwners = object.indexOwners !== undefined && object.indexOwners !== null ? CapabilityOwners.fromPartial(object.indexOwners) : undefined; + return message; + }, + fromAmino(object: GenesisOwnersAmino): GenesisOwners { + const message = createBaseGenesisOwners(); + if (object.index !== undefined && object.index !== null) { + message.index = BigInt(object.index); + } + if (object.index_owners !== undefined && object.index_owners !== null) { + message.indexOwners = CapabilityOwners.fromAmino(object.index_owners); + } + return message; + }, + toAmino(message: GenesisOwners): GenesisOwnersAmino { + const obj: any = {}; + obj.index = message.index !== BigInt(0) ? message.index.toString() : undefined; + obj.index_owners = message.indexOwners ? CapabilityOwners.toAmino(message.indexOwners) : CapabilityOwners.toAmino(CapabilityOwners.fromPartial({})); + return obj; + }, + fromAminoMsg(object: GenesisOwnersAminoMsg): GenesisOwners { + return GenesisOwners.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisOwnersProtoMsg): GenesisOwners { + return GenesisOwners.decode(message.value); + }, + toProto(message: GenesisOwners): Uint8Array { + return GenesisOwners.encode(message).finish(); + }, + toProtoMsg(message: GenesisOwners): GenesisOwnersProtoMsg { + return { + typeUrl: "/capability.v1.GenesisOwners", + value: GenesisOwners.encode(message).finish() + }; + } +}; +function createBaseGenesisState(): GenesisState { + return { + index: BigInt(0), + owners: [] + }; +} +export const GenesisState = { + typeUrl: "/capability.v1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.index !== BigInt(0)) { + writer.uint32(8).uint64(message.index); + } + for (const v of message.owners) { + GenesisOwners.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.index = reader.uint64(); + break; + case 2: + message.owners.push(GenesisOwners.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.index = object.index !== undefined && object.index !== null ? BigInt(object.index.toString()) : BigInt(0); + message.owners = object.owners?.map(e => GenesisOwners.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.index !== undefined && object.index !== null) { + message.index = BigInt(object.index); + } + message.owners = object.owners?.map(e => GenesisOwners.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.index = message.index !== BigInt(0) ? message.index.toString() : undefined; + if (message.owners) { + obj.owners = message.owners.map(e => e ? GenesisOwners.toAmino(e) : undefined); + } else { + obj.owners = message.owners; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/capability.v1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/app/runtime/v1alpha1/module.ts b/src/codegen/cosmos/app/runtime/v1alpha1/module.ts new file mode 100644 index 0000000..70480bb --- /dev/null +++ b/src/codegen/cosmos/app/runtime/v1alpha1/module.ts @@ -0,0 +1,423 @@ +import { BinaryReader, BinaryWriter } from "../../../../binary"; +/** Module is the config object for the runtime module. */ +export interface Module { + /** app_name is the name of the app. */ + appName: string; + /** + * begin_blockers specifies the module names of begin blockers + * to call in the order in which they should be called. If this is left empty + * no begin blocker will be registered. + */ + beginBlockers: string[]; + /** + * end_blockers specifies the module names of the end blockers + * to call in the order in which they should be called. If this is left empty + * no end blocker will be registered. + */ + endBlockers: string[]; + /** + * init_genesis specifies the module names of init genesis functions + * to call in the order in which they should be called. If this is left empty + * no init genesis function will be registered. + */ + initGenesis: string[]; + /** + * export_genesis specifies the order in which to export module genesis data. + * If this is left empty, the init_genesis order will be used for export genesis + * if it is specified. + */ + exportGenesis: string[]; + /** + * override_store_keys is an optional list of overrides for the module store keys + * to be used in keeper construction. + */ + overrideStoreKeys: StoreKeyConfig[]; + /** + * order_migrations defines the order in which module migrations are performed. + * If this is left empty, it uses the default migration order. + * https://pkg.go.dev/github.com/cosmos/cosmos-sdk@v0.47.0-alpha2/types/module#DefaultMigrationsOrder + */ + orderMigrations: string[]; + /** + * precommiters specifies the module names of the precommiters + * to call in the order in which they should be called. If this is left empty + * no precommit function will be registered. + */ + precommiters: string[]; + /** + * prepare_check_staters specifies the module names of the prepare_check_staters + * to call in the order in which they should be called. If this is left empty + * no preparecheckstate function will be registered. + */ + prepareCheckStaters: string[]; +} +export interface ModuleProtoMsg { + typeUrl: "/cosmos.app.runtime.v1alpha1.Module"; + value: Uint8Array; +} +/** Module is the config object for the runtime module. */ +export interface ModuleAmino { + /** app_name is the name of the app. */ + app_name?: string; + /** + * begin_blockers specifies the module names of begin blockers + * to call in the order in which they should be called. If this is left empty + * no begin blocker will be registered. + */ + begin_blockers?: string[]; + /** + * end_blockers specifies the module names of the end blockers + * to call in the order in which they should be called. If this is left empty + * no end blocker will be registered. + */ + end_blockers?: string[]; + /** + * init_genesis specifies the module names of init genesis functions + * to call in the order in which they should be called. If this is left empty + * no init genesis function will be registered. + */ + init_genesis?: string[]; + /** + * export_genesis specifies the order in which to export module genesis data. + * If this is left empty, the init_genesis order will be used for export genesis + * if it is specified. + */ + export_genesis?: string[]; + /** + * override_store_keys is an optional list of overrides for the module store keys + * to be used in keeper construction. + */ + override_store_keys?: StoreKeyConfigAmino[]; + /** + * order_migrations defines the order in which module migrations are performed. + * If this is left empty, it uses the default migration order. + * https://pkg.go.dev/github.com/cosmos/cosmos-sdk@v0.47.0-alpha2/types/module#DefaultMigrationsOrder + */ + order_migrations?: string[]; + /** + * precommiters specifies the module names of the precommiters + * to call in the order in which they should be called. If this is left empty + * no precommit function will be registered. + */ + precommiters?: string[]; + /** + * prepare_check_staters specifies the module names of the prepare_check_staters + * to call in the order in which they should be called. If this is left empty + * no preparecheckstate function will be registered. + */ + prepare_check_staters?: string[]; +} +export interface ModuleAminoMsg { + type: "cosmos-sdk/Module"; + value: ModuleAmino; +} +/** Module is the config object for the runtime module. */ +export interface ModuleSDKType { + app_name: string; + begin_blockers: string[]; + end_blockers: string[]; + init_genesis: string[]; + export_genesis: string[]; + override_store_keys: StoreKeyConfigSDKType[]; + order_migrations: string[]; + precommiters: string[]; + prepare_check_staters: string[]; +} +/** + * StoreKeyConfig may be supplied to override the default module store key, which + * is the module name. + */ +export interface StoreKeyConfig { + /** name of the module to override the store key of */ + moduleName: string; + /** the kv store key to use instead of the module name. */ + kvStoreKey: string; +} +export interface StoreKeyConfigProtoMsg { + typeUrl: "/cosmos.app.runtime.v1alpha1.StoreKeyConfig"; + value: Uint8Array; +} +/** + * StoreKeyConfig may be supplied to override the default module store key, which + * is the module name. + */ +export interface StoreKeyConfigAmino { + /** name of the module to override the store key of */ + module_name?: string; + /** the kv store key to use instead of the module name. */ + kv_store_key?: string; +} +export interface StoreKeyConfigAminoMsg { + type: "cosmos-sdk/StoreKeyConfig"; + value: StoreKeyConfigAmino; +} +/** + * StoreKeyConfig may be supplied to override the default module store key, which + * is the module name. + */ +export interface StoreKeyConfigSDKType { + module_name: string; + kv_store_key: string; +} +function createBaseModule(): Module { + return { + appName: "", + beginBlockers: [], + endBlockers: [], + initGenesis: [], + exportGenesis: [], + overrideStoreKeys: [], + orderMigrations: [], + precommiters: [], + prepareCheckStaters: [] + }; +} +export const Module = { + typeUrl: "/cosmos.app.runtime.v1alpha1.Module", + encode(message: Module, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.appName !== "") { + writer.uint32(10).string(message.appName); + } + for (const v of message.beginBlockers) { + writer.uint32(18).string(v!); + } + for (const v of message.endBlockers) { + writer.uint32(26).string(v!); + } + for (const v of message.initGenesis) { + writer.uint32(34).string(v!); + } + for (const v of message.exportGenesis) { + writer.uint32(42).string(v!); + } + for (const v of message.overrideStoreKeys) { + StoreKeyConfig.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.orderMigrations) { + writer.uint32(58).string(v!); + } + for (const v of message.precommiters) { + writer.uint32(66).string(v!); + } + for (const v of message.prepareCheckStaters) { + writer.uint32(74).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Module { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModule(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.appName = reader.string(); + break; + case 2: + message.beginBlockers.push(reader.string()); + break; + case 3: + message.endBlockers.push(reader.string()); + break; + case 4: + message.initGenesis.push(reader.string()); + break; + case 5: + message.exportGenesis.push(reader.string()); + break; + case 6: + message.overrideStoreKeys.push(StoreKeyConfig.decode(reader, reader.uint32())); + break; + case 7: + message.orderMigrations.push(reader.string()); + break; + case 8: + message.precommiters.push(reader.string()); + break; + case 9: + message.prepareCheckStaters.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Module { + const message = createBaseModule(); + message.appName = object.appName ?? ""; + message.beginBlockers = object.beginBlockers?.map(e => e) || []; + message.endBlockers = object.endBlockers?.map(e => e) || []; + message.initGenesis = object.initGenesis?.map(e => e) || []; + message.exportGenesis = object.exportGenesis?.map(e => e) || []; + message.overrideStoreKeys = object.overrideStoreKeys?.map(e => StoreKeyConfig.fromPartial(e)) || []; + message.orderMigrations = object.orderMigrations?.map(e => e) || []; + message.precommiters = object.precommiters?.map(e => e) || []; + message.prepareCheckStaters = object.prepareCheckStaters?.map(e => e) || []; + return message; + }, + fromAmino(object: ModuleAmino): Module { + const message = createBaseModule(); + if (object.app_name !== undefined && object.app_name !== null) { + message.appName = object.app_name; + } + message.beginBlockers = object.begin_blockers?.map(e => e) || []; + message.endBlockers = object.end_blockers?.map(e => e) || []; + message.initGenesis = object.init_genesis?.map(e => e) || []; + message.exportGenesis = object.export_genesis?.map(e => e) || []; + message.overrideStoreKeys = object.override_store_keys?.map(e => StoreKeyConfig.fromAmino(e)) || []; + message.orderMigrations = object.order_migrations?.map(e => e) || []; + message.precommiters = object.precommiters?.map(e => e) || []; + message.prepareCheckStaters = object.prepare_check_staters?.map(e => e) || []; + return message; + }, + toAmino(message: Module): ModuleAmino { + const obj: any = {}; + obj.app_name = message.appName === "" ? undefined : message.appName; + if (message.beginBlockers) { + obj.begin_blockers = message.beginBlockers.map(e => e); + } else { + obj.begin_blockers = message.beginBlockers; + } + if (message.endBlockers) { + obj.end_blockers = message.endBlockers.map(e => e); + } else { + obj.end_blockers = message.endBlockers; + } + if (message.initGenesis) { + obj.init_genesis = message.initGenesis.map(e => e); + } else { + obj.init_genesis = message.initGenesis; + } + if (message.exportGenesis) { + obj.export_genesis = message.exportGenesis.map(e => e); + } else { + obj.export_genesis = message.exportGenesis; + } + if (message.overrideStoreKeys) { + obj.override_store_keys = message.overrideStoreKeys.map(e => e ? StoreKeyConfig.toAmino(e) : undefined); + } else { + obj.override_store_keys = message.overrideStoreKeys; + } + if (message.orderMigrations) { + obj.order_migrations = message.orderMigrations.map(e => e); + } else { + obj.order_migrations = message.orderMigrations; + } + if (message.precommiters) { + obj.precommiters = message.precommiters.map(e => e); + } else { + obj.precommiters = message.precommiters; + } + if (message.prepareCheckStaters) { + obj.prepare_check_staters = message.prepareCheckStaters.map(e => e); + } else { + obj.prepare_check_staters = message.prepareCheckStaters; + } + return obj; + }, + fromAminoMsg(object: ModuleAminoMsg): Module { + return Module.fromAmino(object.value); + }, + toAminoMsg(message: Module): ModuleAminoMsg { + return { + type: "cosmos-sdk/Module", + value: Module.toAmino(message) + }; + }, + fromProtoMsg(message: ModuleProtoMsg): Module { + return Module.decode(message.value); + }, + toProto(message: Module): Uint8Array { + return Module.encode(message).finish(); + }, + toProtoMsg(message: Module): ModuleProtoMsg { + return { + typeUrl: "/cosmos.app.runtime.v1alpha1.Module", + value: Module.encode(message).finish() + }; + } +}; +function createBaseStoreKeyConfig(): StoreKeyConfig { + return { + moduleName: "", + kvStoreKey: "" + }; +} +export const StoreKeyConfig = { + typeUrl: "/cosmos.app.runtime.v1alpha1.StoreKeyConfig", + encode(message: StoreKeyConfig, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.moduleName !== "") { + writer.uint32(10).string(message.moduleName); + } + if (message.kvStoreKey !== "") { + writer.uint32(18).string(message.kvStoreKey); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StoreKeyConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStoreKeyConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.moduleName = reader.string(); + break; + case 2: + message.kvStoreKey = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StoreKeyConfig { + const message = createBaseStoreKeyConfig(); + message.moduleName = object.moduleName ?? ""; + message.kvStoreKey = object.kvStoreKey ?? ""; + return message; + }, + fromAmino(object: StoreKeyConfigAmino): StoreKeyConfig { + const message = createBaseStoreKeyConfig(); + if (object.module_name !== undefined && object.module_name !== null) { + message.moduleName = object.module_name; + } + if (object.kv_store_key !== undefined && object.kv_store_key !== null) { + message.kvStoreKey = object.kv_store_key; + } + return message; + }, + toAmino(message: StoreKeyConfig): StoreKeyConfigAmino { + const obj: any = {}; + obj.module_name = message.moduleName === "" ? undefined : message.moduleName; + obj.kv_store_key = message.kvStoreKey === "" ? undefined : message.kvStoreKey; + return obj; + }, + fromAminoMsg(object: StoreKeyConfigAminoMsg): StoreKeyConfig { + return StoreKeyConfig.fromAmino(object.value); + }, + toAminoMsg(message: StoreKeyConfig): StoreKeyConfigAminoMsg { + return { + type: "cosmos-sdk/StoreKeyConfig", + value: StoreKeyConfig.toAmino(message) + }; + }, + fromProtoMsg(message: StoreKeyConfigProtoMsg): StoreKeyConfig { + return StoreKeyConfig.decode(message.value); + }, + toProto(message: StoreKeyConfig): Uint8Array { + return StoreKeyConfig.encode(message).finish(); + }, + toProtoMsg(message: StoreKeyConfig): StoreKeyConfigProtoMsg { + return { + typeUrl: "/cosmos.app.runtime.v1alpha1.StoreKeyConfig", + value: StoreKeyConfig.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/app/v1alpha1/config.ts b/src/codegen/cosmos/app/v1alpha1/config.ts new file mode 100644 index 0000000..fc8e158 --- /dev/null +++ b/src/codegen/cosmos/app/v1alpha1/config.ts @@ -0,0 +1,417 @@ +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * Config represents the configuration for a Cosmos SDK ABCI app. + * It is intended that all state machine logic including the version of + * baseapp and tx handlers (and possibly even Tendermint) that an app needs + * can be described in a config object. For compatibility, the framework should + * allow a mixture of declarative and imperative app wiring, however, apps + * that strive for the maximum ease of maintainability should be able to describe + * their state machine with a config object alone. + */ +export interface Config { + /** modules are the module configurations for the app. */ + modules: ModuleConfig[]; + /** + * golang_bindings specifies explicit interface to implementation type bindings which + * depinject uses to resolve interface inputs to provider functions. The scope of this + * field's configuration is global (not module specific). + */ + golangBindings: GolangBinding[]; +} +export interface ConfigProtoMsg { + typeUrl: "/cosmos.app.v1alpha1.Config"; + value: Uint8Array; +} +/** + * Config represents the configuration for a Cosmos SDK ABCI app. + * It is intended that all state machine logic including the version of + * baseapp and tx handlers (and possibly even Tendermint) that an app needs + * can be described in a config object. For compatibility, the framework should + * allow a mixture of declarative and imperative app wiring, however, apps + * that strive for the maximum ease of maintainability should be able to describe + * their state machine with a config object alone. + */ +export interface ConfigAmino { + /** modules are the module configurations for the app. */ + modules?: ModuleConfigAmino[]; + /** + * golang_bindings specifies explicit interface to implementation type bindings which + * depinject uses to resolve interface inputs to provider functions. The scope of this + * field's configuration is global (not module specific). + */ + golang_bindings?: GolangBindingAmino[]; +} +export interface ConfigAminoMsg { + type: "cosmos-sdk/Config"; + value: ConfigAmino; +} +/** + * Config represents the configuration for a Cosmos SDK ABCI app. + * It is intended that all state machine logic including the version of + * baseapp and tx handlers (and possibly even Tendermint) that an app needs + * can be described in a config object. For compatibility, the framework should + * allow a mixture of declarative and imperative app wiring, however, apps + * that strive for the maximum ease of maintainability should be able to describe + * their state machine with a config object alone. + */ +export interface ConfigSDKType { + modules: ModuleConfigSDKType[]; + golang_bindings: GolangBindingSDKType[]; +} +/** ModuleConfig is a module configuration for an app. */ +export interface ModuleConfig { + /** + * name is the unique name of the module within the app. It should be a name + * that persists between different versions of a module so that modules + * can be smoothly upgraded to new versions. + * + * For example, for the module cosmos.bank.module.v1.Module, we may chose + * to simply name the module "bank" in the app. When we upgrade to + * cosmos.bank.module.v2.Module, the app-specific name "bank" stays the same + * and the framework knows that the v2 module should receive all the same state + * that the v1 module had. Note: modules should provide info on which versions + * they can migrate from in the ModuleDescriptor.can_migration_from field. + */ + name: string; + /** + * config is the config object for the module. Module config messages should + * define a ModuleDescriptor using the cosmos.app.v1alpha1.is_module extension. + */ + config?: Any; + /** + * golang_bindings specifies explicit interface to implementation type bindings which + * depinject uses to resolve interface inputs to provider functions. The scope of this + * field's configuration is module specific. + */ + golangBindings: GolangBinding[]; +} +export interface ModuleConfigProtoMsg { + typeUrl: "/cosmos.app.v1alpha1.ModuleConfig"; + value: Uint8Array; +} +/** ModuleConfig is a module configuration for an app. */ +export interface ModuleConfigAmino { + /** + * name is the unique name of the module within the app. It should be a name + * that persists between different versions of a module so that modules + * can be smoothly upgraded to new versions. + * + * For example, for the module cosmos.bank.module.v1.Module, we may chose + * to simply name the module "bank" in the app. When we upgrade to + * cosmos.bank.module.v2.Module, the app-specific name "bank" stays the same + * and the framework knows that the v2 module should receive all the same state + * that the v1 module had. Note: modules should provide info on which versions + * they can migrate from in the ModuleDescriptor.can_migration_from field. + */ + name?: string; + /** + * config is the config object for the module. Module config messages should + * define a ModuleDescriptor using the cosmos.app.v1alpha1.is_module extension. + */ + config?: AnyAmino; + /** + * golang_bindings specifies explicit interface to implementation type bindings which + * depinject uses to resolve interface inputs to provider functions. The scope of this + * field's configuration is module specific. + */ + golang_bindings?: GolangBindingAmino[]; +} +export interface ModuleConfigAminoMsg { + type: "cosmos-sdk/ModuleConfig"; + value: ModuleConfigAmino; +} +/** ModuleConfig is a module configuration for an app. */ +export interface ModuleConfigSDKType { + name: string; + config?: AnySDKType; + golang_bindings: GolangBindingSDKType[]; +} +/** GolangBinding is an explicit interface type to implementing type binding for dependency injection. */ +export interface GolangBinding { + /** interface_type is the interface type which will be bound to a specific implementation type */ + interfaceType: string; + /** implementation is the implementing type which will be supplied when an input of type interface is requested */ + implementation: string; +} +export interface GolangBindingProtoMsg { + typeUrl: "/cosmos.app.v1alpha1.GolangBinding"; + value: Uint8Array; +} +/** GolangBinding is an explicit interface type to implementing type binding for dependency injection. */ +export interface GolangBindingAmino { + /** interface_type is the interface type which will be bound to a specific implementation type */ + interface_type?: string; + /** implementation is the implementing type which will be supplied when an input of type interface is requested */ + implementation?: string; +} +export interface GolangBindingAminoMsg { + type: "cosmos-sdk/GolangBinding"; + value: GolangBindingAmino; +} +/** GolangBinding is an explicit interface type to implementing type binding for dependency injection. */ +export interface GolangBindingSDKType { + interface_type: string; + implementation: string; +} +function createBaseConfig(): Config { + return { + modules: [], + golangBindings: [] + }; +} +export const Config = { + typeUrl: "/cosmos.app.v1alpha1.Config", + encode(message: Config, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.modules) { + ModuleConfig.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.golangBindings) { + GolangBinding.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Config { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.modules.push(ModuleConfig.decode(reader, reader.uint32())); + break; + case 2: + message.golangBindings.push(GolangBinding.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Config { + const message = createBaseConfig(); + message.modules = object.modules?.map(e => ModuleConfig.fromPartial(e)) || []; + message.golangBindings = object.golangBindings?.map(e => GolangBinding.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ConfigAmino): Config { + const message = createBaseConfig(); + message.modules = object.modules?.map(e => ModuleConfig.fromAmino(e)) || []; + message.golangBindings = object.golang_bindings?.map(e => GolangBinding.fromAmino(e)) || []; + return message; + }, + toAmino(message: Config): ConfigAmino { + const obj: any = {}; + if (message.modules) { + obj.modules = message.modules.map(e => e ? ModuleConfig.toAmino(e) : undefined); + } else { + obj.modules = message.modules; + } + if (message.golangBindings) { + obj.golang_bindings = message.golangBindings.map(e => e ? GolangBinding.toAmino(e) : undefined); + } else { + obj.golang_bindings = message.golangBindings; + } + return obj; + }, + fromAminoMsg(object: ConfigAminoMsg): Config { + return Config.fromAmino(object.value); + }, + toAminoMsg(message: Config): ConfigAminoMsg { + return { + type: "cosmos-sdk/Config", + value: Config.toAmino(message) + }; + }, + fromProtoMsg(message: ConfigProtoMsg): Config { + return Config.decode(message.value); + }, + toProto(message: Config): Uint8Array { + return Config.encode(message).finish(); + }, + toProtoMsg(message: Config): ConfigProtoMsg { + return { + typeUrl: "/cosmos.app.v1alpha1.Config", + value: Config.encode(message).finish() + }; + } +}; +function createBaseModuleConfig(): ModuleConfig { + return { + name: "", + config: undefined, + golangBindings: [] + }; +} +export const ModuleConfig = { + typeUrl: "/cosmos.app.v1alpha1.ModuleConfig", + encode(message: ModuleConfig, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.config !== undefined) { + Any.encode(message.config, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.golangBindings) { + GolangBinding.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModuleConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.config = Any.decode(reader, reader.uint32()); + break; + case 3: + message.golangBindings.push(GolangBinding.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ModuleConfig { + const message = createBaseModuleConfig(); + message.name = object.name ?? ""; + message.config = object.config !== undefined && object.config !== null ? Any.fromPartial(object.config) : undefined; + message.golangBindings = object.golangBindings?.map(e => GolangBinding.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ModuleConfigAmino): ModuleConfig { + const message = createBaseModuleConfig(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.config !== undefined && object.config !== null) { + message.config = Any.fromAmino(object.config); + } + message.golangBindings = object.golang_bindings?.map(e => GolangBinding.fromAmino(e)) || []; + return message; + }, + toAmino(message: ModuleConfig): ModuleConfigAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.config = message.config ? Any.toAmino(message.config) : undefined; + if (message.golangBindings) { + obj.golang_bindings = message.golangBindings.map(e => e ? GolangBinding.toAmino(e) : undefined); + } else { + obj.golang_bindings = message.golangBindings; + } + return obj; + }, + fromAminoMsg(object: ModuleConfigAminoMsg): ModuleConfig { + return ModuleConfig.fromAmino(object.value); + }, + toAminoMsg(message: ModuleConfig): ModuleConfigAminoMsg { + return { + type: "cosmos-sdk/ModuleConfig", + value: ModuleConfig.toAmino(message) + }; + }, + fromProtoMsg(message: ModuleConfigProtoMsg): ModuleConfig { + return ModuleConfig.decode(message.value); + }, + toProto(message: ModuleConfig): Uint8Array { + return ModuleConfig.encode(message).finish(); + }, + toProtoMsg(message: ModuleConfig): ModuleConfigProtoMsg { + return { + typeUrl: "/cosmos.app.v1alpha1.ModuleConfig", + value: ModuleConfig.encode(message).finish() + }; + } +}; +function createBaseGolangBinding(): GolangBinding { + return { + interfaceType: "", + implementation: "" + }; +} +export const GolangBinding = { + typeUrl: "/cosmos.app.v1alpha1.GolangBinding", + encode(message: GolangBinding, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.interfaceType !== "") { + writer.uint32(10).string(message.interfaceType); + } + if (message.implementation !== "") { + writer.uint32(18).string(message.implementation); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GolangBinding { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGolangBinding(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.interfaceType = reader.string(); + break; + case 2: + message.implementation = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GolangBinding { + const message = createBaseGolangBinding(); + message.interfaceType = object.interfaceType ?? ""; + message.implementation = object.implementation ?? ""; + return message; + }, + fromAmino(object: GolangBindingAmino): GolangBinding { + const message = createBaseGolangBinding(); + if (object.interface_type !== undefined && object.interface_type !== null) { + message.interfaceType = object.interface_type; + } + if (object.implementation !== undefined && object.implementation !== null) { + message.implementation = object.implementation; + } + return message; + }, + toAmino(message: GolangBinding): GolangBindingAmino { + const obj: any = {}; + obj.interface_type = message.interfaceType === "" ? undefined : message.interfaceType; + obj.implementation = message.implementation === "" ? undefined : message.implementation; + return obj; + }, + fromAminoMsg(object: GolangBindingAminoMsg): GolangBinding { + return GolangBinding.fromAmino(object.value); + }, + toAminoMsg(message: GolangBinding): GolangBindingAminoMsg { + return { + type: "cosmos-sdk/GolangBinding", + value: GolangBinding.toAmino(message) + }; + }, + fromProtoMsg(message: GolangBindingProtoMsg): GolangBinding { + return GolangBinding.decode(message.value); + }, + toProto(message: GolangBinding): Uint8Array { + return GolangBinding.encode(message).finish(); + }, + toProtoMsg(message: GolangBinding): GolangBindingProtoMsg { + return { + typeUrl: "/cosmos.app.v1alpha1.GolangBinding", + value: GolangBinding.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/app/v1alpha1/module.ts b/src/codegen/cosmos/app/v1alpha1/module.ts new file mode 100644 index 0000000..8e747f7 --- /dev/null +++ b/src/codegen/cosmos/app/v1alpha1/module.ts @@ -0,0 +1,450 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** ModuleDescriptor describes an app module. */ +export interface ModuleDescriptor { + /** + * go_import names the package that should be imported by an app to load the + * module in the runtime module registry. It is required to make debugging + * of configuration errors easier for users. + */ + goImport: string; + /** + * use_package refers to a protobuf package that this module + * uses and exposes to the world. In an app, only one module should "use" + * or own a single protobuf package. It is assumed that the module uses + * all of the .proto files in a single package. + */ + usePackage: PackageReference[]; + /** + * can_migrate_from defines which module versions this module can migrate + * state from. The framework will check that one module version is able to + * migrate from a previous module version before attempting to update its + * config. It is assumed that modules can transitively migrate from earlier + * versions. For instance if v3 declares it can migrate from v2, and v2 + * declares it can migrate from v1, the framework knows how to migrate + * from v1 to v3, assuming all 3 module versions are registered at runtime. + */ + canMigrateFrom: MigrateFromInfo[]; +} +export interface ModuleDescriptorProtoMsg { + typeUrl: "/cosmos.app.v1alpha1.ModuleDescriptor"; + value: Uint8Array; +} +/** ModuleDescriptor describes an app module. */ +export interface ModuleDescriptorAmino { + /** + * go_import names the package that should be imported by an app to load the + * module in the runtime module registry. It is required to make debugging + * of configuration errors easier for users. + */ + go_import?: string; + /** + * use_package refers to a protobuf package that this module + * uses and exposes to the world. In an app, only one module should "use" + * or own a single protobuf package. It is assumed that the module uses + * all of the .proto files in a single package. + */ + use_package?: PackageReferenceAmino[]; + /** + * can_migrate_from defines which module versions this module can migrate + * state from. The framework will check that one module version is able to + * migrate from a previous module version before attempting to update its + * config. It is assumed that modules can transitively migrate from earlier + * versions. For instance if v3 declares it can migrate from v2, and v2 + * declares it can migrate from v1, the framework knows how to migrate + * from v1 to v3, assuming all 3 module versions are registered at runtime. + */ + can_migrate_from?: MigrateFromInfoAmino[]; +} +export interface ModuleDescriptorAminoMsg { + type: "cosmos-sdk/ModuleDescriptor"; + value: ModuleDescriptorAmino; +} +/** ModuleDescriptor describes an app module. */ +export interface ModuleDescriptorSDKType { + go_import: string; + use_package: PackageReferenceSDKType[]; + can_migrate_from: MigrateFromInfoSDKType[]; +} +/** PackageReference is a reference to a protobuf package used by a module. */ +export interface PackageReference { + /** name is the fully-qualified name of the package. */ + name: string; + /** + * revision is the optional revision of the package that is being used. + * Protobuf packages used in Cosmos should generally have a major version + * as the last part of the package name, ex. foo.bar.baz.v1. + * The revision of a package can be thought of as the minor version of a + * package which has additional backwards compatible definitions that weren't + * present in a previous version. + * + * A package should indicate its revision with a source code comment + * above the package declaration in one of its files containing the + * text "Revision N" where N is an integer revision. All packages start + * at revision 0 the first time they are released in a module. + * + * When a new version of a module is released and items are added to existing + * .proto files, these definitions should contain comments of the form + * "Since: Revision N" where N is an integer revision. + * + * When the module runtime starts up, it will check the pinned proto + * image and panic if there are runtime protobuf definitions that are not + * in the pinned descriptor which do not have + * a "Since Revision N" comment or have a "Since Revision N" comment where + * N is <= to the revision specified here. This indicates that the protobuf + * files have been updated, but the pinned file descriptor hasn't. + * + * If there are items in the pinned file descriptor with a revision + * greater than the value indicated here, this will also cause a panic + * as it may mean that the pinned descriptor for a legacy module has been + * improperly updated or that there is some other versioning discrepancy. + * Runtime protobuf definitions will also be checked for compatibility + * with pinned file descriptors to make sure there are no incompatible changes. + * + * This behavior ensures that: + * * pinned proto images are up-to-date + * * protobuf files are carefully annotated with revision comments which + * are important good client UX + * * protobuf files are changed in backwards and forwards compatible ways + */ + revision: number; +} +export interface PackageReferenceProtoMsg { + typeUrl: "/cosmos.app.v1alpha1.PackageReference"; + value: Uint8Array; +} +/** PackageReference is a reference to a protobuf package used by a module. */ +export interface PackageReferenceAmino { + /** name is the fully-qualified name of the package. */ + name?: string; + /** + * revision is the optional revision of the package that is being used. + * Protobuf packages used in Cosmos should generally have a major version + * as the last part of the package name, ex. foo.bar.baz.v1. + * The revision of a package can be thought of as the minor version of a + * package which has additional backwards compatible definitions that weren't + * present in a previous version. + * + * A package should indicate its revision with a source code comment + * above the package declaration in one of its files containing the + * text "Revision N" where N is an integer revision. All packages start + * at revision 0 the first time they are released in a module. + * + * When a new version of a module is released and items are added to existing + * .proto files, these definitions should contain comments of the form + * "Since: Revision N" where N is an integer revision. + * + * When the module runtime starts up, it will check the pinned proto + * image and panic if there are runtime protobuf definitions that are not + * in the pinned descriptor which do not have + * a "Since Revision N" comment or have a "Since Revision N" comment where + * N is <= to the revision specified here. This indicates that the protobuf + * files have been updated, but the pinned file descriptor hasn't. + * + * If there are items in the pinned file descriptor with a revision + * greater than the value indicated here, this will also cause a panic + * as it may mean that the pinned descriptor for a legacy module has been + * improperly updated or that there is some other versioning discrepancy. + * Runtime protobuf definitions will also be checked for compatibility + * with pinned file descriptors to make sure there are no incompatible changes. + * + * This behavior ensures that: + * * pinned proto images are up-to-date + * * protobuf files are carefully annotated with revision comments which + * are important good client UX + * * protobuf files are changed in backwards and forwards compatible ways + */ + revision?: number; +} +export interface PackageReferenceAminoMsg { + type: "cosmos-sdk/PackageReference"; + value: PackageReferenceAmino; +} +/** PackageReference is a reference to a protobuf package used by a module. */ +export interface PackageReferenceSDKType { + name: string; + revision: number; +} +/** + * MigrateFromInfo is information on a module version that a newer module + * can migrate from. + */ +export interface MigrateFromInfo { + /** + * module is the fully-qualified protobuf name of the module config object + * for the previous module version, ex: "cosmos.group.module.v1.Module". + */ + module: string; +} +export interface MigrateFromInfoProtoMsg { + typeUrl: "/cosmos.app.v1alpha1.MigrateFromInfo"; + value: Uint8Array; +} +/** + * MigrateFromInfo is information on a module version that a newer module + * can migrate from. + */ +export interface MigrateFromInfoAmino { + /** + * module is the fully-qualified protobuf name of the module config object + * for the previous module version, ex: "cosmos.group.module.v1.Module". + */ + module?: string; +} +export interface MigrateFromInfoAminoMsg { + type: "cosmos-sdk/MigrateFromInfo"; + value: MigrateFromInfoAmino; +} +/** + * MigrateFromInfo is information on a module version that a newer module + * can migrate from. + */ +export interface MigrateFromInfoSDKType { + module: string; +} +function createBaseModuleDescriptor(): ModuleDescriptor { + return { + goImport: "", + usePackage: [], + canMigrateFrom: [] + }; +} +export const ModuleDescriptor = { + typeUrl: "/cosmos.app.v1alpha1.ModuleDescriptor", + encode(message: ModuleDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.goImport !== "") { + writer.uint32(10).string(message.goImport); + } + for (const v of message.usePackage) { + PackageReference.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.canMigrateFrom) { + MigrateFromInfo.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModuleDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.goImport = reader.string(); + break; + case 2: + message.usePackage.push(PackageReference.decode(reader, reader.uint32())); + break; + case 3: + message.canMigrateFrom.push(MigrateFromInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ModuleDescriptor { + const message = createBaseModuleDescriptor(); + message.goImport = object.goImport ?? ""; + message.usePackage = object.usePackage?.map(e => PackageReference.fromPartial(e)) || []; + message.canMigrateFrom = object.canMigrateFrom?.map(e => MigrateFromInfo.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ModuleDescriptorAmino): ModuleDescriptor { + const message = createBaseModuleDescriptor(); + if (object.go_import !== undefined && object.go_import !== null) { + message.goImport = object.go_import; + } + message.usePackage = object.use_package?.map(e => PackageReference.fromAmino(e)) || []; + message.canMigrateFrom = object.can_migrate_from?.map(e => MigrateFromInfo.fromAmino(e)) || []; + return message; + }, + toAmino(message: ModuleDescriptor): ModuleDescriptorAmino { + const obj: any = {}; + obj.go_import = message.goImport === "" ? undefined : message.goImport; + if (message.usePackage) { + obj.use_package = message.usePackage.map(e => e ? PackageReference.toAmino(e) : undefined); + } else { + obj.use_package = message.usePackage; + } + if (message.canMigrateFrom) { + obj.can_migrate_from = message.canMigrateFrom.map(e => e ? MigrateFromInfo.toAmino(e) : undefined); + } else { + obj.can_migrate_from = message.canMigrateFrom; + } + return obj; + }, + fromAminoMsg(object: ModuleDescriptorAminoMsg): ModuleDescriptor { + return ModuleDescriptor.fromAmino(object.value); + }, + toAminoMsg(message: ModuleDescriptor): ModuleDescriptorAminoMsg { + return { + type: "cosmos-sdk/ModuleDescriptor", + value: ModuleDescriptor.toAmino(message) + }; + }, + fromProtoMsg(message: ModuleDescriptorProtoMsg): ModuleDescriptor { + return ModuleDescriptor.decode(message.value); + }, + toProto(message: ModuleDescriptor): Uint8Array { + return ModuleDescriptor.encode(message).finish(); + }, + toProtoMsg(message: ModuleDescriptor): ModuleDescriptorProtoMsg { + return { + typeUrl: "/cosmos.app.v1alpha1.ModuleDescriptor", + value: ModuleDescriptor.encode(message).finish() + }; + } +}; +function createBasePackageReference(): PackageReference { + return { + name: "", + revision: 0 + }; +} +export const PackageReference = { + typeUrl: "/cosmos.app.v1alpha1.PackageReference", + encode(message: PackageReference, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.revision !== 0) { + writer.uint32(16).uint32(message.revision); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PackageReference { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePackageReference(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.revision = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PackageReference { + const message = createBasePackageReference(); + message.name = object.name ?? ""; + message.revision = object.revision ?? 0; + return message; + }, + fromAmino(object: PackageReferenceAmino): PackageReference { + const message = createBasePackageReference(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.revision !== undefined && object.revision !== null) { + message.revision = object.revision; + } + return message; + }, + toAmino(message: PackageReference): PackageReferenceAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.revision = message.revision === 0 ? undefined : message.revision; + return obj; + }, + fromAminoMsg(object: PackageReferenceAminoMsg): PackageReference { + return PackageReference.fromAmino(object.value); + }, + toAminoMsg(message: PackageReference): PackageReferenceAminoMsg { + return { + type: "cosmos-sdk/PackageReference", + value: PackageReference.toAmino(message) + }; + }, + fromProtoMsg(message: PackageReferenceProtoMsg): PackageReference { + return PackageReference.decode(message.value); + }, + toProto(message: PackageReference): Uint8Array { + return PackageReference.encode(message).finish(); + }, + toProtoMsg(message: PackageReference): PackageReferenceProtoMsg { + return { + typeUrl: "/cosmos.app.v1alpha1.PackageReference", + value: PackageReference.encode(message).finish() + }; + } +}; +function createBaseMigrateFromInfo(): MigrateFromInfo { + return { + module: "" + }; +} +export const MigrateFromInfo = { + typeUrl: "/cosmos.app.v1alpha1.MigrateFromInfo", + encode(message: MigrateFromInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.module !== "") { + writer.uint32(10).string(message.module); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MigrateFromInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMigrateFromInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.module = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MigrateFromInfo { + const message = createBaseMigrateFromInfo(); + message.module = object.module ?? ""; + return message; + }, + fromAmino(object: MigrateFromInfoAmino): MigrateFromInfo { + const message = createBaseMigrateFromInfo(); + if (object.module !== undefined && object.module !== null) { + message.module = object.module; + } + return message; + }, + toAmino(message: MigrateFromInfo): MigrateFromInfoAmino { + const obj: any = {}; + obj.module = message.module === "" ? undefined : message.module; + return obj; + }, + fromAminoMsg(object: MigrateFromInfoAminoMsg): MigrateFromInfo { + return MigrateFromInfo.fromAmino(object.value); + }, + toAminoMsg(message: MigrateFromInfo): MigrateFromInfoAminoMsg { + return { + type: "cosmos-sdk/MigrateFromInfo", + value: MigrateFromInfo.toAmino(message) + }; + }, + fromProtoMsg(message: MigrateFromInfoProtoMsg): MigrateFromInfo { + return MigrateFromInfo.decode(message.value); + }, + toProto(message: MigrateFromInfo): Uint8Array { + return MigrateFromInfo.encode(message).finish(); + }, + toProtoMsg(message: MigrateFromInfo): MigrateFromInfoProtoMsg { + return { + typeUrl: "/cosmos.app.v1alpha1.MigrateFromInfo", + value: MigrateFromInfo.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/app/v1alpha1/query.rpc.Query.ts b/src/codegen/cosmos/app/v1alpha1/query.rpc.Query.ts new file mode 100644 index 0000000..7aaf409 --- /dev/null +++ b/src/codegen/cosmos/app/v1alpha1/query.rpc.Query.ts @@ -0,0 +1,30 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryConfigRequest, QueryConfigResponse } from "./query"; +/** Query is the app module query service. */ +export interface Query { + /** Config returns the current app config. */ + config(request?: QueryConfigRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.config = this.config.bind(this); + } + config(request: QueryConfigRequest = {}): Promise { + const data = QueryConfigRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.app.v1alpha1.Query", "Config", data); + return promise.then(data => QueryConfigResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + config(request?: QueryConfigRequest): Promise { + return queryService.config(request); + } + }; +}; \ No newline at end of file diff --git a/src/codegen/cosmos/app/v1alpha1/query.ts b/src/codegen/cosmos/app/v1alpha1/query.ts new file mode 100644 index 0000000..5c8c04f --- /dev/null +++ b/src/codegen/cosmos/app/v1alpha1/query.ts @@ -0,0 +1,163 @@ +import { Config, ConfigAmino, ConfigSDKType } from "./config"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** QueryConfigRequest is the Query/Config request type. */ +export interface QueryConfigRequest {} +export interface QueryConfigRequestProtoMsg { + typeUrl: "/cosmos.app.v1alpha1.QueryConfigRequest"; + value: Uint8Array; +} +/** QueryConfigRequest is the Query/Config request type. */ +export interface QueryConfigRequestAmino {} +export interface QueryConfigRequestAminoMsg { + type: "cosmos-sdk/QueryConfigRequest"; + value: QueryConfigRequestAmino; +} +/** QueryConfigRequest is the Query/Config request type. */ +export interface QueryConfigRequestSDKType {} +/** QueryConfigRequest is the Query/Config response type. */ +export interface QueryConfigResponse { + /** config is the current app config. */ + config?: Config; +} +export interface QueryConfigResponseProtoMsg { + typeUrl: "/cosmos.app.v1alpha1.QueryConfigResponse"; + value: Uint8Array; +} +/** QueryConfigRequest is the Query/Config response type. */ +export interface QueryConfigResponseAmino { + /** config is the current app config. */ + config?: ConfigAmino; +} +export interface QueryConfigResponseAminoMsg { + type: "cosmos-sdk/QueryConfigResponse"; + value: QueryConfigResponseAmino; +} +/** QueryConfigRequest is the Query/Config response type. */ +export interface QueryConfigResponseSDKType { + config?: ConfigSDKType; +} +function createBaseQueryConfigRequest(): QueryConfigRequest { + return {}; +} +export const QueryConfigRequest = { + typeUrl: "/cosmos.app.v1alpha1.QueryConfigRequest", + encode(_: QueryConfigRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryConfigRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConfigRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryConfigRequest { + const message = createBaseQueryConfigRequest(); + return message; + }, + fromAmino(_: QueryConfigRequestAmino): QueryConfigRequest { + const message = createBaseQueryConfigRequest(); + return message; + }, + toAmino(_: QueryConfigRequest): QueryConfigRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryConfigRequestAminoMsg): QueryConfigRequest { + return QueryConfigRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryConfigRequest): QueryConfigRequestAminoMsg { + return { + type: "cosmos-sdk/QueryConfigRequest", + value: QueryConfigRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryConfigRequestProtoMsg): QueryConfigRequest { + return QueryConfigRequest.decode(message.value); + }, + toProto(message: QueryConfigRequest): Uint8Array { + return QueryConfigRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryConfigRequest): QueryConfigRequestProtoMsg { + return { + typeUrl: "/cosmos.app.v1alpha1.QueryConfigRequest", + value: QueryConfigRequest.encode(message).finish() + }; + } +}; +function createBaseQueryConfigResponse(): QueryConfigResponse { + return { + config: undefined + }; +} +export const QueryConfigResponse = { + typeUrl: "/cosmos.app.v1alpha1.QueryConfigResponse", + encode(message: QueryConfigResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.config !== undefined) { + Config.encode(message.config, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryConfigResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConfigResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.config = Config.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryConfigResponse { + const message = createBaseQueryConfigResponse(); + message.config = object.config !== undefined && object.config !== null ? Config.fromPartial(object.config) : undefined; + return message; + }, + fromAmino(object: QueryConfigResponseAmino): QueryConfigResponse { + const message = createBaseQueryConfigResponse(); + if (object.config !== undefined && object.config !== null) { + message.config = Config.fromAmino(object.config); + } + return message; + }, + toAmino(message: QueryConfigResponse): QueryConfigResponseAmino { + const obj: any = {}; + obj.config = message.config ? Config.toAmino(message.config) : undefined; + return obj; + }, + fromAminoMsg(object: QueryConfigResponseAminoMsg): QueryConfigResponse { + return QueryConfigResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryConfigResponse): QueryConfigResponseAminoMsg { + return { + type: "cosmos-sdk/QueryConfigResponse", + value: QueryConfigResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryConfigResponseProtoMsg): QueryConfigResponse { + return QueryConfigResponse.decode(message.value); + }, + toProto(message: QueryConfigResponse): Uint8Array { + return QueryConfigResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryConfigResponse): QueryConfigResponseProtoMsg { + return { + typeUrl: "/cosmos.app.v1alpha1.QueryConfigResponse", + value: QueryConfigResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/auth/v1beta1/auth.ts b/src/codegen/cosmos/auth/v1beta1/auth.ts index 29c409e..e9edd31 100644 --- a/src/codegen/cosmos/auth/v1beta1/auth.ts +++ b/src/codegen/cosmos/auth/v1beta1/auth.ts @@ -1,5 +1,6 @@ import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; /** * BaseAccount defines a base account type. It contains all the necessary fields * for basic account functionality. Any custom account type should extend this @@ -67,6 +68,51 @@ export interface ModuleAccountSDKType { name: string; permissions: string[]; } +/** + * ModuleCredential represents a unclaimable pubkey for base accounts controlled by modules. + * + * Since: cosmos-sdk 0.47 + */ +export interface ModuleCredential { + /** module_name is the name of the module used for address derivation (passed into address.Module). */ + moduleName: string; + /** + * derivation_keys is for deriving a module account address (passed into address.Module) + * adding more keys creates sub-account addresses (passed into address.Derive) + */ + derivationKeys: Uint8Array[]; +} +export interface ModuleCredentialProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.ModuleCredential"; + value: Uint8Array; +} +/** + * ModuleCredential represents a unclaimable pubkey for base accounts controlled by modules. + * + * Since: cosmos-sdk 0.47 + */ +export interface ModuleCredentialAmino { + /** module_name is the name of the module used for address derivation (passed into address.Module). */ + module_name?: string; + /** + * derivation_keys is for deriving a module account address (passed into address.Module) + * adding more keys creates sub-account addresses (passed into address.Derive) + */ + derivation_keys?: string[]; +} +export interface ModuleCredentialAminoMsg { + type: "cosmos-sdk/GroupAccountCredential"; + value: ModuleCredentialAmino; +} +/** + * ModuleCredential represents a unclaimable pubkey for base accounts controlled by modules. + * + * Since: cosmos-sdk 0.47 + */ +export interface ModuleCredentialSDKType { + module_name: string; + derivation_keys: Uint8Array[]; +} /** Params defines the parameters for the auth module. */ export interface Params { maxMemoCharacters: bigint; @@ -88,7 +134,7 @@ export interface ParamsAmino { sig_verify_cost_secp256k1?: string; } export interface ParamsAminoMsg { - type: "cosmos-sdk/Params"; + type: "cosmos-sdk/x/auth/Params"; value: ParamsAmino; } /** Params defines the parameters for the auth module. */ @@ -299,6 +345,89 @@ export const ModuleAccount = { }; } }; +function createBaseModuleCredential(): ModuleCredential { + return { + moduleName: "", + derivationKeys: [] + }; +} +export const ModuleCredential = { + typeUrl: "/cosmos.auth.v1beta1.ModuleCredential", + encode(message: ModuleCredential, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.moduleName !== "") { + writer.uint32(10).string(message.moduleName); + } + for (const v of message.derivationKeys) { + writer.uint32(18).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModuleCredential { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleCredential(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.moduleName = reader.string(); + break; + case 2: + message.derivationKeys.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ModuleCredential { + const message = createBaseModuleCredential(); + message.moduleName = object.moduleName ?? ""; + message.derivationKeys = object.derivationKeys?.map(e => e) || []; + return message; + }, + fromAmino(object: ModuleCredentialAmino): ModuleCredential { + const message = createBaseModuleCredential(); + if (object.module_name !== undefined && object.module_name !== null) { + message.moduleName = object.module_name; + } + message.derivationKeys = object.derivation_keys?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: ModuleCredential): ModuleCredentialAmino { + const obj: any = {}; + obj.module_name = message.moduleName === "" ? undefined : message.moduleName; + if (message.derivationKeys) { + obj.derivation_keys = message.derivationKeys.map(e => base64FromBytes(e)); + } else { + obj.derivation_keys = message.derivationKeys; + } + return obj; + }, + fromAminoMsg(object: ModuleCredentialAminoMsg): ModuleCredential { + return ModuleCredential.fromAmino(object.value); + }, + toAminoMsg(message: ModuleCredential): ModuleCredentialAminoMsg { + return { + type: "cosmos-sdk/GroupAccountCredential", + value: ModuleCredential.toAmino(message) + }; + }, + fromProtoMsg(message: ModuleCredentialProtoMsg): ModuleCredential { + return ModuleCredential.decode(message.value); + }, + toProto(message: ModuleCredential): Uint8Array { + return ModuleCredential.encode(message).finish(); + }, + toProtoMsg(message: ModuleCredential): ModuleCredentialProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.ModuleCredential", + value: ModuleCredential.encode(message).finish() + }; + } +}; function createBaseParams(): Params { return { maxMemoCharacters: BigInt(0), @@ -399,7 +528,7 @@ export const Params = { }, toAminoMsg(message: Params): ParamsAminoMsg { return { - type: "cosmos-sdk/Params", + type: "cosmos-sdk/x/auth/Params", value: Params.toAmino(message) }; }, diff --git a/src/codegen/cosmos/auth/v1beta1/genesis.ts b/src/codegen/cosmos/auth/v1beta1/genesis.ts index 69d40c6..1cf5d4b 100644 --- a/src/codegen/cosmos/auth/v1beta1/genesis.ts +++ b/src/codegen/cosmos/auth/v1beta1/genesis.ts @@ -3,7 +3,7 @@ import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../binary"; /** GenesisState defines the auth module's genesis state. */ export interface GenesisState { - /** params defines all the paramaters of the module. */ + /** params defines all the parameters of the module. */ params: Params; /** accounts are the accounts present at genesis. */ accounts: Any[]; @@ -14,8 +14,8 @@ export interface GenesisStateProtoMsg { } /** GenesisState defines the auth module's genesis state. */ export interface GenesisStateAmino { - /** params defines all the paramaters of the module. */ - params?: ParamsAmino; + /** params defines all the parameters of the module. */ + params: ParamsAmino; /** accounts are the accounts present at genesis. */ accounts?: AnyAmino[]; } @@ -81,7 +81,7 @@ export const GenesisState = { }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.params = message.params ? Params.toAmino(message.params) : Params.toAmino(Params.fromPartial({})); if (message.accounts) { obj.accounts = message.accounts.map(e => e ? Any.toAmino(e) : undefined); } else { diff --git a/src/codegen/cosmos/auth/v1beta1/query.lcd.ts b/src/codegen/cosmos/auth/v1beta1/query.lcd.ts index c0c1478..e6507b9 100644 --- a/src/codegen/cosmos/auth/v1beta1/query.lcd.ts +++ b/src/codegen/cosmos/auth/v1beta1/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../../helpers"; import { LCDClient } from "@cosmology/lcd"; -import { QueryAccountsRequest, QueryAccountsResponseSDKType, QueryAccountRequest, QueryAccountResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType, QueryModuleAccountByNameRequest, QueryModuleAccountByNameResponseSDKType } from "./query"; +import { QueryAccountsRequest, QueryAccountsResponseSDKType, QueryAccountRequest, QueryAccountResponseSDKType, QueryAccountAddressByIDRequest, QueryAccountAddressByIDResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType, QueryModuleAccountsRequest, QueryModuleAccountsResponseSDKType, QueryModuleAccountByNameRequest, QueryModuleAccountByNameResponseSDKType, Bech32PrefixRequest, Bech32PrefixResponseSDKType, AddressBytesToStringRequest, AddressBytesToStringResponseSDKType, AddressStringToBytesRequest, AddressStringToBytesResponseSDKType, QueryAccountInfoRequest, QueryAccountInfoResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -11,10 +11,19 @@ export class LCDQueryClient { this.req = requestClient; this.accounts = this.accounts.bind(this); this.account = this.account.bind(this); + this.accountAddressByID = this.accountAddressByID.bind(this); this.params = this.params.bind(this); + this.moduleAccounts = this.moduleAccounts.bind(this); this.moduleAccountByName = this.moduleAccountByName.bind(this); + this.bech32Prefix = this.bech32Prefix.bind(this); + this.addressBytesToString = this.addressBytesToString.bind(this); + this.addressStringToBytes = this.addressStringToBytes.bind(this); + this.accountInfo = this.accountInfo.bind(this); } - /* Accounts returns all the existing accounts + /* Accounts returns all the existing accounts. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. Since: cosmos-sdk 0.43 */ async accounts(params: QueryAccountsRequest = { @@ -34,14 +43,62 @@ export class LCDQueryClient { const endpoint = `cosmos/auth/v1beta1/accounts/${params.address}`; return await this.req.get(endpoint); } + /* AccountAddressByID returns account address based on account number. + + Since: cosmos-sdk 0.46.2 */ + async accountAddressByID(params: QueryAccountAddressByIDRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.accountId !== "undefined") { + options.params.account_id = params.accountId; + } + const endpoint = `cosmos/auth/v1beta1/address_by_id/${params.id}`; + return await this.req.get(endpoint, options); + } /* Params queries all parameters. */ async params(_params: QueryParamsRequest = {}): Promise { const endpoint = `cosmos/auth/v1beta1/params`; return await this.req.get(endpoint); } + /* ModuleAccounts returns all the existing module accounts. + + Since: cosmos-sdk 0.46 */ + async moduleAccounts(_params: QueryModuleAccountsRequest = {}): Promise { + const endpoint = `cosmos/auth/v1beta1/module_accounts`; + return await this.req.get(endpoint); + } /* ModuleAccountByName returns the module account info by module name */ async moduleAccountByName(params: QueryModuleAccountByNameRequest): Promise { const endpoint = `cosmos/auth/v1beta1/module_accounts/${params.name}`; return await this.req.get(endpoint); } + /* Bech32Prefix queries bech32Prefix + + Since: cosmos-sdk 0.46 */ + async bech32Prefix(_params: Bech32PrefixRequest = {}): Promise { + const endpoint = `cosmos/auth/v1beta1/bech32`; + return await this.req.get(endpoint); + } + /* AddressBytesToString converts Account Address bytes to string + + Since: cosmos-sdk 0.46 */ + async addressBytesToString(params: AddressBytesToStringRequest): Promise { + const endpoint = `cosmos/auth/v1beta1/bech32/${params.addressBytes}`; + return await this.req.get(endpoint); + } + /* AddressStringToBytes converts Address string to bytes + + Since: cosmos-sdk 0.46 */ + async addressStringToBytes(params: AddressStringToBytesRequest): Promise { + const endpoint = `cosmos/auth/v1beta1/bech32/${params.addressString}`; + return await this.req.get(endpoint); + } + /* AccountInfo queries account info which is common to all account types. + + Since: cosmos-sdk 0.47 */ + async accountInfo(params: QueryAccountInfoRequest): Promise { + const endpoint = `cosmos/auth/v1beta1/account_info/${params.address}`; + return await this.req.get(endpoint); + } } \ No newline at end of file diff --git a/src/codegen/cosmos/auth/v1beta1/query.rpc.Query.ts b/src/codegen/cosmos/auth/v1beta1/query.rpc.Query.ts index 6372cb4..660583f 100644 --- a/src/codegen/cosmos/auth/v1beta1/query.rpc.Query.ts +++ b/src/codegen/cosmos/auth/v1beta1/query.rpc.Query.ts @@ -1,21 +1,60 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryAccountsRequest, QueryAccountsResponse, QueryAccountRequest, QueryAccountResponse, QueryParamsRequest, QueryParamsResponse, QueryModuleAccountByNameRequest, QueryModuleAccountByNameResponse } from "./query"; +import { QueryAccountsRequest, QueryAccountsResponse, QueryAccountRequest, QueryAccountResponse, QueryAccountAddressByIDRequest, QueryAccountAddressByIDResponse, QueryParamsRequest, QueryParamsResponse, QueryModuleAccountsRequest, QueryModuleAccountsResponse, QueryModuleAccountByNameRequest, QueryModuleAccountByNameResponse, Bech32PrefixRequest, Bech32PrefixResponse, AddressBytesToStringRequest, AddressBytesToStringResponse, AddressStringToBytesRequest, AddressStringToBytesResponse, QueryAccountInfoRequest, QueryAccountInfoResponse } from "./query"; /** Query defines the gRPC querier service. */ export interface Query { /** - * Accounts returns all the existing accounts + * Accounts returns all the existing accounts. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. * * Since: cosmos-sdk 0.43 */ accounts(request?: QueryAccountsRequest): Promise; /** Account returns account details based on address. */ account(request: QueryAccountRequest): Promise; + /** + * AccountAddressByID returns account address based on account number. + * + * Since: cosmos-sdk 0.46.2 + */ + accountAddressByID(request: QueryAccountAddressByIDRequest): Promise; /** Params queries all parameters. */ params(request?: QueryParamsRequest): Promise; + /** + * ModuleAccounts returns all the existing module accounts. + * + * Since: cosmos-sdk 0.46 + */ + moduleAccounts(request?: QueryModuleAccountsRequest): Promise; /** ModuleAccountByName returns the module account info by module name */ moduleAccountByName(request: QueryModuleAccountByNameRequest): Promise; + /** + * Bech32Prefix queries bech32Prefix + * + * Since: cosmos-sdk 0.46 + */ + bech32Prefix(request?: Bech32PrefixRequest): Promise; + /** + * AddressBytesToString converts Account Address bytes to string + * + * Since: cosmos-sdk 0.46 + */ + addressBytesToString(request: AddressBytesToStringRequest): Promise; + /** + * AddressStringToBytes converts Address string to bytes + * + * Since: cosmos-sdk 0.46 + */ + addressStringToBytes(request: AddressStringToBytesRequest): Promise; + /** + * AccountInfo queries account info which is common to all account types. + * + * Since: cosmos-sdk 0.47 + */ + accountInfo(request: QueryAccountInfoRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -23,8 +62,14 @@ export class QueryClientImpl implements Query { this.rpc = rpc; this.accounts = this.accounts.bind(this); this.account = this.account.bind(this); + this.accountAddressByID = this.accountAddressByID.bind(this); this.params = this.params.bind(this); + this.moduleAccounts = this.moduleAccounts.bind(this); this.moduleAccountByName = this.moduleAccountByName.bind(this); + this.bech32Prefix = this.bech32Prefix.bind(this); + this.addressBytesToString = this.addressBytesToString.bind(this); + this.addressStringToBytes = this.addressStringToBytes.bind(this); + this.accountInfo = this.accountInfo.bind(this); } accounts(request: QueryAccountsRequest = { pagination: undefined @@ -38,16 +83,46 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Account", data); return promise.then(data => QueryAccountResponse.decode(new BinaryReader(data))); } + accountAddressByID(request: QueryAccountAddressByIDRequest): Promise { + const data = QueryAccountAddressByIDRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "AccountAddressByID", data); + return promise.then(data => QueryAccountAddressByIDResponse.decode(new BinaryReader(data))); + } params(request: QueryParamsRequest = {}): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Params", data); return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); } + moduleAccounts(request: QueryModuleAccountsRequest = {}): Promise { + const data = QueryModuleAccountsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "ModuleAccounts", data); + return promise.then(data => QueryModuleAccountsResponse.decode(new BinaryReader(data))); + } moduleAccountByName(request: QueryModuleAccountByNameRequest): Promise { const data = QueryModuleAccountByNameRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "ModuleAccountByName", data); return promise.then(data => QueryModuleAccountByNameResponse.decode(new BinaryReader(data))); } + bech32Prefix(request: Bech32PrefixRequest = {}): Promise { + const data = Bech32PrefixRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "Bech32Prefix", data); + return promise.then(data => Bech32PrefixResponse.decode(new BinaryReader(data))); + } + addressBytesToString(request: AddressBytesToStringRequest): Promise { + const data = AddressBytesToStringRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "AddressBytesToString", data); + return promise.then(data => AddressBytesToStringResponse.decode(new BinaryReader(data))); + } + addressStringToBytes(request: AddressStringToBytesRequest): Promise { + const data = AddressStringToBytesRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "AddressStringToBytes", data); + return promise.then(data => AddressStringToBytesResponse.decode(new BinaryReader(data))); + } + accountInfo(request: QueryAccountInfoRequest): Promise { + const data = QueryAccountInfoRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Query", "AccountInfo", data); + return promise.then(data => QueryAccountInfoResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -59,11 +134,29 @@ export const createRpcQueryExtension = (base: QueryClient) => { account(request: QueryAccountRequest): Promise { return queryService.account(request); }, + accountAddressByID(request: QueryAccountAddressByIDRequest): Promise { + return queryService.accountAddressByID(request); + }, params(request?: QueryParamsRequest): Promise { return queryService.params(request); }, + moduleAccounts(request?: QueryModuleAccountsRequest): Promise { + return queryService.moduleAccounts(request); + }, moduleAccountByName(request: QueryModuleAccountByNameRequest): Promise { return queryService.moduleAccountByName(request); + }, + bech32Prefix(request?: Bech32PrefixRequest): Promise { + return queryService.bech32Prefix(request); + }, + addressBytesToString(request: AddressBytesToStringRequest): Promise { + return queryService.addressBytesToString(request); + }, + addressStringToBytes(request: AddressStringToBytesRequest): Promise { + return queryService.addressStringToBytes(request); + }, + accountInfo(request: QueryAccountInfoRequest): Promise { + return queryService.accountInfo(request); } }; }; \ No newline at end of file diff --git a/src/codegen/cosmos/auth/v1beta1/query.ts b/src/codegen/cosmos/auth/v1beta1/query.ts index 1a4b3e5..197f582 100644 --- a/src/codegen/cosmos/auth/v1beta1/query.ts +++ b/src/codegen/cosmos/auth/v1beta1/query.ts @@ -1,7 +1,8 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; -import { Params, ParamsAmino, ParamsSDKType } from "./auth"; +import { Params, ParamsAmino, ParamsSDKType, BaseAccount, BaseAccountAmino, BaseAccountSDKType } from "./auth"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; /** * QueryAccountsRequest is the request type for the Query/Accounts RPC method. * @@ -155,6 +156,64 @@ export interface QueryParamsResponseAminoMsg { export interface QueryParamsResponseSDKType { params: ParamsSDKType; } +/** + * QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method. + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryModuleAccountsRequest {} +export interface QueryModuleAccountsRequestProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountsRequest"; + value: Uint8Array; +} +/** + * QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method. + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryModuleAccountsRequestAmino {} +export interface QueryModuleAccountsRequestAminoMsg { + type: "cosmos-sdk/QueryModuleAccountsRequest"; + value: QueryModuleAccountsRequestAmino; +} +/** + * QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method. + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryModuleAccountsRequestSDKType {} +/** + * QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryModuleAccountsResponse { + accounts: Any[]; +} +export interface QueryModuleAccountsResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountsResponse"; + value: Uint8Array; +} +/** + * QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryModuleAccountsResponseAmino { + accounts?: AnyAmino[]; +} +export interface QueryModuleAccountsResponseAminoMsg { + type: "cosmos-sdk/QueryModuleAccountsResponse"; + value: QueryModuleAccountsResponseAmino; +} +/** + * QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryModuleAccountsResponseSDKType { + accounts: AnySDKType[]; +} /** QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method. */ export interface QueryModuleAccountByNameRequest { name: string; @@ -195,6 +254,354 @@ export interface QueryModuleAccountByNameResponseAminoMsg { export interface QueryModuleAccountByNameResponseSDKType { account?: AnySDKType; } +/** + * Bech32PrefixRequest is the request type for Bech32Prefix rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface Bech32PrefixRequest {} +export interface Bech32PrefixRequestProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixRequest"; + value: Uint8Array; +} +/** + * Bech32PrefixRequest is the request type for Bech32Prefix rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface Bech32PrefixRequestAmino {} +export interface Bech32PrefixRequestAminoMsg { + type: "cosmos-sdk/Bech32PrefixRequest"; + value: Bech32PrefixRequestAmino; +} +/** + * Bech32PrefixRequest is the request type for Bech32Prefix rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface Bech32PrefixRequestSDKType {} +/** + * Bech32PrefixResponse is the response type for Bech32Prefix rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface Bech32PrefixResponse { + bech32Prefix: string; +} +export interface Bech32PrefixResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixResponse"; + value: Uint8Array; +} +/** + * Bech32PrefixResponse is the response type for Bech32Prefix rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface Bech32PrefixResponseAmino { + bech32_prefix?: string; +} +export interface Bech32PrefixResponseAminoMsg { + type: "cosmos-sdk/Bech32PrefixResponse"; + value: Bech32PrefixResponseAmino; +} +/** + * Bech32PrefixResponse is the response type for Bech32Prefix rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface Bech32PrefixResponseSDKType { + bech32_prefix: string; +} +/** + * AddressBytesToStringRequest is the request type for AddressString rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressBytesToStringRequest { + addressBytes: Uint8Array; +} +export interface AddressBytesToStringRequestProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringRequest"; + value: Uint8Array; +} +/** + * AddressBytesToStringRequest is the request type for AddressString rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressBytesToStringRequestAmino { + address_bytes?: string; +} +export interface AddressBytesToStringRequestAminoMsg { + type: "cosmos-sdk/AddressBytesToStringRequest"; + value: AddressBytesToStringRequestAmino; +} +/** + * AddressBytesToStringRequest is the request type for AddressString rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressBytesToStringRequestSDKType { + address_bytes: Uint8Array; +} +/** + * AddressBytesToStringResponse is the response type for AddressString rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressBytesToStringResponse { + addressString: string; +} +export interface AddressBytesToStringResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringResponse"; + value: Uint8Array; +} +/** + * AddressBytesToStringResponse is the response type for AddressString rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressBytesToStringResponseAmino { + address_string?: string; +} +export interface AddressBytesToStringResponseAminoMsg { + type: "cosmos-sdk/AddressBytesToStringResponse"; + value: AddressBytesToStringResponseAmino; +} +/** + * AddressBytesToStringResponse is the response type for AddressString rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressBytesToStringResponseSDKType { + address_string: string; +} +/** + * AddressStringToBytesRequest is the request type for AccountBytes rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressStringToBytesRequest { + addressString: string; +} +export interface AddressStringToBytesRequestProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesRequest"; + value: Uint8Array; +} +/** + * AddressStringToBytesRequest is the request type for AccountBytes rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressStringToBytesRequestAmino { + address_string?: string; +} +export interface AddressStringToBytesRequestAminoMsg { + type: "cosmos-sdk/AddressStringToBytesRequest"; + value: AddressStringToBytesRequestAmino; +} +/** + * AddressStringToBytesRequest is the request type for AccountBytes rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressStringToBytesRequestSDKType { + address_string: string; +} +/** + * AddressStringToBytesResponse is the response type for AddressBytes rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressStringToBytesResponse { + addressBytes: Uint8Array; +} +export interface AddressStringToBytesResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesResponse"; + value: Uint8Array; +} +/** + * AddressStringToBytesResponse is the response type for AddressBytes rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressStringToBytesResponseAmino { + address_bytes?: string; +} +export interface AddressStringToBytesResponseAminoMsg { + type: "cosmos-sdk/AddressStringToBytesResponse"; + value: AddressStringToBytesResponseAmino; +} +/** + * AddressStringToBytesResponse is the response type for AddressBytes rpc method. + * + * Since: cosmos-sdk 0.46 + */ +export interface AddressStringToBytesResponseSDKType { + address_bytes: Uint8Array; +} +/** + * QueryAccountAddressByIDRequest is the request type for AccountAddressByID rpc method + * + * Since: cosmos-sdk 0.46.2 + */ +export interface QueryAccountAddressByIDRequest { + /** + * Deprecated, use account_id instead + * + * id is the account number of the address to be queried. This field + * should have been an uint64 (like all account numbers), and will be + * updated to uint64 in a future version of the auth query. + */ + /** @deprecated */ + id: bigint; + /** + * account_id is the account number of the address to be queried. + * + * Since: cosmos-sdk 0.47 + */ + accountId: bigint; +} +export interface QueryAccountAddressByIDRequestProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountAddressByIDRequest"; + value: Uint8Array; +} +/** + * QueryAccountAddressByIDRequest is the request type for AccountAddressByID rpc method + * + * Since: cosmos-sdk 0.46.2 + */ +export interface QueryAccountAddressByIDRequestAmino { + /** + * Deprecated, use account_id instead + * + * id is the account number of the address to be queried. This field + * should have been an uint64 (like all account numbers), and will be + * updated to uint64 in a future version of the auth query. + */ + /** @deprecated */ + id?: string; + /** + * account_id is the account number of the address to be queried. + * + * Since: cosmos-sdk 0.47 + */ + account_id?: string; +} +export interface QueryAccountAddressByIDRequestAminoMsg { + type: "cosmos-sdk/QueryAccountAddressByIDRequest"; + value: QueryAccountAddressByIDRequestAmino; +} +/** + * QueryAccountAddressByIDRequest is the request type for AccountAddressByID rpc method + * + * Since: cosmos-sdk 0.46.2 + */ +export interface QueryAccountAddressByIDRequestSDKType { + /** @deprecated */ + id: bigint; + account_id: bigint; +} +/** + * QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method + * + * Since: cosmos-sdk 0.46.2 + */ +export interface QueryAccountAddressByIDResponse { + accountAddress: string; +} +export interface QueryAccountAddressByIDResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountAddressByIDResponse"; + value: Uint8Array; +} +/** + * QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method + * + * Since: cosmos-sdk 0.46.2 + */ +export interface QueryAccountAddressByIDResponseAmino { + account_address?: string; +} +export interface QueryAccountAddressByIDResponseAminoMsg { + type: "cosmos-sdk/QueryAccountAddressByIDResponse"; + value: QueryAccountAddressByIDResponseAmino; +} +/** + * QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method + * + * Since: cosmos-sdk 0.46.2 + */ +export interface QueryAccountAddressByIDResponseSDKType { + account_address: string; +} +/** + * QueryAccountInfoRequest is the Query/AccountInfo request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface QueryAccountInfoRequest { + /** address is the account address string. */ + address: string; +} +export interface QueryAccountInfoRequestProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountInfoRequest"; + value: Uint8Array; +} +/** + * QueryAccountInfoRequest is the Query/AccountInfo request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface QueryAccountInfoRequestAmino { + /** address is the account address string. */ + address?: string; +} +export interface QueryAccountInfoRequestAminoMsg { + type: "cosmos-sdk/QueryAccountInfoRequest"; + value: QueryAccountInfoRequestAmino; +} +/** + * QueryAccountInfoRequest is the Query/AccountInfo request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface QueryAccountInfoRequestSDKType { + address: string; +} +/** + * QueryAccountInfoResponse is the Query/AccountInfo response type. + * + * Since: cosmos-sdk 0.47 + */ +export interface QueryAccountInfoResponse { + /** info is the account info which is represented by BaseAccount. */ + info?: BaseAccount; +} +export interface QueryAccountInfoResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountInfoResponse"; + value: Uint8Array; +} +/** + * QueryAccountInfoResponse is the Query/AccountInfo response type. + * + * Since: cosmos-sdk 0.47 + */ +export interface QueryAccountInfoResponseAmino { + /** info is the account info which is represented by BaseAccount. */ + info?: BaseAccountAmino; +} +export interface QueryAccountInfoResponseAminoMsg { + type: "cosmos-sdk/QueryAccountInfoResponse"; + value: QueryAccountInfoResponseAmino; +} +/** + * QueryAccountInfoResponse is the Query/AccountInfo response type. + * + * Since: cosmos-sdk 0.47 + */ +export interface QueryAccountInfoResponseSDKType { + info?: BaseAccountSDKType; +} function createBaseQueryAccountsRequest(): QueryAccountsRequest { return { pagination: undefined @@ -610,29 +1017,21 @@ export const QueryParamsResponse = { }; } }; -function createBaseQueryModuleAccountByNameRequest(): QueryModuleAccountByNameRequest { - return { - name: "" - }; +function createBaseQueryModuleAccountsRequest(): QueryModuleAccountsRequest { + return {}; } -export const QueryModuleAccountByNameRequest = { - typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameRequest", - encode(message: QueryModuleAccountByNameRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } +export const QueryModuleAccountsRequest = { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountsRequest", + encode(_: QueryModuleAccountsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleAccountByNameRequest { + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleAccountsRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryModuleAccountByNameRequest(); + const message = createBaseQueryModuleAccountsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -640,67 +1039,62 @@ export const QueryModuleAccountByNameRequest = { } return message; }, - fromPartial(object: Partial): QueryModuleAccountByNameRequest { - const message = createBaseQueryModuleAccountByNameRequest(); - message.name = object.name ?? ""; + fromPartial(_: Partial): QueryModuleAccountsRequest { + const message = createBaseQueryModuleAccountsRequest(); return message; }, - fromAmino(object: QueryModuleAccountByNameRequestAmino): QueryModuleAccountByNameRequest { - const message = createBaseQueryModuleAccountByNameRequest(); - if (object.name !== undefined && object.name !== null) { - message.name = object.name; - } + fromAmino(_: QueryModuleAccountsRequestAmino): QueryModuleAccountsRequest { + const message = createBaseQueryModuleAccountsRequest(); return message; }, - toAmino(message: QueryModuleAccountByNameRequest): QueryModuleAccountByNameRequestAmino { + toAmino(_: QueryModuleAccountsRequest): QueryModuleAccountsRequestAmino { const obj: any = {}; - obj.name = message.name === "" ? undefined : message.name; return obj; }, - fromAminoMsg(object: QueryModuleAccountByNameRequestAminoMsg): QueryModuleAccountByNameRequest { - return QueryModuleAccountByNameRequest.fromAmino(object.value); + fromAminoMsg(object: QueryModuleAccountsRequestAminoMsg): QueryModuleAccountsRequest { + return QueryModuleAccountsRequest.fromAmino(object.value); }, - toAminoMsg(message: QueryModuleAccountByNameRequest): QueryModuleAccountByNameRequestAminoMsg { + toAminoMsg(message: QueryModuleAccountsRequest): QueryModuleAccountsRequestAminoMsg { return { - type: "cosmos-sdk/QueryModuleAccountByNameRequest", - value: QueryModuleAccountByNameRequest.toAmino(message) + type: "cosmos-sdk/QueryModuleAccountsRequest", + value: QueryModuleAccountsRequest.toAmino(message) }; }, - fromProtoMsg(message: QueryModuleAccountByNameRequestProtoMsg): QueryModuleAccountByNameRequest { - return QueryModuleAccountByNameRequest.decode(message.value); + fromProtoMsg(message: QueryModuleAccountsRequestProtoMsg): QueryModuleAccountsRequest { + return QueryModuleAccountsRequest.decode(message.value); }, - toProto(message: QueryModuleAccountByNameRequest): Uint8Array { - return QueryModuleAccountByNameRequest.encode(message).finish(); + toProto(message: QueryModuleAccountsRequest): Uint8Array { + return QueryModuleAccountsRequest.encode(message).finish(); }, - toProtoMsg(message: QueryModuleAccountByNameRequest): QueryModuleAccountByNameRequestProtoMsg { + toProtoMsg(message: QueryModuleAccountsRequest): QueryModuleAccountsRequestProtoMsg { return { - typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameRequest", - value: QueryModuleAccountByNameRequest.encode(message).finish() + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountsRequest", + value: QueryModuleAccountsRequest.encode(message).finish() }; } }; -function createBaseQueryModuleAccountByNameResponse(): QueryModuleAccountByNameResponse { +function createBaseQueryModuleAccountsResponse(): QueryModuleAccountsResponse { return { - account: undefined + accounts: [] }; } -export const QueryModuleAccountByNameResponse = { - typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameResponse", - encode(message: QueryModuleAccountByNameResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.account !== undefined) { - Any.encode(message.account, writer.uint32(10).fork()).ldelim(); +export const QueryModuleAccountsResponse = { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountsResponse", + encode(message: QueryModuleAccountsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.accounts) { + Any.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleAccountByNameResponse { + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleAccountsResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryModuleAccountByNameResponse(); + const message = createBaseQueryModuleAccountsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.account = Any.decode(reader, reader.uint32()); + message.accounts.push(Any.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -709,36 +1103,176 @@ export const QueryModuleAccountByNameResponse = { } return message; }, - fromPartial(object: Partial): QueryModuleAccountByNameResponse { - const message = createBaseQueryModuleAccountByNameResponse(); - message.account = object.account !== undefined && object.account !== null ? Any.fromPartial(object.account) : undefined; + fromPartial(object: Partial): QueryModuleAccountsResponse { + const message = createBaseQueryModuleAccountsResponse(); + message.accounts = object.accounts?.map(e => Any.fromPartial(e)) || []; return message; }, - fromAmino(object: QueryModuleAccountByNameResponseAmino): QueryModuleAccountByNameResponse { - const message = createBaseQueryModuleAccountByNameResponse(); - if (object.account !== undefined && object.account !== null) { - message.account = Any.fromAmino(object.account); - } + fromAmino(object: QueryModuleAccountsResponseAmino): QueryModuleAccountsResponse { + const message = createBaseQueryModuleAccountsResponse(); + message.accounts = object.accounts?.map(e => Any.fromAmino(e)) || []; return message; }, - toAmino(message: QueryModuleAccountByNameResponse): QueryModuleAccountByNameResponseAmino { + toAmino(message: QueryModuleAccountsResponse): QueryModuleAccountsResponseAmino { const obj: any = {}; - obj.account = message.account ? Any.toAmino(message.account) : undefined; + if (message.accounts) { + obj.accounts = message.accounts.map(e => e ? Any.toAmino(e) : undefined); + } else { + obj.accounts = message.accounts; + } return obj; }, - fromAminoMsg(object: QueryModuleAccountByNameResponseAminoMsg): QueryModuleAccountByNameResponse { - return QueryModuleAccountByNameResponse.fromAmino(object.value); + fromAminoMsg(object: QueryModuleAccountsResponseAminoMsg): QueryModuleAccountsResponse { + return QueryModuleAccountsResponse.fromAmino(object.value); }, - toAminoMsg(message: QueryModuleAccountByNameResponse): QueryModuleAccountByNameResponseAminoMsg { + toAminoMsg(message: QueryModuleAccountsResponse): QueryModuleAccountsResponseAminoMsg { return { - type: "cosmos-sdk/QueryModuleAccountByNameResponse", - value: QueryModuleAccountByNameResponse.toAmino(message) + type: "cosmos-sdk/QueryModuleAccountsResponse", + value: QueryModuleAccountsResponse.toAmino(message) }; }, - fromProtoMsg(message: QueryModuleAccountByNameResponseProtoMsg): QueryModuleAccountByNameResponse { - return QueryModuleAccountByNameResponse.decode(message.value); + fromProtoMsg(message: QueryModuleAccountsResponseProtoMsg): QueryModuleAccountsResponse { + return QueryModuleAccountsResponse.decode(message.value); }, - toProto(message: QueryModuleAccountByNameResponse): Uint8Array { + toProto(message: QueryModuleAccountsResponse): Uint8Array { + return QueryModuleAccountsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleAccountsResponse): QueryModuleAccountsResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountsResponse", + value: QueryModuleAccountsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryModuleAccountByNameRequest(): QueryModuleAccountByNameRequest { + return { + name: "" + }; +} +export const QueryModuleAccountByNameRequest = { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameRequest", + encode(message: QueryModuleAccountByNameRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleAccountByNameRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleAccountByNameRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryModuleAccountByNameRequest { + const message = createBaseQueryModuleAccountByNameRequest(); + message.name = object.name ?? ""; + return message; + }, + fromAmino(object: QueryModuleAccountByNameRequestAmino): QueryModuleAccountByNameRequest { + const message = createBaseQueryModuleAccountByNameRequest(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + return message; + }, + toAmino(message: QueryModuleAccountByNameRequest): QueryModuleAccountByNameRequestAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + return obj; + }, + fromAminoMsg(object: QueryModuleAccountByNameRequestAminoMsg): QueryModuleAccountByNameRequest { + return QueryModuleAccountByNameRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryModuleAccountByNameRequest): QueryModuleAccountByNameRequestAminoMsg { + return { + type: "cosmos-sdk/QueryModuleAccountByNameRequest", + value: QueryModuleAccountByNameRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryModuleAccountByNameRequestProtoMsg): QueryModuleAccountByNameRequest { + return QueryModuleAccountByNameRequest.decode(message.value); + }, + toProto(message: QueryModuleAccountByNameRequest): Uint8Array { + return QueryModuleAccountByNameRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryModuleAccountByNameRequest): QueryModuleAccountByNameRequestProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameRequest", + value: QueryModuleAccountByNameRequest.encode(message).finish() + }; + } +}; +function createBaseQueryModuleAccountByNameResponse(): QueryModuleAccountByNameResponse { + return { + account: undefined + }; +} +export const QueryModuleAccountByNameResponse = { + typeUrl: "/cosmos.auth.v1beta1.QueryModuleAccountByNameResponse", + encode(message: QueryModuleAccountByNameResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.account !== undefined) { + Any.encode(message.account, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryModuleAccountByNameResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryModuleAccountByNameResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.account = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryModuleAccountByNameResponse { + const message = createBaseQueryModuleAccountByNameResponse(); + message.account = object.account !== undefined && object.account !== null ? Any.fromPartial(object.account) : undefined; + return message; + }, + fromAmino(object: QueryModuleAccountByNameResponseAmino): QueryModuleAccountByNameResponse { + const message = createBaseQueryModuleAccountByNameResponse(); + if (object.account !== undefined && object.account !== null) { + message.account = Any.fromAmino(object.account); + } + return message; + }, + toAmino(message: QueryModuleAccountByNameResponse): QueryModuleAccountByNameResponseAmino { + const obj: any = {}; + obj.account = message.account ? Any.toAmino(message.account) : undefined; + return obj; + }, + fromAminoMsg(object: QueryModuleAccountByNameResponseAminoMsg): QueryModuleAccountByNameResponse { + return QueryModuleAccountByNameResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryModuleAccountByNameResponse): QueryModuleAccountByNameResponseAminoMsg { + return { + type: "cosmos-sdk/QueryModuleAccountByNameResponse", + value: QueryModuleAccountByNameResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryModuleAccountByNameResponseProtoMsg): QueryModuleAccountByNameResponse { + return QueryModuleAccountByNameResponse.decode(message.value); + }, + toProto(message: QueryModuleAccountByNameResponse): Uint8Array { return QueryModuleAccountByNameResponse.encode(message).finish(); }, toProtoMsg(message: QueryModuleAccountByNameResponse): QueryModuleAccountByNameResponseProtoMsg { @@ -747,4 +1281,693 @@ export const QueryModuleAccountByNameResponse = { value: QueryModuleAccountByNameResponse.encode(message).finish() }; } +}; +function createBaseBech32PrefixRequest(): Bech32PrefixRequest { + return {}; +} +export const Bech32PrefixRequest = { + typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixRequest", + encode(_: Bech32PrefixRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Bech32PrefixRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBech32PrefixRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): Bech32PrefixRequest { + const message = createBaseBech32PrefixRequest(); + return message; + }, + fromAmino(_: Bech32PrefixRequestAmino): Bech32PrefixRequest { + const message = createBaseBech32PrefixRequest(); + return message; + }, + toAmino(_: Bech32PrefixRequest): Bech32PrefixRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: Bech32PrefixRequestAminoMsg): Bech32PrefixRequest { + return Bech32PrefixRequest.fromAmino(object.value); + }, + toAminoMsg(message: Bech32PrefixRequest): Bech32PrefixRequestAminoMsg { + return { + type: "cosmos-sdk/Bech32PrefixRequest", + value: Bech32PrefixRequest.toAmino(message) + }; + }, + fromProtoMsg(message: Bech32PrefixRequestProtoMsg): Bech32PrefixRequest { + return Bech32PrefixRequest.decode(message.value); + }, + toProto(message: Bech32PrefixRequest): Uint8Array { + return Bech32PrefixRequest.encode(message).finish(); + }, + toProtoMsg(message: Bech32PrefixRequest): Bech32PrefixRequestProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixRequest", + value: Bech32PrefixRequest.encode(message).finish() + }; + } +}; +function createBaseBech32PrefixResponse(): Bech32PrefixResponse { + return { + bech32Prefix: "" + }; +} +export const Bech32PrefixResponse = { + typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixResponse", + encode(message: Bech32PrefixResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bech32Prefix !== "") { + writer.uint32(10).string(message.bech32Prefix); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Bech32PrefixResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBech32PrefixResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bech32Prefix = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Bech32PrefixResponse { + const message = createBaseBech32PrefixResponse(); + message.bech32Prefix = object.bech32Prefix ?? ""; + return message; + }, + fromAmino(object: Bech32PrefixResponseAmino): Bech32PrefixResponse { + const message = createBaseBech32PrefixResponse(); + if (object.bech32_prefix !== undefined && object.bech32_prefix !== null) { + message.bech32Prefix = object.bech32_prefix; + } + return message; + }, + toAmino(message: Bech32PrefixResponse): Bech32PrefixResponseAmino { + const obj: any = {}; + obj.bech32_prefix = message.bech32Prefix === "" ? undefined : message.bech32Prefix; + return obj; + }, + fromAminoMsg(object: Bech32PrefixResponseAminoMsg): Bech32PrefixResponse { + return Bech32PrefixResponse.fromAmino(object.value); + }, + toAminoMsg(message: Bech32PrefixResponse): Bech32PrefixResponseAminoMsg { + return { + type: "cosmos-sdk/Bech32PrefixResponse", + value: Bech32PrefixResponse.toAmino(message) + }; + }, + fromProtoMsg(message: Bech32PrefixResponseProtoMsg): Bech32PrefixResponse { + return Bech32PrefixResponse.decode(message.value); + }, + toProto(message: Bech32PrefixResponse): Uint8Array { + return Bech32PrefixResponse.encode(message).finish(); + }, + toProtoMsg(message: Bech32PrefixResponse): Bech32PrefixResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.Bech32PrefixResponse", + value: Bech32PrefixResponse.encode(message).finish() + }; + } +}; +function createBaseAddressBytesToStringRequest(): AddressBytesToStringRequest { + return { + addressBytes: new Uint8Array() + }; +} +export const AddressBytesToStringRequest = { + typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringRequest", + encode(message: AddressBytesToStringRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.addressBytes.length !== 0) { + writer.uint32(10).bytes(message.addressBytes); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AddressBytesToStringRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAddressBytesToStringRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.addressBytes = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AddressBytesToStringRequest { + const message = createBaseAddressBytesToStringRequest(); + message.addressBytes = object.addressBytes ?? new Uint8Array(); + return message; + }, + fromAmino(object: AddressBytesToStringRequestAmino): AddressBytesToStringRequest { + const message = createBaseAddressBytesToStringRequest(); + if (object.address_bytes !== undefined && object.address_bytes !== null) { + message.addressBytes = bytesFromBase64(object.address_bytes); + } + return message; + }, + toAmino(message: AddressBytesToStringRequest): AddressBytesToStringRequestAmino { + const obj: any = {}; + obj.address_bytes = message.addressBytes ? base64FromBytes(message.addressBytes) : undefined; + return obj; + }, + fromAminoMsg(object: AddressBytesToStringRequestAminoMsg): AddressBytesToStringRequest { + return AddressBytesToStringRequest.fromAmino(object.value); + }, + toAminoMsg(message: AddressBytesToStringRequest): AddressBytesToStringRequestAminoMsg { + return { + type: "cosmos-sdk/AddressBytesToStringRequest", + value: AddressBytesToStringRequest.toAmino(message) + }; + }, + fromProtoMsg(message: AddressBytesToStringRequestProtoMsg): AddressBytesToStringRequest { + return AddressBytesToStringRequest.decode(message.value); + }, + toProto(message: AddressBytesToStringRequest): Uint8Array { + return AddressBytesToStringRequest.encode(message).finish(); + }, + toProtoMsg(message: AddressBytesToStringRequest): AddressBytesToStringRequestProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringRequest", + value: AddressBytesToStringRequest.encode(message).finish() + }; + } +}; +function createBaseAddressBytesToStringResponse(): AddressBytesToStringResponse { + return { + addressString: "" + }; +} +export const AddressBytesToStringResponse = { + typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringResponse", + encode(message: AddressBytesToStringResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.addressString !== "") { + writer.uint32(10).string(message.addressString); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AddressBytesToStringResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAddressBytesToStringResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.addressString = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AddressBytesToStringResponse { + const message = createBaseAddressBytesToStringResponse(); + message.addressString = object.addressString ?? ""; + return message; + }, + fromAmino(object: AddressBytesToStringResponseAmino): AddressBytesToStringResponse { + const message = createBaseAddressBytesToStringResponse(); + if (object.address_string !== undefined && object.address_string !== null) { + message.addressString = object.address_string; + } + return message; + }, + toAmino(message: AddressBytesToStringResponse): AddressBytesToStringResponseAmino { + const obj: any = {}; + obj.address_string = message.addressString === "" ? undefined : message.addressString; + return obj; + }, + fromAminoMsg(object: AddressBytesToStringResponseAminoMsg): AddressBytesToStringResponse { + return AddressBytesToStringResponse.fromAmino(object.value); + }, + toAminoMsg(message: AddressBytesToStringResponse): AddressBytesToStringResponseAminoMsg { + return { + type: "cosmos-sdk/AddressBytesToStringResponse", + value: AddressBytesToStringResponse.toAmino(message) + }; + }, + fromProtoMsg(message: AddressBytesToStringResponseProtoMsg): AddressBytesToStringResponse { + return AddressBytesToStringResponse.decode(message.value); + }, + toProto(message: AddressBytesToStringResponse): Uint8Array { + return AddressBytesToStringResponse.encode(message).finish(); + }, + toProtoMsg(message: AddressBytesToStringResponse): AddressBytesToStringResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.AddressBytesToStringResponse", + value: AddressBytesToStringResponse.encode(message).finish() + }; + } +}; +function createBaseAddressStringToBytesRequest(): AddressStringToBytesRequest { + return { + addressString: "" + }; +} +export const AddressStringToBytesRequest = { + typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesRequest", + encode(message: AddressStringToBytesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.addressString !== "") { + writer.uint32(10).string(message.addressString); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AddressStringToBytesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAddressStringToBytesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.addressString = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AddressStringToBytesRequest { + const message = createBaseAddressStringToBytesRequest(); + message.addressString = object.addressString ?? ""; + return message; + }, + fromAmino(object: AddressStringToBytesRequestAmino): AddressStringToBytesRequest { + const message = createBaseAddressStringToBytesRequest(); + if (object.address_string !== undefined && object.address_string !== null) { + message.addressString = object.address_string; + } + return message; + }, + toAmino(message: AddressStringToBytesRequest): AddressStringToBytesRequestAmino { + const obj: any = {}; + obj.address_string = message.addressString === "" ? undefined : message.addressString; + return obj; + }, + fromAminoMsg(object: AddressStringToBytesRequestAminoMsg): AddressStringToBytesRequest { + return AddressStringToBytesRequest.fromAmino(object.value); + }, + toAminoMsg(message: AddressStringToBytesRequest): AddressStringToBytesRequestAminoMsg { + return { + type: "cosmos-sdk/AddressStringToBytesRequest", + value: AddressStringToBytesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: AddressStringToBytesRequestProtoMsg): AddressStringToBytesRequest { + return AddressStringToBytesRequest.decode(message.value); + }, + toProto(message: AddressStringToBytesRequest): Uint8Array { + return AddressStringToBytesRequest.encode(message).finish(); + }, + toProtoMsg(message: AddressStringToBytesRequest): AddressStringToBytesRequestProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesRequest", + value: AddressStringToBytesRequest.encode(message).finish() + }; + } +}; +function createBaseAddressStringToBytesResponse(): AddressStringToBytesResponse { + return { + addressBytes: new Uint8Array() + }; +} +export const AddressStringToBytesResponse = { + typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesResponse", + encode(message: AddressStringToBytesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.addressBytes.length !== 0) { + writer.uint32(10).bytes(message.addressBytes); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AddressStringToBytesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAddressStringToBytesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.addressBytes = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AddressStringToBytesResponse { + const message = createBaseAddressStringToBytesResponse(); + message.addressBytes = object.addressBytes ?? new Uint8Array(); + return message; + }, + fromAmino(object: AddressStringToBytesResponseAmino): AddressStringToBytesResponse { + const message = createBaseAddressStringToBytesResponse(); + if (object.address_bytes !== undefined && object.address_bytes !== null) { + message.addressBytes = bytesFromBase64(object.address_bytes); + } + return message; + }, + toAmino(message: AddressStringToBytesResponse): AddressStringToBytesResponseAmino { + const obj: any = {}; + obj.address_bytes = message.addressBytes ? base64FromBytes(message.addressBytes) : undefined; + return obj; + }, + fromAminoMsg(object: AddressStringToBytesResponseAminoMsg): AddressStringToBytesResponse { + return AddressStringToBytesResponse.fromAmino(object.value); + }, + toAminoMsg(message: AddressStringToBytesResponse): AddressStringToBytesResponseAminoMsg { + return { + type: "cosmos-sdk/AddressStringToBytesResponse", + value: AddressStringToBytesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: AddressStringToBytesResponseProtoMsg): AddressStringToBytesResponse { + return AddressStringToBytesResponse.decode(message.value); + }, + toProto(message: AddressStringToBytesResponse): Uint8Array { + return AddressStringToBytesResponse.encode(message).finish(); + }, + toProtoMsg(message: AddressStringToBytesResponse): AddressStringToBytesResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.AddressStringToBytesResponse", + value: AddressStringToBytesResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAccountAddressByIDRequest(): QueryAccountAddressByIDRequest { + return { + id: BigInt(0), + accountId: BigInt(0) + }; +} +export const QueryAccountAddressByIDRequest = { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountAddressByIDRequest", + encode(message: QueryAccountAddressByIDRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { + writer.uint32(8).int64(message.id); + } + if (message.accountId !== BigInt(0)) { + writer.uint32(16).uint64(message.accountId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountAddressByIDRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountAddressByIDRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.int64(); + break; + case 2: + message.accountId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAccountAddressByIDRequest { + const message = createBaseQueryAccountAddressByIDRequest(); + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); + message.accountId = object.accountId !== undefined && object.accountId !== null ? BigInt(object.accountId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryAccountAddressByIDRequestAmino): QueryAccountAddressByIDRequest { + const message = createBaseQueryAccountAddressByIDRequest(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.account_id !== undefined && object.account_id !== null) { + message.accountId = BigInt(object.account_id); + } + return message; + }, + toAmino(message: QueryAccountAddressByIDRequest): QueryAccountAddressByIDRequestAmino { + const obj: any = {}; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + obj.account_id = message.accountId !== BigInt(0) ? message.accountId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryAccountAddressByIDRequestAminoMsg): QueryAccountAddressByIDRequest { + return QueryAccountAddressByIDRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAccountAddressByIDRequest): QueryAccountAddressByIDRequestAminoMsg { + return { + type: "cosmos-sdk/QueryAccountAddressByIDRequest", + value: QueryAccountAddressByIDRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAccountAddressByIDRequestProtoMsg): QueryAccountAddressByIDRequest { + return QueryAccountAddressByIDRequest.decode(message.value); + }, + toProto(message: QueryAccountAddressByIDRequest): Uint8Array { + return QueryAccountAddressByIDRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountAddressByIDRequest): QueryAccountAddressByIDRequestProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountAddressByIDRequest", + value: QueryAccountAddressByIDRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAccountAddressByIDResponse(): QueryAccountAddressByIDResponse { + return { + accountAddress: "" + }; +} +export const QueryAccountAddressByIDResponse = { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountAddressByIDResponse", + encode(message: QueryAccountAddressByIDResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.accountAddress !== "") { + writer.uint32(10).string(message.accountAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountAddressByIDResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountAddressByIDResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accountAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAccountAddressByIDResponse { + const message = createBaseQueryAccountAddressByIDResponse(); + message.accountAddress = object.accountAddress ?? ""; + return message; + }, + fromAmino(object: QueryAccountAddressByIDResponseAmino): QueryAccountAddressByIDResponse { + const message = createBaseQueryAccountAddressByIDResponse(); + if (object.account_address !== undefined && object.account_address !== null) { + message.accountAddress = object.account_address; + } + return message; + }, + toAmino(message: QueryAccountAddressByIDResponse): QueryAccountAddressByIDResponseAmino { + const obj: any = {}; + obj.account_address = message.accountAddress === "" ? undefined : message.accountAddress; + return obj; + }, + fromAminoMsg(object: QueryAccountAddressByIDResponseAminoMsg): QueryAccountAddressByIDResponse { + return QueryAccountAddressByIDResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAccountAddressByIDResponse): QueryAccountAddressByIDResponseAminoMsg { + return { + type: "cosmos-sdk/QueryAccountAddressByIDResponse", + value: QueryAccountAddressByIDResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAccountAddressByIDResponseProtoMsg): QueryAccountAddressByIDResponse { + return QueryAccountAddressByIDResponse.decode(message.value); + }, + toProto(message: QueryAccountAddressByIDResponse): Uint8Array { + return QueryAccountAddressByIDResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountAddressByIDResponse): QueryAccountAddressByIDResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountAddressByIDResponse", + value: QueryAccountAddressByIDResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAccountInfoRequest(): QueryAccountInfoRequest { + return { + address: "" + }; +} +export const QueryAccountInfoRequest = { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountInfoRequest", + encode(message: QueryAccountInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAccountInfoRequest { + const message = createBaseQueryAccountInfoRequest(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryAccountInfoRequestAmino): QueryAccountInfoRequest { + const message = createBaseQueryAccountInfoRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryAccountInfoRequest): QueryAccountInfoRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: QueryAccountInfoRequestAminoMsg): QueryAccountInfoRequest { + return QueryAccountInfoRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAccountInfoRequest): QueryAccountInfoRequestAminoMsg { + return { + type: "cosmos-sdk/QueryAccountInfoRequest", + value: QueryAccountInfoRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAccountInfoRequestProtoMsg): QueryAccountInfoRequest { + return QueryAccountInfoRequest.decode(message.value); + }, + toProto(message: QueryAccountInfoRequest): Uint8Array { + return QueryAccountInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountInfoRequest): QueryAccountInfoRequestProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountInfoRequest", + value: QueryAccountInfoRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAccountInfoResponse(): QueryAccountInfoResponse { + return { + info: undefined + }; +} +export const QueryAccountInfoResponse = { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountInfoResponse", + encode(message: QueryAccountInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.info !== undefined) { + BaseAccount.encode(message.info, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.info = BaseAccount.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAccountInfoResponse { + const message = createBaseQueryAccountInfoResponse(); + message.info = object.info !== undefined && object.info !== null ? BaseAccount.fromPartial(object.info) : undefined; + return message; + }, + fromAmino(object: QueryAccountInfoResponseAmino): QueryAccountInfoResponse { + const message = createBaseQueryAccountInfoResponse(); + if (object.info !== undefined && object.info !== null) { + message.info = BaseAccount.fromAmino(object.info); + } + return message; + }, + toAmino(message: QueryAccountInfoResponse): QueryAccountInfoResponseAmino { + const obj: any = {}; + obj.info = message.info ? BaseAccount.toAmino(message.info) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAccountInfoResponseAminoMsg): QueryAccountInfoResponse { + return QueryAccountInfoResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAccountInfoResponse): QueryAccountInfoResponseAminoMsg { + return { + type: "cosmos-sdk/QueryAccountInfoResponse", + value: QueryAccountInfoResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAccountInfoResponseProtoMsg): QueryAccountInfoResponse { + return QueryAccountInfoResponse.decode(message.value); + }, + toProto(message: QueryAccountInfoResponse): Uint8Array { + return QueryAccountInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountInfoResponse): QueryAccountInfoResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.QueryAccountInfoResponse", + value: QueryAccountInfoResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/src/codegen/cosmos/auth/v1beta1/tx.amino.ts b/src/codegen/cosmos/auth/v1beta1/tx.amino.ts new file mode 100644 index 0000000..7232edd --- /dev/null +++ b/src/codegen/cosmos/auth/v1beta1/tx.amino.ts @@ -0,0 +1,8 @@ +import { MsgUpdateParams } from "./tx"; +export const AminoConverter = { + "/cosmos.auth.v1beta1.MsgUpdateParams": { + aminoType: "cosmos-sdk/x/auth/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/auth/v1beta1/tx.registry.ts b/src/codegen/cosmos/auth/v1beta1/tx.registry.ts new file mode 100644 index 0000000..edbacd6 --- /dev/null +++ b/src/codegen/cosmos/auth/v1beta1/tx.registry.ts @@ -0,0 +1,34 @@ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.auth.v1beta1.MsgUpdateParams", MsgUpdateParams]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + } + }, + withTypeUrl: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParams", + value + }; + } + }, + fromPartial: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/auth/v1beta1/tx.rpc.msg.ts b/src/codegen/cosmos/auth/v1beta1/tx.rpc.msg.ts new file mode 100644 index 0000000..b9576b3 --- /dev/null +++ b/src/codegen/cosmos/auth/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,25 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; +/** Msg defines the x/auth Msg service. */ +export interface Msg { + /** + * UpdateParams defines a (governance) operation for updating the x/auth module + * parameters. The authority defaults to the x/gov module account. + * + * Since: cosmos-sdk 0.47 + */ + updateParams(request: MsgUpdateParams): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.updateParams = this.updateParams.bind(this); + } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("cosmos.auth.v1beta1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/src/codegen/cosmos/auth/v1beta1/tx.ts b/src/codegen/cosmos/auth/v1beta1/tx.ts new file mode 100644 index 0000000..1926437 --- /dev/null +++ b/src/codegen/cosmos/auth/v1beta1/tx.ts @@ -0,0 +1,215 @@ +import { Params, ParamsAmino, ParamsSDKType } from "./auth"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** + * params defines the x/auth parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParams"; + value: Uint8Array; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; + /** + * params defines the x/auth parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/x/auth/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsSDKType; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseSDKType {} +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.params = message.params ? Params.toAmino(message.params) : Params.toAmino(Params.fromPartial({})); + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/x/auth/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/cosmos.auth.v1beta1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/authz/v1beta1/authz.ts b/src/codegen/cosmos/authz/v1beta1/authz.ts index 23e5015..cd5eb59 100644 --- a/src/codegen/cosmos/authz/v1beta1/authz.ts +++ b/src/codegen/cosmos/authz/v1beta1/authz.ts @@ -39,7 +39,12 @@ export interface GenericAuthorizationSDKType { */ export interface Grant { authorization?: Any; - expiration: Date; + /** + * time when the grant will expire and will be pruned. If null, then the grant + * doesn't have a time expiration (other conditions in `authorization` + * may apply to invalidate the grant) + */ + expiration?: Date; } export interface GrantProtoMsg { typeUrl: "/cosmos.authz.v1beta1.Grant"; @@ -51,6 +56,11 @@ export interface GrantProtoMsg { */ export interface GrantAmino { authorization?: AnyAmino; + /** + * time when the grant will expire and will be pruned. If null, then the grant + * doesn't have a time expiration (other conditions in `authorization` + * may apply to invalidate the grant) + */ expiration?: string; } export interface GrantAminoMsg { @@ -63,19 +73,17 @@ export interface GrantAminoMsg { */ export interface GrantSDKType { authorization?: AnySDKType; - expiration: Date; + expiration?: Date; } /** * GrantAuthorization extends a grant with both the addresses of the grantee and granter. * It is used in genesis.proto and query.proto - * - * Since: cosmos-sdk 0.45.2 */ export interface GrantAuthorization { granter: string; grantee: string; authorization?: Any; - expiration: Date; + expiration?: Date; } export interface GrantAuthorizationProtoMsg { typeUrl: "/cosmos.authz.v1beta1.GrantAuthorization"; @@ -84,8 +92,6 @@ export interface GrantAuthorizationProtoMsg { /** * GrantAuthorization extends a grant with both the addresses of the grantee and granter. * It is used in genesis.proto and query.proto - * - * Since: cosmos-sdk 0.45.2 */ export interface GrantAuthorizationAmino { granter?: string; @@ -100,14 +106,34 @@ export interface GrantAuthorizationAminoMsg { /** * GrantAuthorization extends a grant with both the addresses of the grantee and granter. * It is used in genesis.proto and query.proto - * - * Since: cosmos-sdk 0.45.2 */ export interface GrantAuthorizationSDKType { granter: string; grantee: string; authorization?: AnySDKType; - expiration: Date; + expiration?: Date; +} +/** GrantQueueItem contains the list of TypeURL of a sdk.Msg. */ +export interface GrantQueueItem { + /** msg_type_urls contains the list of TypeURL of a sdk.Msg. */ + msgTypeUrls: string[]; +} +export interface GrantQueueItemProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.GrantQueueItem"; + value: Uint8Array; +} +/** GrantQueueItem contains the list of TypeURL of a sdk.Msg. */ +export interface GrantQueueItemAmino { + /** msg_type_urls contains the list of TypeURL of a sdk.Msg. */ + msg_type_urls?: string[]; +} +export interface GrantQueueItemAminoMsg { + type: "cosmos-sdk/GrantQueueItem"; + value: GrantQueueItemAmino; +} +/** GrantQueueItem contains the list of TypeURL of a sdk.Msg. */ +export interface GrantQueueItemSDKType { + msg_type_urls: string[]; } function createBaseGenericAuthorization(): GenericAuthorization { return { @@ -181,7 +207,7 @@ export const GenericAuthorization = { function createBaseGrant(): Grant { return { authorization: undefined, - expiration: new Date() + expiration: undefined }; } export const Grant = { @@ -264,7 +290,7 @@ function createBaseGrantAuthorization(): GrantAuthorization { granter: "", grantee: "", authorization: undefined, - expiration: new Date() + expiration: undefined }; } export const GrantAuthorization = { @@ -363,4 +389,75 @@ export const GrantAuthorization = { value: GrantAuthorization.encode(message).finish() }; } +}; +function createBaseGrantQueueItem(): GrantQueueItem { + return { + msgTypeUrls: [] + }; +} +export const GrantQueueItem = { + typeUrl: "/cosmos.authz.v1beta1.GrantQueueItem", + encode(message: GrantQueueItem, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.msgTypeUrls) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GrantQueueItem { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGrantQueueItem(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.msgTypeUrls.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GrantQueueItem { + const message = createBaseGrantQueueItem(); + message.msgTypeUrls = object.msgTypeUrls?.map(e => e) || []; + return message; + }, + fromAmino(object: GrantQueueItemAmino): GrantQueueItem { + const message = createBaseGrantQueueItem(); + message.msgTypeUrls = object.msg_type_urls?.map(e => e) || []; + return message; + }, + toAmino(message: GrantQueueItem): GrantQueueItemAmino { + const obj: any = {}; + if (message.msgTypeUrls) { + obj.msg_type_urls = message.msgTypeUrls.map(e => e); + } else { + obj.msg_type_urls = message.msgTypeUrls; + } + return obj; + }, + fromAminoMsg(object: GrantQueueItemAminoMsg): GrantQueueItem { + return GrantQueueItem.fromAmino(object.value); + }, + toAminoMsg(message: GrantQueueItem): GrantQueueItemAminoMsg { + return { + type: "cosmos-sdk/GrantQueueItem", + value: GrantQueueItem.toAmino(message) + }; + }, + fromProtoMsg(message: GrantQueueItemProtoMsg): GrantQueueItem { + return GrantQueueItem.decode(message.value); + }, + toProto(message: GrantQueueItem): Uint8Array { + return GrantQueueItem.encode(message).finish(); + }, + toProtoMsg(message: GrantQueueItem): GrantQueueItemProtoMsg { + return { + typeUrl: "/cosmos.authz.v1beta1.GrantQueueItem", + value: GrantQueueItem.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/src/codegen/cosmos/authz/v1beta1/genesis.ts b/src/codegen/cosmos/authz/v1beta1/genesis.ts index f293d78..cc649cf 100644 --- a/src/codegen/cosmos/authz/v1beta1/genesis.ts +++ b/src/codegen/cosmos/authz/v1beta1/genesis.ts @@ -10,7 +10,7 @@ export interface GenesisStateProtoMsg { } /** GenesisState defines the authz module's genesis state. */ export interface GenesisStateAmino { - authorization?: GrantAuthorizationAmino[]; + authorization: GrantAuthorizationAmino[]; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; diff --git a/src/codegen/cosmos/authz/v1beta1/query.lcd.ts b/src/codegen/cosmos/authz/v1beta1/query.lcd.ts index ea4f36b..e5699e3 100644 --- a/src/codegen/cosmos/authz/v1beta1/query.lcd.ts +++ b/src/codegen/cosmos/authz/v1beta1/query.lcd.ts @@ -35,7 +35,7 @@ export class LCDQueryClient { } /* GranterGrants returns list of `GrantAuthorization`, granted by granter. - Since: cosmos-sdk 0.45.2 */ + Since: cosmos-sdk 0.46 */ async granterGrants(params: QueryGranterGrantsRequest): Promise { const options: any = { params: {} @@ -48,7 +48,7 @@ export class LCDQueryClient { } /* GranteeGrants returns a list of `GrantAuthorization` by grantee. - Since: cosmos-sdk 0.45.2 */ + Since: cosmos-sdk 0.46 */ async granteeGrants(params: QueryGranteeGrantsRequest): Promise { const options: any = { params: {} diff --git a/src/codegen/cosmos/authz/v1beta1/query.rpc.Query.ts b/src/codegen/cosmos/authz/v1beta1/query.rpc.Query.ts index bc7578e..f42a05d 100644 --- a/src/codegen/cosmos/authz/v1beta1/query.rpc.Query.ts +++ b/src/codegen/cosmos/authz/v1beta1/query.rpc.Query.ts @@ -9,13 +9,13 @@ export interface Query { /** * GranterGrants returns list of `GrantAuthorization`, granted by granter. * - * Since: cosmos-sdk 0.45.2 + * Since: cosmos-sdk 0.46 */ granterGrants(request: QueryGranterGrantsRequest): Promise; /** * GranteeGrants returns a list of `GrantAuthorization` by grantee. * - * Since: cosmos-sdk 0.45.2 + * Since: cosmos-sdk 0.46 */ granteeGrants(request: QueryGranteeGrantsRequest): Promise; } diff --git a/src/codegen/cosmos/authz/v1beta1/query.ts b/src/codegen/cosmos/authz/v1beta1/query.ts index d6e10c0..d58f238 100644 --- a/src/codegen/cosmos/authz/v1beta1/query.ts +++ b/src/codegen/cosmos/authz/v1beta1/query.ts @@ -113,7 +113,7 @@ export interface QueryGranterGrantsResponseSDKType { grants: GrantAuthorizationSDKType[]; pagination?: PageResponseSDKType; } -/** QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. */ +/** QueryGranteeGrantsRequest is the request type for the Query/GranteeGrants RPC method. */ export interface QueryGranteeGrantsRequest { grantee: string; /** pagination defines an pagination for the request. */ @@ -123,7 +123,7 @@ export interface QueryGranteeGrantsRequestProtoMsg { typeUrl: "/cosmos.authz.v1beta1.QueryGranteeGrantsRequest"; value: Uint8Array; } -/** QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. */ +/** QueryGranteeGrantsRequest is the request type for the Query/GranteeGrants RPC method. */ export interface QueryGranteeGrantsRequestAmino { grantee?: string; /** pagination defines an pagination for the request. */ @@ -133,7 +133,7 @@ export interface QueryGranteeGrantsRequestAminoMsg { type: "cosmos-sdk/QueryGranteeGrantsRequest"; value: QueryGranteeGrantsRequestAmino; } -/** QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. */ +/** QueryGranteeGrantsRequest is the request type for the Query/GranteeGrants RPC method. */ export interface QueryGranteeGrantsRequestSDKType { grantee: string; pagination?: PageRequestSDKType; diff --git a/src/codegen/cosmos/authz/v1beta1/tx.ts b/src/codegen/cosmos/authz/v1beta1/tx.ts index 1b59db9..c38a3aa 100644 --- a/src/codegen/cosmos/authz/v1beta1/tx.ts +++ b/src/codegen/cosmos/authz/v1beta1/tx.ts @@ -22,7 +22,7 @@ export interface MsgGrantProtoMsg { export interface MsgGrantAmino { granter?: string; grantee?: string; - grant?: GrantAmino; + grant: GrantAmino; } export interface MsgGrantAminoMsg { type: "cosmos-sdk/MsgGrant"; @@ -37,26 +37,20 @@ export interface MsgGrantSDKType { grantee: string; grant: GrantSDKType; } -/** MsgExecResponse defines the Msg/MsgExecResponse response type. */ -export interface MsgExecResponse { - results: Uint8Array[]; -} -export interface MsgExecResponseProtoMsg { - typeUrl: "/cosmos.authz.v1beta1.MsgExecResponse"; +/** MsgGrantResponse defines the Msg/MsgGrant response type. */ +export interface MsgGrantResponse {} +export interface MsgGrantResponseProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.MsgGrantResponse"; value: Uint8Array; } -/** MsgExecResponse defines the Msg/MsgExecResponse response type. */ -export interface MsgExecResponseAmino { - results?: string[]; -} -export interface MsgExecResponseAminoMsg { - type: "cosmos-sdk/MsgExecResponse"; - value: MsgExecResponseAmino; -} -/** MsgExecResponse defines the Msg/MsgExecResponse response type. */ -export interface MsgExecResponseSDKType { - results: Uint8Array[]; +/** MsgGrantResponse defines the Msg/MsgGrant response type. */ +export interface MsgGrantResponseAmino {} +export interface MsgGrantResponseAminoMsg { + type: "cosmos-sdk/MsgGrantResponse"; + value: MsgGrantResponseAmino; } +/** MsgGrantResponse defines the Msg/MsgGrant response type. */ +export interface MsgGrantResponseSDKType {} /** * MsgExec attempts to execute the provided messages using * authorizations granted to the grantee. Each message should have only @@ -65,7 +59,7 @@ export interface MsgExecResponseSDKType { export interface MsgExec { grantee: string; /** - * Authorization Msg requests to execute. Each msg must implement Authorization interface + * Execute Msg. * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) * triple and validate it. */ @@ -83,7 +77,7 @@ export interface MsgExecProtoMsg { export interface MsgExecAmino { grantee?: string; /** - * Authorization Msg requests to execute. Each msg must implement Authorization interface + * Execute Msg. * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) * triple and validate it. */ @@ -102,20 +96,26 @@ export interface MsgExecSDKType { grantee: string; msgs: AnySDKType[]; } -/** MsgGrantResponse defines the Msg/MsgGrant response type. */ -export interface MsgGrantResponse {} -export interface MsgGrantResponseProtoMsg { - typeUrl: "/cosmos.authz.v1beta1.MsgGrantResponse"; +/** MsgExecResponse defines the Msg/MsgExecResponse response type. */ +export interface MsgExecResponse { + results: Uint8Array[]; +} +export interface MsgExecResponseProtoMsg { + typeUrl: "/cosmos.authz.v1beta1.MsgExecResponse"; value: Uint8Array; } -/** MsgGrantResponse defines the Msg/MsgGrant response type. */ -export interface MsgGrantResponseAmino {} -export interface MsgGrantResponseAminoMsg { - type: "cosmos-sdk/MsgGrantResponse"; - value: MsgGrantResponseAmino; +/** MsgExecResponse defines the Msg/MsgExecResponse response type. */ +export interface MsgExecResponseAmino { + results?: string[]; +} +export interface MsgExecResponseAminoMsg { + type: "cosmos-sdk/MsgExecResponse"; + value: MsgExecResponseAmino; +} +/** MsgExecResponse defines the Msg/MsgExecResponse response type. */ +export interface MsgExecResponseSDKType { + results: Uint8Array[]; } -/** MsgGrantResponse defines the Msg/MsgGrant response type. */ -export interface MsgGrantResponseSDKType {} /** * MsgRevoke revokes any authorization with the provided sdk.Msg type on the * granter's account with that has been granted to the grantee. @@ -233,7 +233,7 @@ export const MsgGrant = { const obj: any = {}; obj.granter = message.granter === "" ? undefined : message.granter; obj.grantee = message.grantee === "" ? undefined : message.grantee; - obj.grant = message.grant ? Grant.toAmino(message.grant) : undefined; + obj.grant = message.grant ? Grant.toAmino(message.grant) : Grant.toAmino(Grant.fromPartial({})); return obj; }, fromAminoMsg(object: MsgGrantAminoMsg): MsgGrant { @@ -258,29 +258,21 @@ export const MsgGrant = { }; } }; -function createBaseMsgExecResponse(): MsgExecResponse { - return { - results: [] - }; +function createBaseMsgGrantResponse(): MsgGrantResponse { + return {}; } -export const MsgExecResponse = { - typeUrl: "/cosmos.authz.v1beta1.MsgExecResponse", - encode(message: MsgExecResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - for (const v of message.results) { - writer.uint32(10).bytes(v!); - } +export const MsgGrantResponse = { + typeUrl: "/cosmos.authz.v1beta1.MsgGrantResponse", + encode(_: MsgGrantResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgExecResponse { + decode(input: BinaryReader | Uint8Array, length?: number): MsgGrantResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgExecResponse(); + const message = createBaseMsgGrantResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.results.push(reader.bytes()); - break; default: reader.skipType(tag & 7); break; @@ -288,44 +280,37 @@ export const MsgExecResponse = { } return message; }, - fromPartial(object: Partial): MsgExecResponse { - const message = createBaseMsgExecResponse(); - message.results = object.results?.map(e => e) || []; + fromPartial(_: Partial): MsgGrantResponse { + const message = createBaseMsgGrantResponse(); return message; }, - fromAmino(object: MsgExecResponseAmino): MsgExecResponse { - const message = createBaseMsgExecResponse(); - message.results = object.results?.map(e => bytesFromBase64(e)) || []; + fromAmino(_: MsgGrantResponseAmino): MsgGrantResponse { + const message = createBaseMsgGrantResponse(); return message; }, - toAmino(message: MsgExecResponse): MsgExecResponseAmino { + toAmino(_: MsgGrantResponse): MsgGrantResponseAmino { const obj: any = {}; - if (message.results) { - obj.results = message.results.map(e => base64FromBytes(e)); - } else { - obj.results = message.results; - } return obj; }, - fromAminoMsg(object: MsgExecResponseAminoMsg): MsgExecResponse { - return MsgExecResponse.fromAmino(object.value); + fromAminoMsg(object: MsgGrantResponseAminoMsg): MsgGrantResponse { + return MsgGrantResponse.fromAmino(object.value); }, - toAminoMsg(message: MsgExecResponse): MsgExecResponseAminoMsg { + toAminoMsg(message: MsgGrantResponse): MsgGrantResponseAminoMsg { return { - type: "cosmos-sdk/MsgExecResponse", - value: MsgExecResponse.toAmino(message) + type: "cosmos-sdk/MsgGrantResponse", + value: MsgGrantResponse.toAmino(message) }; }, - fromProtoMsg(message: MsgExecResponseProtoMsg): MsgExecResponse { - return MsgExecResponse.decode(message.value); + fromProtoMsg(message: MsgGrantResponseProtoMsg): MsgGrantResponse { + return MsgGrantResponse.decode(message.value); }, - toProto(message: MsgExecResponse): Uint8Array { - return MsgExecResponse.encode(message).finish(); + toProto(message: MsgGrantResponse): Uint8Array { + return MsgGrantResponse.encode(message).finish(); }, - toProtoMsg(message: MsgExecResponse): MsgExecResponseProtoMsg { + toProtoMsg(message: MsgGrantResponse): MsgGrantResponseProtoMsg { return { - typeUrl: "/cosmos.authz.v1beta1.MsgExecResponse", - value: MsgExecResponse.encode(message).finish() + typeUrl: "/cosmos.authz.v1beta1.MsgGrantResponse", + value: MsgGrantResponse.encode(message).finish() }; } }; @@ -412,21 +397,29 @@ export const MsgExec = { }; } }; -function createBaseMsgGrantResponse(): MsgGrantResponse { - return {}; +function createBaseMsgExecResponse(): MsgExecResponse { + return { + results: [] + }; } -export const MsgGrantResponse = { - typeUrl: "/cosmos.authz.v1beta1.MsgGrantResponse", - encode(_: MsgGrantResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const MsgExecResponse = { + typeUrl: "/cosmos.authz.v1beta1.MsgExecResponse", + encode(message: MsgExecResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.results) { + writer.uint32(10).bytes(v!); + } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgGrantResponse { + decode(input: BinaryReader | Uint8Array, length?: number): MsgExecResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgGrantResponse(); + const message = createBaseMsgExecResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.results.push(reader.bytes()); + break; default: reader.skipType(tag & 7); break; @@ -434,37 +427,44 @@ export const MsgGrantResponse = { } return message; }, - fromPartial(_: Partial): MsgGrantResponse { - const message = createBaseMsgGrantResponse(); + fromPartial(object: Partial): MsgExecResponse { + const message = createBaseMsgExecResponse(); + message.results = object.results?.map(e => e) || []; return message; }, - fromAmino(_: MsgGrantResponseAmino): MsgGrantResponse { - const message = createBaseMsgGrantResponse(); + fromAmino(object: MsgExecResponseAmino): MsgExecResponse { + const message = createBaseMsgExecResponse(); + message.results = object.results?.map(e => bytesFromBase64(e)) || []; return message; }, - toAmino(_: MsgGrantResponse): MsgGrantResponseAmino { + toAmino(message: MsgExecResponse): MsgExecResponseAmino { const obj: any = {}; + if (message.results) { + obj.results = message.results.map(e => base64FromBytes(e)); + } else { + obj.results = message.results; + } return obj; }, - fromAminoMsg(object: MsgGrantResponseAminoMsg): MsgGrantResponse { - return MsgGrantResponse.fromAmino(object.value); + fromAminoMsg(object: MsgExecResponseAminoMsg): MsgExecResponse { + return MsgExecResponse.fromAmino(object.value); }, - toAminoMsg(message: MsgGrantResponse): MsgGrantResponseAminoMsg { + toAminoMsg(message: MsgExecResponse): MsgExecResponseAminoMsg { return { - type: "cosmos-sdk/MsgGrantResponse", - value: MsgGrantResponse.toAmino(message) + type: "cosmos-sdk/MsgExecResponse", + value: MsgExecResponse.toAmino(message) }; }, - fromProtoMsg(message: MsgGrantResponseProtoMsg): MsgGrantResponse { - return MsgGrantResponse.decode(message.value); + fromProtoMsg(message: MsgExecResponseProtoMsg): MsgExecResponse { + return MsgExecResponse.decode(message.value); }, - toProto(message: MsgGrantResponse): Uint8Array { - return MsgGrantResponse.encode(message).finish(); + toProto(message: MsgExecResponse): Uint8Array { + return MsgExecResponse.encode(message).finish(); }, - toProtoMsg(message: MsgGrantResponse): MsgGrantResponseProtoMsg { + toProtoMsg(message: MsgExecResponse): MsgExecResponseProtoMsg { return { - typeUrl: "/cosmos.authz.v1beta1.MsgGrantResponse", - value: MsgGrantResponse.encode(message).finish() + typeUrl: "/cosmos.authz.v1beta1.MsgExecResponse", + value: MsgExecResponse.encode(message).finish() }; } }; diff --git a/src/codegen/cosmos/autocli/v1/options.ts b/src/codegen/cosmos/autocli/v1/options.ts new file mode 100644 index 0000000..e417638 --- /dev/null +++ b/src/codegen/cosmos/autocli/v1/options.ts @@ -0,0 +1,1159 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** ModuleOptions describes the CLI options for a Cosmos SDK module. */ +export interface ModuleOptions { + /** tx describes the tx commands for the module. */ + tx?: ServiceCommandDescriptor; + /** query describes the queries commands for the module. */ + query?: ServiceCommandDescriptor; +} +export interface ModuleOptionsProtoMsg { + typeUrl: "/cosmos.autocli.v1.ModuleOptions"; + value: Uint8Array; +} +/** ModuleOptions describes the CLI options for a Cosmos SDK module. */ +export interface ModuleOptionsAmino { + /** tx describes the tx commands for the module. */ + tx?: ServiceCommandDescriptorAmino; + /** query describes the queries commands for the module. */ + query?: ServiceCommandDescriptorAmino; +} +export interface ModuleOptionsAminoMsg { + type: "cosmos-sdk/ModuleOptions"; + value: ModuleOptionsAmino; +} +/** ModuleOptions describes the CLI options for a Cosmos SDK module. */ +export interface ModuleOptionsSDKType { + tx?: ServiceCommandDescriptorSDKType; + query?: ServiceCommandDescriptorSDKType; +} +export interface ServiceCommandDescriptor_SubCommandsEntry { + key: string; + value?: ServiceCommandDescriptor; +} +export interface ServiceCommandDescriptor_SubCommandsEntryProtoMsg { + typeUrl: string; + value: Uint8Array; +} +export interface ServiceCommandDescriptor_SubCommandsEntryAmino { + key?: string; + value?: ServiceCommandDescriptorAmino; +} +export interface ServiceCommandDescriptor_SubCommandsEntryAminoMsg { + type: string; + value: ServiceCommandDescriptor_SubCommandsEntryAmino; +} +export interface ServiceCommandDescriptor_SubCommandsEntrySDKType { + key: string; + value?: ServiceCommandDescriptorSDKType; +} +/** ServiceCommandDescriptor describes a CLI command based on a protobuf service. */ +export interface ServiceCommandDescriptor { + /** + * service is the fully qualified name of the protobuf service to build + * the command from. It can be left empty if sub_commands are used instead + * which may be the case if a module provides multiple tx and/or query services. + */ + service: string; + /** + * rpc_command_options are options for commands generated from rpc methods. + * If no options are specified for a given rpc method on the service, a + * command will be generated for that method with the default options. + */ + rpcCommandOptions: RpcCommandOptions[]; + /** + * sub_commands is a map of optional sub-commands for this command based on + * different protobuf services. The map key is used as the name of the + * sub-command. + */ + subCommands: { + [key: string]: ServiceCommandDescriptor; + }; +} +export interface ServiceCommandDescriptorProtoMsg { + typeUrl: "/cosmos.autocli.v1.ServiceCommandDescriptor"; + value: Uint8Array; +} +/** ServiceCommandDescriptor describes a CLI command based on a protobuf service. */ +export interface ServiceCommandDescriptorAmino { + /** + * service is the fully qualified name of the protobuf service to build + * the command from. It can be left empty if sub_commands are used instead + * which may be the case if a module provides multiple tx and/or query services. + */ + service?: string; + /** + * rpc_command_options are options for commands generated from rpc methods. + * If no options are specified for a given rpc method on the service, a + * command will be generated for that method with the default options. + */ + rpc_command_options?: RpcCommandOptionsAmino[]; + /** + * sub_commands is a map of optional sub-commands for this command based on + * different protobuf services. The map key is used as the name of the + * sub-command. + */ + sub_commands?: { + [key: string]: ServiceCommandDescriptorAmino; + }; +} +export interface ServiceCommandDescriptorAminoMsg { + type: "cosmos-sdk/ServiceCommandDescriptor"; + value: ServiceCommandDescriptorAmino; +} +/** ServiceCommandDescriptor describes a CLI command based on a protobuf service. */ +export interface ServiceCommandDescriptorSDKType { + service: string; + rpc_command_options: RpcCommandOptionsSDKType[]; + sub_commands: { + [key: string]: ServiceCommandDescriptorSDKType; + }; +} +export interface RpcCommandOptions_FlagOptionsEntry { + key: string; + value?: FlagOptions; +} +export interface RpcCommandOptions_FlagOptionsEntryProtoMsg { + typeUrl: string; + value: Uint8Array; +} +export interface RpcCommandOptions_FlagOptionsEntryAmino { + key?: string; + value?: FlagOptionsAmino; +} +export interface RpcCommandOptions_FlagOptionsEntryAminoMsg { + type: string; + value: RpcCommandOptions_FlagOptionsEntryAmino; +} +export interface RpcCommandOptions_FlagOptionsEntrySDKType { + key: string; + value?: FlagOptionsSDKType; +} +/** + * RpcCommandOptions specifies options for commands generated from protobuf + * rpc methods. + */ +export interface RpcCommandOptions { + /** + * rpc_method is short name of the protobuf rpc method that this command is + * generated from. + */ + rpcMethod: string; + /** + * use is the one-line usage method. It also allows specifying an alternate + * name for the command as the first word of the usage text. + * + * By default the name of an rpc command is the kebab-case short name of the + * rpc method. + */ + use: string; + /** long is the long message shown in the 'help ' output. */ + long: string; + /** short is the short description shown in the 'help' output. */ + short: string; + /** example is examples of how to use the command. */ + example: string; + /** alias is an array of aliases that can be used instead of the first word in Use. */ + alias: string[]; + /** + * suggest_for is an array of command names for which this command will be suggested - + * similar to aliases but only suggests. + */ + suggestFor: string[]; + /** deprecated defines, if this command is deprecated and should print this string when used. */ + deprecated: string; + /** + * version defines the version for this command. If this value is non-empty and the command does not + * define a "version" flag, a "version" boolean flag will be added to the command and, if specified, + * will print content of the "Version" variable. A shorthand "v" flag will also be added if the + * command does not define one. + */ + version: string; + /** + * flag_options are options for flags generated from rpc request fields. + * By default all request fields are configured as flags. They can + * also be configured as positional args instead using positional_args. + */ + flagOptions: { + [key: string]: FlagOptions; + }; + /** positional_args specifies positional arguments for the command. */ + positionalArgs: PositionalArgDescriptor[]; + /** skip specifies whether to skip this rpc method when generating commands. */ + skip: boolean; +} +export interface RpcCommandOptionsProtoMsg { + typeUrl: "/cosmos.autocli.v1.RpcCommandOptions"; + value: Uint8Array; +} +/** + * RpcCommandOptions specifies options for commands generated from protobuf + * rpc methods. + */ +export interface RpcCommandOptionsAmino { + /** + * rpc_method is short name of the protobuf rpc method that this command is + * generated from. + */ + rpc_method?: string; + /** + * use is the one-line usage method. It also allows specifying an alternate + * name for the command as the first word of the usage text. + * + * By default the name of an rpc command is the kebab-case short name of the + * rpc method. + */ + use?: string; + /** long is the long message shown in the 'help ' output. */ + long?: string; + /** short is the short description shown in the 'help' output. */ + short?: string; + /** example is examples of how to use the command. */ + example?: string; + /** alias is an array of aliases that can be used instead of the first word in Use. */ + alias?: string[]; + /** + * suggest_for is an array of command names for which this command will be suggested - + * similar to aliases but only suggests. + */ + suggest_for?: string[]; + /** deprecated defines, if this command is deprecated and should print this string when used. */ + deprecated?: string; + /** + * version defines the version for this command. If this value is non-empty and the command does not + * define a "version" flag, a "version" boolean flag will be added to the command and, if specified, + * will print content of the "Version" variable. A shorthand "v" flag will also be added if the + * command does not define one. + */ + version?: string; + /** + * flag_options are options for flags generated from rpc request fields. + * By default all request fields are configured as flags. They can + * also be configured as positional args instead using positional_args. + */ + flag_options?: { + [key: string]: FlagOptionsAmino; + }; + /** positional_args specifies positional arguments for the command. */ + positional_args?: PositionalArgDescriptorAmino[]; + /** skip specifies whether to skip this rpc method when generating commands. */ + skip?: boolean; +} +export interface RpcCommandOptionsAminoMsg { + type: "cosmos-sdk/RpcCommandOptions"; + value: RpcCommandOptionsAmino; +} +/** + * RpcCommandOptions specifies options for commands generated from protobuf + * rpc methods. + */ +export interface RpcCommandOptionsSDKType { + rpc_method: string; + use: string; + long: string; + short: string; + example: string; + alias: string[]; + suggest_for: string[]; + deprecated: string; + version: string; + flag_options: { + [key: string]: FlagOptionsSDKType; + }; + positional_args: PositionalArgDescriptorSDKType[]; + skip: boolean; +} +/** + * FlagOptions are options for flags generated from rpc request fields. + * By default, all request fields are configured as flags based on the + * kebab-case name of the field. Fields can be turned into positional arguments + * instead by using RpcCommandOptions.positional_args. + */ +export interface FlagOptions { + /** name is an alternate name to use for the field flag. */ + name: string; + /** shorthand is a one-letter abbreviated flag. */ + shorthand: string; + /** usage is the help message. */ + usage: string; + /** default_value is the default value as text. */ + defaultValue: string; + /** deprecated is the usage text to show if this flag is deprecated. */ + deprecated: string; + /** shorthand_deprecated is the usage text to show if the shorthand of this flag is deprecated. */ + shorthandDeprecated: string; + /** hidden hides the flag from help/usage text */ + hidden: boolean; +} +export interface FlagOptionsProtoMsg { + typeUrl: "/cosmos.autocli.v1.FlagOptions"; + value: Uint8Array; +} +/** + * FlagOptions are options for flags generated from rpc request fields. + * By default, all request fields are configured as flags based on the + * kebab-case name of the field. Fields can be turned into positional arguments + * instead by using RpcCommandOptions.positional_args. + */ +export interface FlagOptionsAmino { + /** name is an alternate name to use for the field flag. */ + name?: string; + /** shorthand is a one-letter abbreviated flag. */ + shorthand?: string; + /** usage is the help message. */ + usage?: string; + /** default_value is the default value as text. */ + default_value?: string; + /** deprecated is the usage text to show if this flag is deprecated. */ + deprecated?: string; + /** shorthand_deprecated is the usage text to show if the shorthand of this flag is deprecated. */ + shorthand_deprecated?: string; + /** hidden hides the flag from help/usage text */ + hidden?: boolean; +} +export interface FlagOptionsAminoMsg { + type: "cosmos-sdk/FlagOptions"; + value: FlagOptionsAmino; +} +/** + * FlagOptions are options for flags generated from rpc request fields. + * By default, all request fields are configured as flags based on the + * kebab-case name of the field. Fields can be turned into positional arguments + * instead by using RpcCommandOptions.positional_args. + */ +export interface FlagOptionsSDKType { + name: string; + shorthand: string; + usage: string; + default_value: string; + deprecated: string; + shorthand_deprecated: string; + hidden: boolean; +} +/** PositionalArgDescriptor describes a positional argument. */ +export interface PositionalArgDescriptor { + /** + * proto_field specifies the proto field to use as the positional arg. Any + * fields used as positional args will not have a flag generated. + */ + protoField: string; + /** + * varargs makes a positional parameter a varargs parameter. This can only be + * applied to last positional parameter and the proto_field must a repeated + * field. + */ + varargs: boolean; +} +export interface PositionalArgDescriptorProtoMsg { + typeUrl: "/cosmos.autocli.v1.PositionalArgDescriptor"; + value: Uint8Array; +} +/** PositionalArgDescriptor describes a positional argument. */ +export interface PositionalArgDescriptorAmino { + /** + * proto_field specifies the proto field to use as the positional arg. Any + * fields used as positional args will not have a flag generated. + */ + proto_field?: string; + /** + * varargs makes a positional parameter a varargs parameter. This can only be + * applied to last positional parameter and the proto_field must a repeated + * field. + */ + varargs?: boolean; +} +export interface PositionalArgDescriptorAminoMsg { + type: "cosmos-sdk/PositionalArgDescriptor"; + value: PositionalArgDescriptorAmino; +} +/** PositionalArgDescriptor describes a positional argument. */ +export interface PositionalArgDescriptorSDKType { + proto_field: string; + varargs: boolean; +} +function createBaseModuleOptions(): ModuleOptions { + return { + tx: undefined, + query: undefined + }; +} +export const ModuleOptions = { + typeUrl: "/cosmos.autocli.v1.ModuleOptions", + encode(message: ModuleOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tx !== undefined) { + ServiceCommandDescriptor.encode(message.tx, writer.uint32(10).fork()).ldelim(); + } + if (message.query !== undefined) { + ServiceCommandDescriptor.encode(message.query, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModuleOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = ServiceCommandDescriptor.decode(reader, reader.uint32()); + break; + case 2: + message.query = ServiceCommandDescriptor.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ModuleOptions { + const message = createBaseModuleOptions(); + message.tx = object.tx !== undefined && object.tx !== null ? ServiceCommandDescriptor.fromPartial(object.tx) : undefined; + message.query = object.query !== undefined && object.query !== null ? ServiceCommandDescriptor.fromPartial(object.query) : undefined; + return message; + }, + fromAmino(object: ModuleOptionsAmino): ModuleOptions { + const message = createBaseModuleOptions(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = ServiceCommandDescriptor.fromAmino(object.tx); + } + if (object.query !== undefined && object.query !== null) { + message.query = ServiceCommandDescriptor.fromAmino(object.query); + } + return message; + }, + toAmino(message: ModuleOptions): ModuleOptionsAmino { + const obj: any = {}; + obj.tx = message.tx ? ServiceCommandDescriptor.toAmino(message.tx) : undefined; + obj.query = message.query ? ServiceCommandDescriptor.toAmino(message.query) : undefined; + return obj; + }, + fromAminoMsg(object: ModuleOptionsAminoMsg): ModuleOptions { + return ModuleOptions.fromAmino(object.value); + }, + toAminoMsg(message: ModuleOptions): ModuleOptionsAminoMsg { + return { + type: "cosmos-sdk/ModuleOptions", + value: ModuleOptions.toAmino(message) + }; + }, + fromProtoMsg(message: ModuleOptionsProtoMsg): ModuleOptions { + return ModuleOptions.decode(message.value); + }, + toProto(message: ModuleOptions): Uint8Array { + return ModuleOptions.encode(message).finish(); + }, + toProtoMsg(message: ModuleOptions): ModuleOptionsProtoMsg { + return { + typeUrl: "/cosmos.autocli.v1.ModuleOptions", + value: ModuleOptions.encode(message).finish() + }; + } +}; +function createBaseServiceCommandDescriptor_SubCommandsEntry(): ServiceCommandDescriptor_SubCommandsEntry { + return { + key: "", + value: undefined + }; +} +export const ServiceCommandDescriptor_SubCommandsEntry = { + encode(message: ServiceCommandDescriptor_SubCommandsEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + ServiceCommandDescriptor.encode(message.value, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ServiceCommandDescriptor_SubCommandsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServiceCommandDescriptor_SubCommandsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = ServiceCommandDescriptor.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ServiceCommandDescriptor_SubCommandsEntry { + const message = createBaseServiceCommandDescriptor_SubCommandsEntry(); + message.key = object.key ?? ""; + message.value = object.value !== undefined && object.value !== null ? ServiceCommandDescriptor.fromPartial(object.value) : undefined; + return message; + }, + fromAmino(object: ServiceCommandDescriptor_SubCommandsEntryAmino): ServiceCommandDescriptor_SubCommandsEntry { + const message = createBaseServiceCommandDescriptor_SubCommandsEntry(); + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.value !== undefined && object.value !== null) { + message.value = ServiceCommandDescriptor.fromAmino(object.value); + } + return message; + }, + toAmino(message: ServiceCommandDescriptor_SubCommandsEntry): ServiceCommandDescriptor_SubCommandsEntryAmino { + const obj: any = {}; + obj.key = message.key === "" ? undefined : message.key; + obj.value = message.value ? ServiceCommandDescriptor.toAmino(message.value) : undefined; + return obj; + }, + fromAminoMsg(object: ServiceCommandDescriptor_SubCommandsEntryAminoMsg): ServiceCommandDescriptor_SubCommandsEntry { + return ServiceCommandDescriptor_SubCommandsEntry.fromAmino(object.value); + }, + fromProtoMsg(message: ServiceCommandDescriptor_SubCommandsEntryProtoMsg): ServiceCommandDescriptor_SubCommandsEntry { + return ServiceCommandDescriptor_SubCommandsEntry.decode(message.value); + }, + toProto(message: ServiceCommandDescriptor_SubCommandsEntry): Uint8Array { + return ServiceCommandDescriptor_SubCommandsEntry.encode(message).finish(); + } +}; +function createBaseServiceCommandDescriptor(): ServiceCommandDescriptor { + return { + service: "", + rpcCommandOptions: [], + subCommands: {} + }; +} +export const ServiceCommandDescriptor = { + typeUrl: "/cosmos.autocli.v1.ServiceCommandDescriptor", + encode(message: ServiceCommandDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.service !== "") { + writer.uint32(10).string(message.service); + } + for (const v of message.rpcCommandOptions) { + RpcCommandOptions.encode(v!, writer.uint32(18).fork()).ldelim(); + } + Object.entries(message.subCommands).forEach(([key, value]) => { + ServiceCommandDescriptor_SubCommandsEntry.encode({ + key: (key as any), + value + }, writer.uint32(26).fork()).ldelim(); + }); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ServiceCommandDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServiceCommandDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.service = reader.string(); + break; + case 2: + message.rpcCommandOptions.push(RpcCommandOptions.decode(reader, reader.uint32())); + break; + case 3: + const entry3 = ServiceCommandDescriptor_SubCommandsEntry.decode(reader, reader.uint32()); + if (entry3.value !== undefined) { + message.subCommands[entry3.key] = entry3.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ServiceCommandDescriptor { + const message = createBaseServiceCommandDescriptor(); + message.service = object.service ?? ""; + message.rpcCommandOptions = object.rpcCommandOptions?.map(e => RpcCommandOptions.fromPartial(e)) || []; + message.subCommands = Object.entries(object.subCommands ?? {}).reduce<{ + [key: string]: ServiceCommandDescriptor; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = ServiceCommandDescriptor.fromPartial(value); + } + return acc; + }, {}); + return message; + }, + fromAmino(object: ServiceCommandDescriptorAmino): ServiceCommandDescriptor { + const message = createBaseServiceCommandDescriptor(); + if (object.service !== undefined && object.service !== null) { + message.service = object.service; + } + message.rpcCommandOptions = object.rpc_command_options?.map(e => RpcCommandOptions.fromAmino(e)) || []; + message.subCommands = Object.entries(object.sub_commands ?? {}).reduce<{ + [key: string]: ServiceCommandDescriptor; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = ServiceCommandDescriptor.fromAmino(value); + } + return acc; + }, {}); + return message; + }, + toAmino(message: ServiceCommandDescriptor): ServiceCommandDescriptorAmino { + const obj: any = {}; + obj.service = message.service === "" ? undefined : message.service; + if (message.rpcCommandOptions) { + obj.rpc_command_options = message.rpcCommandOptions.map(e => e ? RpcCommandOptions.toAmino(e) : undefined); + } else { + obj.rpc_command_options = message.rpcCommandOptions; + } + obj.sub_commands = {}; + if (message.subCommands) { + Object.entries(message.subCommands).forEach(([k, v]) => { + obj.sub_commands[k] = ServiceCommandDescriptor.toAmino(v); + }); + } + return obj; + }, + fromAminoMsg(object: ServiceCommandDescriptorAminoMsg): ServiceCommandDescriptor { + return ServiceCommandDescriptor.fromAmino(object.value); + }, + toAminoMsg(message: ServiceCommandDescriptor): ServiceCommandDescriptorAminoMsg { + return { + type: "cosmos-sdk/ServiceCommandDescriptor", + value: ServiceCommandDescriptor.toAmino(message) + }; + }, + fromProtoMsg(message: ServiceCommandDescriptorProtoMsg): ServiceCommandDescriptor { + return ServiceCommandDescriptor.decode(message.value); + }, + toProto(message: ServiceCommandDescriptor): Uint8Array { + return ServiceCommandDescriptor.encode(message).finish(); + }, + toProtoMsg(message: ServiceCommandDescriptor): ServiceCommandDescriptorProtoMsg { + return { + typeUrl: "/cosmos.autocli.v1.ServiceCommandDescriptor", + value: ServiceCommandDescriptor.encode(message).finish() + }; + } +}; +function createBaseRpcCommandOptions_FlagOptionsEntry(): RpcCommandOptions_FlagOptionsEntry { + return { + key: "", + value: undefined + }; +} +export const RpcCommandOptions_FlagOptionsEntry = { + encode(message: RpcCommandOptions_FlagOptionsEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + FlagOptions.encode(message.value, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RpcCommandOptions_FlagOptionsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRpcCommandOptions_FlagOptionsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = FlagOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RpcCommandOptions_FlagOptionsEntry { + const message = createBaseRpcCommandOptions_FlagOptionsEntry(); + message.key = object.key ?? ""; + message.value = object.value !== undefined && object.value !== null ? FlagOptions.fromPartial(object.value) : undefined; + return message; + }, + fromAmino(object: RpcCommandOptions_FlagOptionsEntryAmino): RpcCommandOptions_FlagOptionsEntry { + const message = createBaseRpcCommandOptions_FlagOptionsEntry(); + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.value !== undefined && object.value !== null) { + message.value = FlagOptions.fromAmino(object.value); + } + return message; + }, + toAmino(message: RpcCommandOptions_FlagOptionsEntry): RpcCommandOptions_FlagOptionsEntryAmino { + const obj: any = {}; + obj.key = message.key === "" ? undefined : message.key; + obj.value = message.value ? FlagOptions.toAmino(message.value) : undefined; + return obj; + }, + fromAminoMsg(object: RpcCommandOptions_FlagOptionsEntryAminoMsg): RpcCommandOptions_FlagOptionsEntry { + return RpcCommandOptions_FlagOptionsEntry.fromAmino(object.value); + }, + fromProtoMsg(message: RpcCommandOptions_FlagOptionsEntryProtoMsg): RpcCommandOptions_FlagOptionsEntry { + return RpcCommandOptions_FlagOptionsEntry.decode(message.value); + }, + toProto(message: RpcCommandOptions_FlagOptionsEntry): Uint8Array { + return RpcCommandOptions_FlagOptionsEntry.encode(message).finish(); + } +}; +function createBaseRpcCommandOptions(): RpcCommandOptions { + return { + rpcMethod: "", + use: "", + long: "", + short: "", + example: "", + alias: [], + suggestFor: [], + deprecated: "", + version: "", + flagOptions: {}, + positionalArgs: [], + skip: false + }; +} +export const RpcCommandOptions = { + typeUrl: "/cosmos.autocli.v1.RpcCommandOptions", + encode(message: RpcCommandOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.rpcMethod !== "") { + writer.uint32(10).string(message.rpcMethod); + } + if (message.use !== "") { + writer.uint32(18).string(message.use); + } + if (message.long !== "") { + writer.uint32(26).string(message.long); + } + if (message.short !== "") { + writer.uint32(34).string(message.short); + } + if (message.example !== "") { + writer.uint32(42).string(message.example); + } + for (const v of message.alias) { + writer.uint32(50).string(v!); + } + for (const v of message.suggestFor) { + writer.uint32(58).string(v!); + } + if (message.deprecated !== "") { + writer.uint32(66).string(message.deprecated); + } + if (message.version !== "") { + writer.uint32(74).string(message.version); + } + Object.entries(message.flagOptions).forEach(([key, value]) => { + RpcCommandOptions_FlagOptionsEntry.encode({ + key: (key as any), + value + }, writer.uint32(82).fork()).ldelim(); + }); + for (const v of message.positionalArgs) { + PositionalArgDescriptor.encode(v!, writer.uint32(90).fork()).ldelim(); + } + if (message.skip === true) { + writer.uint32(96).bool(message.skip); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RpcCommandOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRpcCommandOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.rpcMethod = reader.string(); + break; + case 2: + message.use = reader.string(); + break; + case 3: + message.long = reader.string(); + break; + case 4: + message.short = reader.string(); + break; + case 5: + message.example = reader.string(); + break; + case 6: + message.alias.push(reader.string()); + break; + case 7: + message.suggestFor.push(reader.string()); + break; + case 8: + message.deprecated = reader.string(); + break; + case 9: + message.version = reader.string(); + break; + case 10: + const entry10 = RpcCommandOptions_FlagOptionsEntry.decode(reader, reader.uint32()); + if (entry10.value !== undefined) { + message.flagOptions[entry10.key] = entry10.value; + } + break; + case 11: + message.positionalArgs.push(PositionalArgDescriptor.decode(reader, reader.uint32())); + break; + case 12: + message.skip = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RpcCommandOptions { + const message = createBaseRpcCommandOptions(); + message.rpcMethod = object.rpcMethod ?? ""; + message.use = object.use ?? ""; + message.long = object.long ?? ""; + message.short = object.short ?? ""; + message.example = object.example ?? ""; + message.alias = object.alias?.map(e => e) || []; + message.suggestFor = object.suggestFor?.map(e => e) || []; + message.deprecated = object.deprecated ?? ""; + message.version = object.version ?? ""; + message.flagOptions = Object.entries(object.flagOptions ?? {}).reduce<{ + [key: string]: FlagOptions; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = FlagOptions.fromPartial(value); + } + return acc; + }, {}); + message.positionalArgs = object.positionalArgs?.map(e => PositionalArgDescriptor.fromPartial(e)) || []; + message.skip = object.skip ?? false; + return message; + }, + fromAmino(object: RpcCommandOptionsAmino): RpcCommandOptions { + const message = createBaseRpcCommandOptions(); + if (object.rpc_method !== undefined && object.rpc_method !== null) { + message.rpcMethod = object.rpc_method; + } + if (object.use !== undefined && object.use !== null) { + message.use = object.use; + } + if (object.long !== undefined && object.long !== null) { + message.long = object.long; + } + if (object.short !== undefined && object.short !== null) { + message.short = object.short; + } + if (object.example !== undefined && object.example !== null) { + message.example = object.example; + } + message.alias = object.alias?.map(e => e) || []; + message.suggestFor = object.suggest_for?.map(e => e) || []; + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + message.flagOptions = Object.entries(object.flag_options ?? {}).reduce<{ + [key: string]: FlagOptions; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = FlagOptions.fromAmino(value); + } + return acc; + }, {}); + message.positionalArgs = object.positional_args?.map(e => PositionalArgDescriptor.fromAmino(e)) || []; + if (object.skip !== undefined && object.skip !== null) { + message.skip = object.skip; + } + return message; + }, + toAmino(message: RpcCommandOptions): RpcCommandOptionsAmino { + const obj: any = {}; + obj.rpc_method = message.rpcMethod === "" ? undefined : message.rpcMethod; + obj.use = message.use === "" ? undefined : message.use; + obj.long = message.long === "" ? undefined : message.long; + obj.short = message.short === "" ? undefined : message.short; + obj.example = message.example === "" ? undefined : message.example; + if (message.alias) { + obj.alias = message.alias.map(e => e); + } else { + obj.alias = message.alias; + } + if (message.suggestFor) { + obj.suggest_for = message.suggestFor.map(e => e); + } else { + obj.suggest_for = message.suggestFor; + } + obj.deprecated = message.deprecated === "" ? undefined : message.deprecated; + obj.version = message.version === "" ? undefined : message.version; + obj.flag_options = {}; + if (message.flagOptions) { + Object.entries(message.flagOptions).forEach(([k, v]) => { + obj.flag_options[k] = FlagOptions.toAmino(v); + }); + } + if (message.positionalArgs) { + obj.positional_args = message.positionalArgs.map(e => e ? PositionalArgDescriptor.toAmino(e) : undefined); + } else { + obj.positional_args = message.positionalArgs; + } + obj.skip = message.skip === false ? undefined : message.skip; + return obj; + }, + fromAminoMsg(object: RpcCommandOptionsAminoMsg): RpcCommandOptions { + return RpcCommandOptions.fromAmino(object.value); + }, + toAminoMsg(message: RpcCommandOptions): RpcCommandOptionsAminoMsg { + return { + type: "cosmos-sdk/RpcCommandOptions", + value: RpcCommandOptions.toAmino(message) + }; + }, + fromProtoMsg(message: RpcCommandOptionsProtoMsg): RpcCommandOptions { + return RpcCommandOptions.decode(message.value); + }, + toProto(message: RpcCommandOptions): Uint8Array { + return RpcCommandOptions.encode(message).finish(); + }, + toProtoMsg(message: RpcCommandOptions): RpcCommandOptionsProtoMsg { + return { + typeUrl: "/cosmos.autocli.v1.RpcCommandOptions", + value: RpcCommandOptions.encode(message).finish() + }; + } +}; +function createBaseFlagOptions(): FlagOptions { + return { + name: "", + shorthand: "", + usage: "", + defaultValue: "", + deprecated: "", + shorthandDeprecated: "", + hidden: false + }; +} +export const FlagOptions = { + typeUrl: "/cosmos.autocli.v1.FlagOptions", + encode(message: FlagOptions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.shorthand !== "") { + writer.uint32(18).string(message.shorthand); + } + if (message.usage !== "") { + writer.uint32(26).string(message.usage); + } + if (message.defaultValue !== "") { + writer.uint32(34).string(message.defaultValue); + } + if (message.deprecated !== "") { + writer.uint32(50).string(message.deprecated); + } + if (message.shorthandDeprecated !== "") { + writer.uint32(58).string(message.shorthandDeprecated); + } + if (message.hidden === true) { + writer.uint32(64).bool(message.hidden); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FlagOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFlagOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.shorthand = reader.string(); + break; + case 3: + message.usage = reader.string(); + break; + case 4: + message.defaultValue = reader.string(); + break; + case 6: + message.deprecated = reader.string(); + break; + case 7: + message.shorthandDeprecated = reader.string(); + break; + case 8: + message.hidden = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): FlagOptions { + const message = createBaseFlagOptions(); + message.name = object.name ?? ""; + message.shorthand = object.shorthand ?? ""; + message.usage = object.usage ?? ""; + message.defaultValue = object.defaultValue ?? ""; + message.deprecated = object.deprecated ?? ""; + message.shorthandDeprecated = object.shorthandDeprecated ?? ""; + message.hidden = object.hidden ?? false; + return message; + }, + fromAmino(object: FlagOptionsAmino): FlagOptions { + const message = createBaseFlagOptions(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.shorthand !== undefined && object.shorthand !== null) { + message.shorthand = object.shorthand; + } + if (object.usage !== undefined && object.usage !== null) { + message.usage = object.usage; + } + if (object.default_value !== undefined && object.default_value !== null) { + message.defaultValue = object.default_value; + } + if (object.deprecated !== undefined && object.deprecated !== null) { + message.deprecated = object.deprecated; + } + if (object.shorthand_deprecated !== undefined && object.shorthand_deprecated !== null) { + message.shorthandDeprecated = object.shorthand_deprecated; + } + if (object.hidden !== undefined && object.hidden !== null) { + message.hidden = object.hidden; + } + return message; + }, + toAmino(message: FlagOptions): FlagOptionsAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.shorthand = message.shorthand === "" ? undefined : message.shorthand; + obj.usage = message.usage === "" ? undefined : message.usage; + obj.default_value = message.defaultValue === "" ? undefined : message.defaultValue; + obj.deprecated = message.deprecated === "" ? undefined : message.deprecated; + obj.shorthand_deprecated = message.shorthandDeprecated === "" ? undefined : message.shorthandDeprecated; + obj.hidden = message.hidden === false ? undefined : message.hidden; + return obj; + }, + fromAminoMsg(object: FlagOptionsAminoMsg): FlagOptions { + return FlagOptions.fromAmino(object.value); + }, + toAminoMsg(message: FlagOptions): FlagOptionsAminoMsg { + return { + type: "cosmos-sdk/FlagOptions", + value: FlagOptions.toAmino(message) + }; + }, + fromProtoMsg(message: FlagOptionsProtoMsg): FlagOptions { + return FlagOptions.decode(message.value); + }, + toProto(message: FlagOptions): Uint8Array { + return FlagOptions.encode(message).finish(); + }, + toProtoMsg(message: FlagOptions): FlagOptionsProtoMsg { + return { + typeUrl: "/cosmos.autocli.v1.FlagOptions", + value: FlagOptions.encode(message).finish() + }; + } +}; +function createBasePositionalArgDescriptor(): PositionalArgDescriptor { + return { + protoField: "", + varargs: false + }; +} +export const PositionalArgDescriptor = { + typeUrl: "/cosmos.autocli.v1.PositionalArgDescriptor", + encode(message: PositionalArgDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.protoField !== "") { + writer.uint32(10).string(message.protoField); + } + if (message.varargs === true) { + writer.uint32(16).bool(message.varargs); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PositionalArgDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePositionalArgDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.protoField = reader.string(); + break; + case 2: + message.varargs = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PositionalArgDescriptor { + const message = createBasePositionalArgDescriptor(); + message.protoField = object.protoField ?? ""; + message.varargs = object.varargs ?? false; + return message; + }, + fromAmino(object: PositionalArgDescriptorAmino): PositionalArgDescriptor { + const message = createBasePositionalArgDescriptor(); + if (object.proto_field !== undefined && object.proto_field !== null) { + message.protoField = object.proto_field; + } + if (object.varargs !== undefined && object.varargs !== null) { + message.varargs = object.varargs; + } + return message; + }, + toAmino(message: PositionalArgDescriptor): PositionalArgDescriptorAmino { + const obj: any = {}; + obj.proto_field = message.protoField === "" ? undefined : message.protoField; + obj.varargs = message.varargs === false ? undefined : message.varargs; + return obj; + }, + fromAminoMsg(object: PositionalArgDescriptorAminoMsg): PositionalArgDescriptor { + return PositionalArgDescriptor.fromAmino(object.value); + }, + toAminoMsg(message: PositionalArgDescriptor): PositionalArgDescriptorAminoMsg { + return { + type: "cosmos-sdk/PositionalArgDescriptor", + value: PositionalArgDescriptor.toAmino(message) + }; + }, + fromProtoMsg(message: PositionalArgDescriptorProtoMsg): PositionalArgDescriptor { + return PositionalArgDescriptor.decode(message.value); + }, + toProto(message: PositionalArgDescriptor): Uint8Array { + return PositionalArgDescriptor.encode(message).finish(); + }, + toProtoMsg(message: PositionalArgDescriptor): PositionalArgDescriptorProtoMsg { + return { + typeUrl: "/cosmos.autocli.v1.PositionalArgDescriptor", + value: PositionalArgDescriptor.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/autocli/v1/query.rpc.Query.ts b/src/codegen/cosmos/autocli/v1/query.rpc.Query.ts new file mode 100644 index 0000000..327d545 --- /dev/null +++ b/src/codegen/cosmos/autocli/v1/query.rpc.Query.ts @@ -0,0 +1,31 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { AppOptionsRequest, AppOptionsResponse } from "./query"; +/** RemoteInfoService provides clients with the information they need + to build dynamically CLI clients for remote chains. */ +export interface Query { + /** AppOptions returns the autocli options for all of the modules in an app. */ + appOptions(request?: AppOptionsRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.appOptions = this.appOptions.bind(this); + } + appOptions(request: AppOptionsRequest = {}): Promise { + const data = AppOptionsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.autocli.v1.Query", "AppOptions", data); + return promise.then(data => AppOptionsResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + appOptions(request?: AppOptionsRequest): Promise { + return queryService.appOptions(request); + } + }; +}; \ No newline at end of file diff --git a/src/codegen/cosmos/autocli/v1/query.ts b/src/codegen/cosmos/autocli/v1/query.ts new file mode 100644 index 0000000..91a7bcd --- /dev/null +++ b/src/codegen/cosmos/autocli/v1/query.ts @@ -0,0 +1,280 @@ +import { ModuleOptions, ModuleOptionsAmino, ModuleOptionsSDKType } from "./options"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** AppOptionsRequest is the RemoteInfoService/AppOptions request type. */ +export interface AppOptionsRequest {} +export interface AppOptionsRequestProtoMsg { + typeUrl: "/cosmos.autocli.v1.AppOptionsRequest"; + value: Uint8Array; +} +/** AppOptionsRequest is the RemoteInfoService/AppOptions request type. */ +export interface AppOptionsRequestAmino {} +export interface AppOptionsRequestAminoMsg { + type: "cosmos-sdk/AppOptionsRequest"; + value: AppOptionsRequestAmino; +} +/** AppOptionsRequest is the RemoteInfoService/AppOptions request type. */ +export interface AppOptionsRequestSDKType {} +export interface AppOptionsResponse_ModuleOptionsEntry { + key: string; + value?: ModuleOptions; +} +export interface AppOptionsResponse_ModuleOptionsEntryProtoMsg { + typeUrl: string; + value: Uint8Array; +} +export interface AppOptionsResponse_ModuleOptionsEntryAmino { + key?: string; + value?: ModuleOptionsAmino; +} +export interface AppOptionsResponse_ModuleOptionsEntryAminoMsg { + type: string; + value: AppOptionsResponse_ModuleOptionsEntryAmino; +} +export interface AppOptionsResponse_ModuleOptionsEntrySDKType { + key: string; + value?: ModuleOptionsSDKType; +} +/** AppOptionsResponse is the RemoteInfoService/AppOptions response type. */ +export interface AppOptionsResponse { + /** module_options is a map of module name to autocli module options. */ + moduleOptions: { + [key: string]: ModuleOptions; + }; +} +export interface AppOptionsResponseProtoMsg { + typeUrl: "/cosmos.autocli.v1.AppOptionsResponse"; + value: Uint8Array; +} +/** AppOptionsResponse is the RemoteInfoService/AppOptions response type. */ +export interface AppOptionsResponseAmino { + /** module_options is a map of module name to autocli module options. */ + module_options?: { + [key: string]: ModuleOptionsAmino; + }; +} +export interface AppOptionsResponseAminoMsg { + type: "cosmos-sdk/AppOptionsResponse"; + value: AppOptionsResponseAmino; +} +/** AppOptionsResponse is the RemoteInfoService/AppOptions response type. */ +export interface AppOptionsResponseSDKType { + module_options: { + [key: string]: ModuleOptionsSDKType; + }; +} +function createBaseAppOptionsRequest(): AppOptionsRequest { + return {}; +} +export const AppOptionsRequest = { + typeUrl: "/cosmos.autocli.v1.AppOptionsRequest", + encode(_: AppOptionsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AppOptionsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAppOptionsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): AppOptionsRequest { + const message = createBaseAppOptionsRequest(); + return message; + }, + fromAmino(_: AppOptionsRequestAmino): AppOptionsRequest { + const message = createBaseAppOptionsRequest(); + return message; + }, + toAmino(_: AppOptionsRequest): AppOptionsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: AppOptionsRequestAminoMsg): AppOptionsRequest { + return AppOptionsRequest.fromAmino(object.value); + }, + toAminoMsg(message: AppOptionsRequest): AppOptionsRequestAminoMsg { + return { + type: "cosmos-sdk/AppOptionsRequest", + value: AppOptionsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: AppOptionsRequestProtoMsg): AppOptionsRequest { + return AppOptionsRequest.decode(message.value); + }, + toProto(message: AppOptionsRequest): Uint8Array { + return AppOptionsRequest.encode(message).finish(); + }, + toProtoMsg(message: AppOptionsRequest): AppOptionsRequestProtoMsg { + return { + typeUrl: "/cosmos.autocli.v1.AppOptionsRequest", + value: AppOptionsRequest.encode(message).finish() + }; + } +}; +function createBaseAppOptionsResponse_ModuleOptionsEntry(): AppOptionsResponse_ModuleOptionsEntry { + return { + key: "", + value: undefined + }; +} +export const AppOptionsResponse_ModuleOptionsEntry = { + encode(message: AppOptionsResponse_ModuleOptionsEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + ModuleOptions.encode(message.value, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AppOptionsResponse_ModuleOptionsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAppOptionsResponse_ModuleOptionsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + message.value = ModuleOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AppOptionsResponse_ModuleOptionsEntry { + const message = createBaseAppOptionsResponse_ModuleOptionsEntry(); + message.key = object.key ?? ""; + message.value = object.value !== undefined && object.value !== null ? ModuleOptions.fromPartial(object.value) : undefined; + return message; + }, + fromAmino(object: AppOptionsResponse_ModuleOptionsEntryAmino): AppOptionsResponse_ModuleOptionsEntry { + const message = createBaseAppOptionsResponse_ModuleOptionsEntry(); + if (object.key !== undefined && object.key !== null) { + message.key = object.key; + } + if (object.value !== undefined && object.value !== null) { + message.value = ModuleOptions.fromAmino(object.value); + } + return message; + }, + toAmino(message: AppOptionsResponse_ModuleOptionsEntry): AppOptionsResponse_ModuleOptionsEntryAmino { + const obj: any = {}; + obj.key = message.key === "" ? undefined : message.key; + obj.value = message.value ? ModuleOptions.toAmino(message.value) : undefined; + return obj; + }, + fromAminoMsg(object: AppOptionsResponse_ModuleOptionsEntryAminoMsg): AppOptionsResponse_ModuleOptionsEntry { + return AppOptionsResponse_ModuleOptionsEntry.fromAmino(object.value); + }, + fromProtoMsg(message: AppOptionsResponse_ModuleOptionsEntryProtoMsg): AppOptionsResponse_ModuleOptionsEntry { + return AppOptionsResponse_ModuleOptionsEntry.decode(message.value); + }, + toProto(message: AppOptionsResponse_ModuleOptionsEntry): Uint8Array { + return AppOptionsResponse_ModuleOptionsEntry.encode(message).finish(); + } +}; +function createBaseAppOptionsResponse(): AppOptionsResponse { + return { + moduleOptions: {} + }; +} +export const AppOptionsResponse = { + typeUrl: "/cosmos.autocli.v1.AppOptionsResponse", + encode(message: AppOptionsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + Object.entries(message.moduleOptions).forEach(([key, value]) => { + AppOptionsResponse_ModuleOptionsEntry.encode({ + key: (key as any), + value + }, writer.uint32(10).fork()).ldelim(); + }); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AppOptionsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAppOptionsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + const entry1 = AppOptionsResponse_ModuleOptionsEntry.decode(reader, reader.uint32()); + if (entry1.value !== undefined) { + message.moduleOptions[entry1.key] = entry1.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AppOptionsResponse { + const message = createBaseAppOptionsResponse(); + message.moduleOptions = Object.entries(object.moduleOptions ?? {}).reduce<{ + [key: string]: ModuleOptions; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = ModuleOptions.fromPartial(value); + } + return acc; + }, {}); + return message; + }, + fromAmino(object: AppOptionsResponseAmino): AppOptionsResponse { + const message = createBaseAppOptionsResponse(); + message.moduleOptions = Object.entries(object.module_options ?? {}).reduce<{ + [key: string]: ModuleOptions; + }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = ModuleOptions.fromAmino(value); + } + return acc; + }, {}); + return message; + }, + toAmino(message: AppOptionsResponse): AppOptionsResponseAmino { + const obj: any = {}; + obj.module_options = {}; + if (message.moduleOptions) { + Object.entries(message.moduleOptions).forEach(([k, v]) => { + obj.module_options[k] = ModuleOptions.toAmino(v); + }); + } + return obj; + }, + fromAminoMsg(object: AppOptionsResponseAminoMsg): AppOptionsResponse { + return AppOptionsResponse.fromAmino(object.value); + }, + toAminoMsg(message: AppOptionsResponse): AppOptionsResponseAminoMsg { + return { + type: "cosmos-sdk/AppOptionsResponse", + value: AppOptionsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: AppOptionsResponseProtoMsg): AppOptionsResponse { + return AppOptionsResponse.decode(message.value); + }, + toProto(message: AppOptionsResponse): Uint8Array { + return AppOptionsResponse.encode(message).finish(); + }, + toProtoMsg(message: AppOptionsResponse): AppOptionsResponseProtoMsg { + return { + typeUrl: "/cosmos.autocli.v1.AppOptionsResponse", + value: AppOptionsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/bank/v1beta1/authz.ts b/src/codegen/cosmos/bank/v1beta1/authz.ts index e0ab78f..6c4f0a9 100644 --- a/src/codegen/cosmos/bank/v1beta1/authz.ts +++ b/src/codegen/cosmos/bank/v1beta1/authz.ts @@ -8,6 +8,13 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; */ export interface SendAuthorization { spendLimit: Coin[]; + /** + * allow_list specifies an optional list of addresses to whom the grantee can send tokens on behalf of the + * granter. If omitted, any recipient is allowed. + * + * Since: cosmos-sdk 0.47 + */ + allowList: string[]; } export interface SendAuthorizationProtoMsg { typeUrl: "/cosmos.bank.v1beta1.SendAuthorization"; @@ -20,7 +27,14 @@ export interface SendAuthorizationProtoMsg { * Since: cosmos-sdk 0.43 */ export interface SendAuthorizationAmino { - spend_limit?: CoinAmino[]; + spend_limit: CoinAmino[]; + /** + * allow_list specifies an optional list of addresses to whom the grantee can send tokens on behalf of the + * granter. If omitted, any recipient is allowed. + * + * Since: cosmos-sdk 0.47 + */ + allow_list?: string[]; } export interface SendAuthorizationAminoMsg { type: "cosmos-sdk/SendAuthorization"; @@ -34,10 +48,12 @@ export interface SendAuthorizationAminoMsg { */ export interface SendAuthorizationSDKType { spend_limit: CoinSDKType[]; + allow_list: string[]; } function createBaseSendAuthorization(): SendAuthorization { return { - spendLimit: [] + spendLimit: [], + allowList: [] }; } export const SendAuthorization = { @@ -46,6 +62,9 @@ export const SendAuthorization = { for (const v of message.spendLimit) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } + for (const v of message.allowList) { + writer.uint32(18).string(v!); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): SendAuthorization { @@ -58,6 +77,9 @@ export const SendAuthorization = { case 1: message.spendLimit.push(Coin.decode(reader, reader.uint32())); break; + case 2: + message.allowList.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -68,11 +90,13 @@ export const SendAuthorization = { fromPartial(object: Partial): SendAuthorization { const message = createBaseSendAuthorization(); message.spendLimit = object.spendLimit?.map(e => Coin.fromPartial(e)) || []; + message.allowList = object.allowList?.map(e => e) || []; return message; }, fromAmino(object: SendAuthorizationAmino): SendAuthorization { const message = createBaseSendAuthorization(); message.spendLimit = object.spend_limit?.map(e => Coin.fromAmino(e)) || []; + message.allowList = object.allow_list?.map(e => e) || []; return message; }, toAmino(message: SendAuthorization): SendAuthorizationAmino { @@ -82,6 +106,11 @@ export const SendAuthorization = { } else { obj.spend_limit = message.spendLimit; } + if (message.allowList) { + obj.allow_list = message.allowList.map(e => e); + } else { + obj.allow_list = message.allowList; + } return obj; }, fromAminoMsg(object: SendAuthorizationAminoMsg): SendAuthorization { diff --git a/src/codegen/cosmos/bank/v1beta1/bank.ts b/src/codegen/cosmos/bank/v1beta1/bank.ts index 284341a..d527415 100644 --- a/src/codegen/cosmos/bank/v1beta1/bank.ts +++ b/src/codegen/cosmos/bank/v1beta1/bank.ts @@ -2,6 +2,14 @@ import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; /** Params defines the parameters for the bank module. */ export interface Params { + /** + * Deprecated: Use of SendEnabled in params is deprecated. + * For genesis, use the newly added send_enabled field in the genesis object. + * Storage, lookup, and manipulation of this information is now in the keeper. + * + * As of cosmos-sdk 0.47, this only exists for backwards compatibility of genesis files. + */ + /** @deprecated */ sendEnabled: SendEnabled[]; defaultSendEnabled: boolean; } @@ -11,15 +19,24 @@ export interface ParamsProtoMsg { } /** Params defines the parameters for the bank module. */ export interface ParamsAmino { + /** + * Deprecated: Use of SendEnabled in params is deprecated. + * For genesis, use the newly added send_enabled field in the genesis object. + * Storage, lookup, and manipulation of this information is now in the keeper. + * + * As of cosmos-sdk 0.47, this only exists for backwards compatibility of genesis files. + */ + /** @deprecated */ send_enabled?: SendEnabledAmino[]; default_send_enabled?: boolean; } export interface ParamsAminoMsg { - type: "cosmos-sdk/Params"; + type: "cosmos-sdk/x/bank/Params"; value: ParamsAmino; } /** Params defines the parameters for the bank module. */ export interface ParamsSDKType { + /** @deprecated */ send_enabled: SendEnabledSDKType[]; default_send_enabled: boolean; } @@ -67,7 +84,7 @@ export interface InputProtoMsg { /** Input models transaction input. */ export interface InputAmino { address?: string; - coins?: CoinAmino[]; + coins: CoinAmino[]; } export interface InputAminoMsg { type: "cosmos-sdk/Input"; @@ -90,7 +107,7 @@ export interface OutputProtoMsg { /** Output models transaction outputs. */ export interface OutputAmino { address?: string; - coins?: CoinAmino[]; + coins: CoinAmino[]; } export interface OutputAminoMsg { type: "cosmos-sdk/Output"; @@ -121,7 +138,7 @@ export interface SupplyProtoMsg { */ /** @deprecated */ export interface SupplyAmino { - total?: CoinAmino[]; + total: CoinAmino[]; } export interface SupplyAminoMsg { type: "cosmos-sdk/Supply"; @@ -146,7 +163,7 @@ export interface DenomUnit { /** * exponent represents power of 10 exponent that one must * raise the base_denom to in order to equal the given DenomUnit's denom - * 1 denom = 1^exponent base_denom + * 1 denom = 10^exponent base_denom * (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with * exponent = 6, thus: 1 atom = 10^6 uatom). */ @@ -168,7 +185,7 @@ export interface DenomUnitAmino { /** * exponent represents power of 10 exponent that one must * raise the base_denom to in order to equal the given DenomUnit's denom - * 1 denom = 1^exponent base_denom + * 1 denom = 10^exponent base_denom * (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with * exponent = 6, thus: 1 atom = 10^6 uatom). */ @@ -217,6 +234,19 @@ export interface Metadata { * Since: cosmos-sdk 0.43 */ symbol: string; + /** + * URI to a document (on or off-chain) that contains additional information. Optional. + * + * Since: cosmos-sdk 0.46 + */ + uri: string; + /** + * URIHash is a sha256 hash of a document pointed by URI. It's used to verify that + * the document didn't change. Optional. + * + * Since: cosmos-sdk 0.46 + */ + uriHash: string; } export interface MetadataProtoMsg { typeUrl: "/cosmos.bank.v1beta1.Metadata"; @@ -250,6 +280,19 @@ export interface MetadataAmino { * Since: cosmos-sdk 0.43 */ symbol?: string; + /** + * URI to a document (on or off-chain) that contains additional information. Optional. + * + * Since: cosmos-sdk 0.46 + */ + uri?: string; + /** + * URIHash is a sha256 hash of a document pointed by URI. It's used to verify that + * the document didn't change. Optional. + * + * Since: cosmos-sdk 0.46 + */ + uri_hash?: string; } export interface MetadataAminoMsg { type: "cosmos-sdk/Metadata"; @@ -266,6 +309,8 @@ export interface MetadataSDKType { display: string; name: string; symbol: string; + uri: string; + uri_hash: string; } function createBaseParams(): Params { return { @@ -333,7 +378,7 @@ export const Params = { }, toAminoMsg(message: Params): ParamsAminoMsg { return { - type: "cosmos-sdk/Params", + type: "cosmos-sdk/x/bank/Params", value: Params.toAmino(message) }; }, @@ -770,7 +815,9 @@ function createBaseMetadata(): Metadata { base: "", display: "", name: "", - symbol: "" + symbol: "", + uri: "", + uriHash: "" }; } export const Metadata = { @@ -794,6 +841,12 @@ export const Metadata = { if (message.symbol !== "") { writer.uint32(50).string(message.symbol); } + if (message.uri !== "") { + writer.uint32(58).string(message.uri); + } + if (message.uriHash !== "") { + writer.uint32(66).string(message.uriHash); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Metadata { @@ -821,6 +874,12 @@ export const Metadata = { case 6: message.symbol = reader.string(); break; + case 7: + message.uri = reader.string(); + break; + case 8: + message.uriHash = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -836,6 +895,8 @@ export const Metadata = { message.display = object.display ?? ""; message.name = object.name ?? ""; message.symbol = object.symbol ?? ""; + message.uri = object.uri ?? ""; + message.uriHash = object.uriHash ?? ""; return message; }, fromAmino(object: MetadataAmino): Metadata { @@ -856,6 +917,12 @@ export const Metadata = { if (object.symbol !== undefined && object.symbol !== null) { message.symbol = object.symbol; } + if (object.uri !== undefined && object.uri !== null) { + message.uri = object.uri; + } + if (object.uri_hash !== undefined && object.uri_hash !== null) { + message.uriHash = object.uri_hash; + } return message; }, toAmino(message: Metadata): MetadataAmino { @@ -870,6 +937,8 @@ export const Metadata = { obj.display = message.display === "" ? undefined : message.display; obj.name = message.name === "" ? undefined : message.name; obj.symbol = message.symbol === "" ? undefined : message.symbol; + obj.uri = message.uri === "" ? undefined : message.uri; + obj.uri_hash = message.uriHash === "" ? undefined : message.uriHash; return obj; }, fromAminoMsg(object: MetadataAminoMsg): Metadata { diff --git a/src/codegen/cosmos/bank/v1beta1/genesis.ts b/src/codegen/cosmos/bank/v1beta1/genesis.ts index e704012..3a63f92 100644 --- a/src/codegen/cosmos/bank/v1beta1/genesis.ts +++ b/src/codegen/cosmos/bank/v1beta1/genesis.ts @@ -1,9 +1,9 @@ -import { Params, ParamsAmino, ParamsSDKType, Metadata, MetadataAmino, MetadataSDKType } from "./bank"; +import { Params, ParamsAmino, ParamsSDKType, Metadata, MetadataAmino, MetadataSDKType, SendEnabled, SendEnabledAmino, SendEnabledSDKType } from "./bank"; import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; /** GenesisState defines the bank module's genesis state. */ export interface GenesisState { - /** params defines all the paramaters of the module. */ + /** params defines all the parameters of the module. */ params: Params; /** balances is an array containing the balances of all the accounts. */ balances: Balance[]; @@ -12,8 +12,14 @@ export interface GenesisState { * balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. */ supply: Coin[]; - /** denom_metadata defines the metadata of the differents coins. */ + /** denom_metadata defines the metadata of the different coins. */ denomMetadata: Metadata[]; + /** + * send_enabled defines the denoms where send is enabled or disabled. + * + * Since: cosmos-sdk 0.47 + */ + sendEnabled: SendEnabled[]; } export interface GenesisStateProtoMsg { typeUrl: "/cosmos.bank.v1beta1.GenesisState"; @@ -21,17 +27,23 @@ export interface GenesisStateProtoMsg { } /** GenesisState defines the bank module's genesis state. */ export interface GenesisStateAmino { - /** params defines all the paramaters of the module. */ - params?: ParamsAmino; + /** params defines all the parameters of the module. */ + params: ParamsAmino; /** balances is an array containing the balances of all the accounts. */ - balances?: BalanceAmino[]; + balances: BalanceAmino[]; /** * supply represents the total supply. If it is left empty, then supply will be calculated based on the provided * balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. */ - supply?: CoinAmino[]; - /** denom_metadata defines the metadata of the differents coins. */ - denom_metadata?: MetadataAmino[]; + supply: CoinAmino[]; + /** denom_metadata defines the metadata of the different coins. */ + denom_metadata: MetadataAmino[]; + /** + * send_enabled defines the denoms where send is enabled or disabled. + * + * Since: cosmos-sdk 0.47 + */ + send_enabled: SendEnabledAmino[]; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -43,6 +55,7 @@ export interface GenesisStateSDKType { balances: BalanceSDKType[]; supply: CoinSDKType[]; denom_metadata: MetadataSDKType[]; + send_enabled: SendEnabledSDKType[]; } /** * Balance defines an account address and balance pair used in the bank module's @@ -66,7 +79,7 @@ export interface BalanceAmino { /** address is the address of the balance holder. */ address?: string; /** coins defines the different coins this balance holds. */ - coins?: CoinAmino[]; + coins: CoinAmino[]; } export interface BalanceAminoMsg { type: "cosmos-sdk/Balance"; @@ -85,7 +98,8 @@ function createBaseGenesisState(): GenesisState { params: Params.fromPartial({}), balances: [], supply: [], - denomMetadata: [] + denomMetadata: [], + sendEnabled: [] }; } export const GenesisState = { @@ -103,6 +117,9 @@ export const GenesisState = { for (const v of message.denomMetadata) { Metadata.encode(v!, writer.uint32(34).fork()).ldelim(); } + for (const v of message.sendEnabled) { + SendEnabled.encode(v!, writer.uint32(42).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { @@ -124,6 +141,9 @@ export const GenesisState = { case 4: message.denomMetadata.push(Metadata.decode(reader, reader.uint32())); break; + case 5: + message.sendEnabled.push(SendEnabled.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -137,6 +157,7 @@ export const GenesisState = { message.balances = object.balances?.map(e => Balance.fromPartial(e)) || []; message.supply = object.supply?.map(e => Coin.fromPartial(e)) || []; message.denomMetadata = object.denomMetadata?.map(e => Metadata.fromPartial(e)) || []; + message.sendEnabled = object.sendEnabled?.map(e => SendEnabled.fromPartial(e)) || []; return message; }, fromAmino(object: GenesisStateAmino): GenesisState { @@ -147,11 +168,12 @@ export const GenesisState = { message.balances = object.balances?.map(e => Balance.fromAmino(e)) || []; message.supply = object.supply?.map(e => Coin.fromAmino(e)) || []; message.denomMetadata = object.denom_metadata?.map(e => Metadata.fromAmino(e)) || []; + message.sendEnabled = object.send_enabled?.map(e => SendEnabled.fromAmino(e)) || []; return message; }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.params = message.params ? Params.toAmino(message.params) : Params.toAmino(Params.fromPartial({})); if (message.balances) { obj.balances = message.balances.map(e => e ? Balance.toAmino(e) : undefined); } else { @@ -167,6 +189,11 @@ export const GenesisState = { } else { obj.denom_metadata = message.denomMetadata; } + if (message.sendEnabled) { + obj.send_enabled = message.sendEnabled.map(e => e ? SendEnabled.toAmino(e) : undefined); + } else { + obj.send_enabled = message.sendEnabled; + } return obj; }, fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { diff --git a/src/codegen/cosmos/bank/v1beta1/query.lcd.ts b/src/codegen/cosmos/bank/v1beta1/query.lcd.ts index 096bb4e..0787068 100644 --- a/src/codegen/cosmos/bank/v1beta1/query.lcd.ts +++ b/src/codegen/cosmos/bank/v1beta1/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../../helpers"; import { LCDClient } from "@cosmology/lcd"; -import { QueryBalanceRequest, QueryBalanceResponseSDKType, QueryAllBalancesRequest, QueryAllBalancesResponseSDKType, QuerySpendableBalancesRequest, QuerySpendableBalancesResponseSDKType, QueryTotalSupplyRequest, QueryTotalSupplyResponseSDKType, QuerySupplyOfRequest, QuerySupplyOfResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType, QueryDenomMetadataRequest, QueryDenomMetadataResponseSDKType, QueryDenomsMetadataRequest, QueryDenomsMetadataResponseSDKType } from "./query"; +import { QueryBalanceRequest, QueryBalanceResponseSDKType, QueryAllBalancesRequest, QueryAllBalancesResponseSDKType, QuerySpendableBalancesRequest, QuerySpendableBalancesResponseSDKType, QuerySpendableBalanceByDenomRequest, QuerySpendableBalanceByDenomResponseSDKType, QueryTotalSupplyRequest, QueryTotalSupplyResponseSDKType, QuerySupplyOfRequest, QuerySupplyOfResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType, QueryDenomMetadataRequest, QueryDenomMetadataResponseSDKType, QueryDenomMetadataByQueryStringRequest, QueryDenomMetadataByQueryStringResponseSDKType, QueryDenomsMetadataRequest, QueryDenomsMetadataResponseSDKType, QueryDenomOwnersRequest, QueryDenomOwnersResponseSDKType, QueryDenomOwnersByQueryRequest, QueryDenomOwnersByQueryResponseSDKType, QuerySendEnabledRequest, QuerySendEnabledResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -12,11 +12,16 @@ export class LCDQueryClient { this.balance = this.balance.bind(this); this.allBalances = this.allBalances.bind(this); this.spendableBalances = this.spendableBalances.bind(this); + this.spendableBalanceByDenom = this.spendableBalanceByDenom.bind(this); this.totalSupply = this.totalSupply.bind(this); this.supplyOf = this.supplyOf.bind(this); this.params = this.params.bind(this); this.denomMetadata = this.denomMetadata.bind(this); + this.denomMetadataByQueryString = this.denomMetadataByQueryString.bind(this); this.denomsMetadata = this.denomsMetadata.bind(this); + this.denomOwners = this.denomOwners.bind(this); + this.denomOwnersByQuery = this.denomOwnersByQuery.bind(this); + this.sendEnabled = this.sendEnabled.bind(this); } /* Balance queries the balance of a single coin for a single account. */ async balance(params: QueryBalanceRequest): Promise { @@ -29,7 +34,10 @@ export class LCDQueryClient { const endpoint = `cosmos/bank/v1beta1/balances/${params.address}/by_denom`; return await this.req.get(endpoint, options); } - /* AllBalances queries the balance of all coins for a single account. */ + /* AllBalances queries the balance of all coins for a single account. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. */ async allBalances(params: QueryAllBalancesRequest): Promise { const options: any = { params: {} @@ -37,11 +45,19 @@ export class LCDQueryClient { if (typeof params?.pagination !== "undefined") { setPaginationParams(options, params.pagination); } + if (typeof params?.resolveDenom !== "undefined") { + options.params.resolve_denom = params.resolveDenom; + } const endpoint = `cosmos/bank/v1beta1/balances/${params.address}`; return await this.req.get(endpoint, options); } - /* SpendableBalances queries the spenable balance of all coins for a single - account. */ + /* SpendableBalances queries the spendable balance of all coins for a single + account. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. + + Since: cosmos-sdk 0.46 */ async spendableBalances(params: QuerySpendableBalancesRequest): Promise { const options: any = { params: {} @@ -52,7 +68,27 @@ export class LCDQueryClient { const endpoint = `cosmos/bank/v1beta1/spendable_balances/${params.address}`; return await this.req.get(endpoint, options); } - /* TotalSupply queries the total supply of all coins. */ + /* SpendableBalanceByDenom queries the spendable balance of a single denom for + a single account. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. + + Since: cosmos-sdk 0.47 */ + async spendableBalanceByDenom(params: QuerySpendableBalanceByDenomRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.denom !== "undefined") { + options.params.denom = params.denom; + } + const endpoint = `cosmos/bank/v1beta1/spendable_balances/${params.address}/by_denom`; + return await this.req.get(endpoint, options); + } + /* TotalSupply queries the total supply of all coins. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. */ async totalSupply(params: QueryTotalSupplyRequest = { pagination: undefined }): Promise { @@ -65,22 +101,43 @@ export class LCDQueryClient { const endpoint = `cosmos/bank/v1beta1/supply`; return await this.req.get(endpoint, options); } - /* SupplyOf queries the supply of a single coin. */ + /* SupplyOf queries the supply of a single coin. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. */ async supplyOf(params: QuerySupplyOfRequest): Promise { - const endpoint = `cosmos/bank/v1beta1/supply/${params.denom}`; - return await this.req.get(endpoint); + const options: any = { + params: {} + }; + if (typeof params?.denom !== "undefined") { + options.params.denom = params.denom; + } + const endpoint = `cosmos/bank/v1beta1/supply/by_denom`; + return await this.req.get(endpoint, options); } /* Params queries the parameters of x/bank module. */ async params(_params: QueryParamsRequest = {}): Promise { const endpoint = `cosmos/bank/v1beta1/params`; return await this.req.get(endpoint); } - /* DenomsMetadata queries the client metadata of a given coin denomination. */ + /* DenomMetadata queries the client metadata of a given coin denomination. */ async denomMetadata(params: QueryDenomMetadataRequest): Promise { const endpoint = `cosmos/bank/v1beta1/denoms_metadata/${params.denom}`; return await this.req.get(endpoint); } - /* DenomsMetadata queries the client metadata for all registered coin denominations. */ + /* DenomMetadataByQueryString queries the client metadata of a given coin denomination. */ + async denomMetadataByQueryString(params: QueryDenomMetadataByQueryStringRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.denom !== "undefined") { + options.params.denom = params.denom; + } + const endpoint = `cosmos/bank/v1beta1/denoms_metadata_by_query_string`; + return await this.req.get(endpoint, options); + } + /* DenomsMetadata queries the client metadata for all registered coin + denominations. */ async denomsMetadata(params: QueryDenomsMetadataRequest = { pagination: undefined }): Promise { @@ -93,4 +150,58 @@ export class LCDQueryClient { const endpoint = `cosmos/bank/v1beta1/denoms_metadata`; return await this.req.get(endpoint, options); } + /* DenomOwners queries for all account addresses that own a particular token + denomination. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. + + Since: cosmos-sdk 0.46 */ + async denomOwners(params: QueryDenomOwnersRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + const endpoint = `cosmos/bank/v1beta1/denom_owners/${params.denom}`; + return await this.req.get(endpoint, options); + } + /* DenomOwnersByQuery queries for all account addresses that own a particular token + denomination. + + Since: cosmos-sdk 0.50.3 */ + async denomOwnersByQuery(params: QueryDenomOwnersByQueryRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.denom !== "undefined") { + options.params.denom = params.denom; + } + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + const endpoint = `cosmos/bank/v1beta1/denom_owners_by_query`; + return await this.req.get(endpoint, options); + } + /* SendEnabled queries for SendEnabled entries. + + This query only returns denominations that have specific SendEnabled settings. + Any denomination that does not have a specific setting will use the default + params.default_send_enabled, and will not be returned by this query. + + Since: cosmos-sdk 0.47 */ + async sendEnabled(params: QuerySendEnabledRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.denoms !== "undefined") { + options.params.denoms = params.denoms; + } + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + const endpoint = `cosmos/bank/v1beta1/send_enabled`; + return await this.req.get(endpoint, options); + } } \ No newline at end of file diff --git a/src/codegen/cosmos/bank/v1beta1/query.rpc.Query.ts b/src/codegen/cosmos/bank/v1beta1/query.rpc.Query.ts index b523be6..2cd76af 100644 --- a/src/codegen/cosmos/bank/v1beta1/query.rpc.Query.ts +++ b/src/codegen/cosmos/bank/v1beta1/query.rpc.Query.ts @@ -1,28 +1,90 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryBalanceRequest, QueryBalanceResponse, QueryAllBalancesRequest, QueryAllBalancesResponse, QuerySpendableBalancesRequest, QuerySpendableBalancesResponse, QueryTotalSupplyRequest, QueryTotalSupplyResponse, QuerySupplyOfRequest, QuerySupplyOfResponse, QueryParamsRequest, QueryParamsResponse, QueryDenomMetadataRequest, QueryDenomMetadataResponse, QueryDenomsMetadataRequest, QueryDenomsMetadataResponse } from "./query"; +import { QueryBalanceRequest, QueryBalanceResponse, QueryAllBalancesRequest, QueryAllBalancesResponse, QuerySpendableBalancesRequest, QuerySpendableBalancesResponse, QuerySpendableBalanceByDenomRequest, QuerySpendableBalanceByDenomResponse, QueryTotalSupplyRequest, QueryTotalSupplyResponse, QuerySupplyOfRequest, QuerySupplyOfResponse, QueryParamsRequest, QueryParamsResponse, QueryDenomMetadataRequest, QueryDenomMetadataResponse, QueryDenomMetadataByQueryStringRequest, QueryDenomMetadataByQueryStringResponse, QueryDenomsMetadataRequest, QueryDenomsMetadataResponse, QueryDenomOwnersRequest, QueryDenomOwnersResponse, QueryDenomOwnersByQueryRequest, QueryDenomOwnersByQueryResponse, QuerySendEnabledRequest, QuerySendEnabledResponse } from "./query"; /** Query defines the gRPC querier service. */ export interface Query { /** Balance queries the balance of a single coin for a single account. */ balance(request: QueryBalanceRequest): Promise; - /** AllBalances queries the balance of all coins for a single account. */ + /** + * AllBalances queries the balance of all coins for a single account. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ allBalances(request: QueryAllBalancesRequest): Promise; /** - * SpendableBalances queries the spenable balance of all coins for a single + * SpendableBalances queries the spendable balance of all coins for a single * account. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + * + * Since: cosmos-sdk 0.46 */ spendableBalances(request: QuerySpendableBalancesRequest): Promise; - /** TotalSupply queries the total supply of all coins. */ + /** + * SpendableBalanceByDenom queries the spendable balance of a single denom for + * a single account. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + * + * Since: cosmos-sdk 0.47 + */ + spendableBalanceByDenom(request: QuerySpendableBalanceByDenomRequest): Promise; + /** + * TotalSupply queries the total supply of all coins. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ totalSupply(request?: QueryTotalSupplyRequest): Promise; - /** SupplyOf queries the supply of a single coin. */ + /** + * SupplyOf queries the supply of a single coin. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ supplyOf(request: QuerySupplyOfRequest): Promise; /** Params queries the parameters of x/bank module. */ params(request?: QueryParamsRequest): Promise; - /** DenomsMetadata queries the client metadata of a given coin denomination. */ + /** DenomMetadata queries the client metadata of a given coin denomination. */ denomMetadata(request: QueryDenomMetadataRequest): Promise; - /** DenomsMetadata queries the client metadata for all registered coin denominations. */ + /** DenomMetadataByQueryString queries the client metadata of a given coin denomination. */ + denomMetadataByQueryString(request: QueryDenomMetadataByQueryStringRequest): Promise; + /** + * DenomsMetadata queries the client metadata for all registered coin + * denominations. + */ denomsMetadata(request?: QueryDenomsMetadataRequest): Promise; + /** + * DenomOwners queries for all account addresses that own a particular token + * denomination. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + * + * Since: cosmos-sdk 0.46 + */ + denomOwners(request: QueryDenomOwnersRequest): Promise; + /** + * DenomOwnersByQuery queries for all account addresses that own a particular token + * denomination. + * + * Since: cosmos-sdk 0.50.3 + */ + denomOwnersByQuery(request: QueryDenomOwnersByQueryRequest): Promise; + /** + * SendEnabled queries for SendEnabled entries. + * + * This query only returns denominations that have specific SendEnabled settings. + * Any denomination that does not have a specific setting will use the default + * params.default_send_enabled, and will not be returned by this query. + * + * Since: cosmos-sdk 0.47 + */ + sendEnabled(request: QuerySendEnabledRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -31,11 +93,16 @@ export class QueryClientImpl implements Query { this.balance = this.balance.bind(this); this.allBalances = this.allBalances.bind(this); this.spendableBalances = this.spendableBalances.bind(this); + this.spendableBalanceByDenom = this.spendableBalanceByDenom.bind(this); this.totalSupply = this.totalSupply.bind(this); this.supplyOf = this.supplyOf.bind(this); this.params = this.params.bind(this); this.denomMetadata = this.denomMetadata.bind(this); + this.denomMetadataByQueryString = this.denomMetadataByQueryString.bind(this); this.denomsMetadata = this.denomsMetadata.bind(this); + this.denomOwners = this.denomOwners.bind(this); + this.denomOwnersByQuery = this.denomOwnersByQuery.bind(this); + this.sendEnabled = this.sendEnabled.bind(this); } balance(request: QueryBalanceRequest): Promise { const data = QueryBalanceRequest.encode(request).finish(); @@ -52,6 +119,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "SpendableBalances", data); return promise.then(data => QuerySpendableBalancesResponse.decode(new BinaryReader(data))); } + spendableBalanceByDenom(request: QuerySpendableBalanceByDenomRequest): Promise { + const data = QuerySpendableBalanceByDenomRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "SpendableBalanceByDenom", data); + return promise.then(data => QuerySpendableBalanceByDenomResponse.decode(new BinaryReader(data))); + } totalSupply(request: QueryTotalSupplyRequest = { pagination: undefined }): Promise { @@ -74,6 +146,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "DenomMetadata", data); return promise.then(data => QueryDenomMetadataResponse.decode(new BinaryReader(data))); } + denomMetadataByQueryString(request: QueryDenomMetadataByQueryStringRequest): Promise { + const data = QueryDenomMetadataByQueryStringRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "DenomMetadataByQueryString", data); + return promise.then(data => QueryDenomMetadataByQueryStringResponse.decode(new BinaryReader(data))); + } denomsMetadata(request: QueryDenomsMetadataRequest = { pagination: undefined }): Promise { @@ -81,6 +158,21 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "DenomsMetadata", data); return promise.then(data => QueryDenomsMetadataResponse.decode(new BinaryReader(data))); } + denomOwners(request: QueryDenomOwnersRequest): Promise { + const data = QueryDenomOwnersRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "DenomOwners", data); + return promise.then(data => QueryDenomOwnersResponse.decode(new BinaryReader(data))); + } + denomOwnersByQuery(request: QueryDenomOwnersByQueryRequest): Promise { + const data = QueryDenomOwnersByQueryRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "DenomOwnersByQuery", data); + return promise.then(data => QueryDenomOwnersByQueryResponse.decode(new BinaryReader(data))); + } + sendEnabled(request: QuerySendEnabledRequest): Promise { + const data = QuerySendEnabledRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Query", "SendEnabled", data); + return promise.then(data => QuerySendEnabledResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -95,6 +187,9 @@ export const createRpcQueryExtension = (base: QueryClient) => { spendableBalances(request: QuerySpendableBalancesRequest): Promise { return queryService.spendableBalances(request); }, + spendableBalanceByDenom(request: QuerySpendableBalanceByDenomRequest): Promise { + return queryService.spendableBalanceByDenom(request); + }, totalSupply(request?: QueryTotalSupplyRequest): Promise { return queryService.totalSupply(request); }, @@ -107,8 +202,20 @@ export const createRpcQueryExtension = (base: QueryClient) => { denomMetadata(request: QueryDenomMetadataRequest): Promise { return queryService.denomMetadata(request); }, + denomMetadataByQueryString(request: QueryDenomMetadataByQueryStringRequest): Promise { + return queryService.denomMetadataByQueryString(request); + }, denomsMetadata(request?: QueryDenomsMetadataRequest): Promise { return queryService.denomsMetadata(request); + }, + denomOwners(request: QueryDenomOwnersRequest): Promise { + return queryService.denomOwners(request); + }, + denomOwnersByQuery(request: QueryDenomOwnersByQueryRequest): Promise { + return queryService.denomOwnersByQuery(request); + }, + sendEnabled(request: QuerySendEnabledRequest): Promise { + return queryService.sendEnabled(request); } }; }; \ No newline at end of file diff --git a/src/codegen/cosmos/bank/v1beta1/query.ts b/src/codegen/cosmos/bank/v1beta1/query.ts index 2f84cfd..94b618e 100644 --- a/src/codegen/cosmos/bank/v1beta1/query.ts +++ b/src/codegen/cosmos/bank/v1beta1/query.ts @@ -1,6 +1,6 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; -import { Params, ParamsAmino, ParamsSDKType, Metadata, MetadataAmino, MetadataSDKType } from "./bank"; +import { Params, ParamsAmino, ParamsSDKType, Metadata, MetadataAmino, MetadataSDKType, SendEnabled, SendEnabledAmino, SendEnabledSDKType } from "./bank"; import { BinaryReader, BinaryWriter } from "../../../binary"; /** QueryBalanceRequest is the request type for the Query/Balance RPC method. */ export interface QueryBalanceRequest { @@ -57,6 +57,12 @@ export interface QueryAllBalancesRequest { address: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequest; + /** + * resolve_denom is the flag to resolve the denom into a human-readable form from the metadata. + * + * Since: cosmos-sdk 0.50 + */ + resolveDenom: boolean; } export interface QueryAllBalancesRequestProtoMsg { typeUrl: "/cosmos.bank.v1beta1.QueryAllBalancesRequest"; @@ -68,6 +74,12 @@ export interface QueryAllBalancesRequestAmino { address?: string; /** pagination defines an optional pagination for the request. */ pagination?: PageRequestAmino; + /** + * resolve_denom is the flag to resolve the denom into a human-readable form from the metadata. + * + * Since: cosmos-sdk 0.50 + */ + resolve_denom?: boolean; } export interface QueryAllBalancesRequestAminoMsg { type: "cosmos-sdk/QueryAllBalancesRequest"; @@ -77,6 +89,7 @@ export interface QueryAllBalancesRequestAminoMsg { export interface QueryAllBalancesRequestSDKType { address: string; pagination?: PageRequestSDKType; + resolve_denom: boolean; } /** * QueryAllBalancesResponse is the response type for the Query/AllBalances RPC @@ -98,7 +111,7 @@ export interface QueryAllBalancesResponseProtoMsg { */ export interface QueryAllBalancesResponseAmino { /** balances is the balances of all the coins. */ - balances?: CoinAmino[]; + balances: CoinAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -117,6 +130,8 @@ export interface QueryAllBalancesResponseSDKType { /** * QuerySpendableBalancesRequest defines the gRPC request structure for querying * an account's spendable balances. + * + * Since: cosmos-sdk 0.46 */ export interface QuerySpendableBalancesRequest { /** address is the address to query spendable balances for. */ @@ -131,6 +146,8 @@ export interface QuerySpendableBalancesRequestProtoMsg { /** * QuerySpendableBalancesRequest defines the gRPC request structure for querying * an account's spendable balances. + * + * Since: cosmos-sdk 0.46 */ export interface QuerySpendableBalancesRequestAmino { /** address is the address to query spendable balances for. */ @@ -145,6 +162,8 @@ export interface QuerySpendableBalancesRequestAminoMsg { /** * QuerySpendableBalancesRequest defines the gRPC request structure for querying * an account's spendable balances. + * + * Since: cosmos-sdk 0.46 */ export interface QuerySpendableBalancesRequestSDKType { address: string; @@ -153,6 +172,8 @@ export interface QuerySpendableBalancesRequestSDKType { /** * QuerySpendableBalancesResponse defines the gRPC response structure for querying * an account's spendable balances. + * + * Since: cosmos-sdk 0.46 */ export interface QuerySpendableBalancesResponse { /** balances is the spendable balances of all the coins. */ @@ -167,10 +188,12 @@ export interface QuerySpendableBalancesResponseProtoMsg { /** * QuerySpendableBalancesResponse defines the gRPC response structure for querying * an account's spendable balances. + * + * Since: cosmos-sdk 0.46 */ export interface QuerySpendableBalancesResponseAmino { /** balances is the spendable balances of all the coins. */ - balances?: CoinAmino[]; + balances: CoinAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -181,11 +204,92 @@ export interface QuerySpendableBalancesResponseAminoMsg { /** * QuerySpendableBalancesResponse defines the gRPC response structure for querying * an account's spendable balances. + * + * Since: cosmos-sdk 0.46 */ export interface QuerySpendableBalancesResponseSDKType { balances: CoinSDKType[]; pagination?: PageResponseSDKType; } +/** + * QuerySpendableBalanceByDenomRequest defines the gRPC request structure for + * querying an account's spendable balance for a specific denom. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySpendableBalanceByDenomRequest { + /** address is the address to query balances for. */ + address: string; + /** denom is the coin denom to query balances for. */ + denom: string; +} +export interface QuerySpendableBalanceByDenomRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest"; + value: Uint8Array; +} +/** + * QuerySpendableBalanceByDenomRequest defines the gRPC request structure for + * querying an account's spendable balance for a specific denom. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySpendableBalanceByDenomRequestAmino { + /** address is the address to query balances for. */ + address?: string; + /** denom is the coin denom to query balances for. */ + denom?: string; +} +export interface QuerySpendableBalanceByDenomRequestAminoMsg { + type: "cosmos-sdk/QuerySpendableBalanceByDenomRequest"; + value: QuerySpendableBalanceByDenomRequestAmino; +} +/** + * QuerySpendableBalanceByDenomRequest defines the gRPC request structure for + * querying an account's spendable balance for a specific denom. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySpendableBalanceByDenomRequestSDKType { + address: string; + denom: string; +} +/** + * QuerySpendableBalanceByDenomResponse defines the gRPC response structure for + * querying an account's spendable balance for a specific denom. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySpendableBalanceByDenomResponse { + /** balance is the balance of the coin. */ + balance?: Coin; +} +export interface QuerySpendableBalanceByDenomResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse"; + value: Uint8Array; +} +/** + * QuerySpendableBalanceByDenomResponse defines the gRPC response structure for + * querying an account's spendable balance for a specific denom. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySpendableBalanceByDenomResponseAmino { + /** balance is the balance of the coin. */ + balance?: CoinAmino; +} +export interface QuerySpendableBalanceByDenomResponseAminoMsg { + type: "cosmos-sdk/QuerySpendableBalanceByDenomResponse"; + value: QuerySpendableBalanceByDenomResponseAmino; +} +/** + * QuerySpendableBalanceByDenomResponse defines the gRPC response structure for + * querying an account's spendable balance for a specific denom. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySpendableBalanceByDenomResponseSDKType { + balance?: CoinSDKType; +} /** * QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC * method. @@ -249,7 +353,7 @@ export interface QueryTotalSupplyResponseProtoMsg { */ export interface QueryTotalSupplyResponseAmino { /** supply is the supply of the coins */ - supply?: CoinAmino[]; + supply: CoinAmino[]; /** * pagination defines the pagination in the response. * @@ -303,7 +407,7 @@ export interface QuerySupplyOfResponseProtoMsg { /** QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. */ export interface QuerySupplyOfResponseAmino { /** amount is the supply of the coin. */ - amount?: CoinAmino; + amount: CoinAmino; } export interface QuerySupplyOfResponseAminoMsg { type: "cosmos-sdk/QuerySupplyOfResponse"; @@ -329,6 +433,7 @@ export interface QueryParamsRequestAminoMsg { export interface QueryParamsRequestSDKType {} /** QueryParamsResponse defines the response type for querying x/bank parameters. */ export interface QueryParamsResponse { + /** params provides the parameters of the bank module. */ params: Params; } export interface QueryParamsResponseProtoMsg { @@ -337,7 +442,8 @@ export interface QueryParamsResponseProtoMsg { } /** QueryParamsResponse defines the response type for querying x/bank parameters. */ export interface QueryParamsResponseAmino { - params?: ParamsAmino; + /** params provides the parameters of the bank module. */ + params: ParamsAmino; } export interface QueryParamsResponseAminoMsg { type: "cosmos-sdk/QueryParamsResponse"; @@ -389,7 +495,7 @@ export interface QueryDenomsMetadataResponseProtoMsg { */ export interface QueryDenomsMetadataResponseAmino { /** metadata provides the client information for all the registered tokens. */ - metadatas?: MetadataAmino[]; + metadatas: MetadataAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -445,7 +551,7 @@ export interface QueryDenomMetadataResponseProtoMsg { */ export interface QueryDenomMetadataResponseAmino { /** metadata describes and provides all the client information for the requested token. */ - metadata?: MetadataAmino; + metadata: MetadataAmino; } export interface QueryDenomMetadataResponseAminoMsg { type: "cosmos-sdk/QueryDenomMetadataResponse"; @@ -458,6 +564,359 @@ export interface QueryDenomMetadataResponseAminoMsg { export interface QueryDenomMetadataResponseSDKType { metadata: MetadataSDKType; } +/** + * QueryDenomMetadataByQueryStringRequest is the request type for the Query/DenomMetadata RPC method. + * Identical with QueryDenomMetadataRequest but receives denom as query string. + */ +export interface QueryDenomMetadataByQueryStringRequest { + /** denom is the coin denom to query the metadata for. */ + denom: string; +} +export interface QueryDenomMetadataByQueryStringRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest"; + value: Uint8Array; +} +/** + * QueryDenomMetadataByQueryStringRequest is the request type for the Query/DenomMetadata RPC method. + * Identical with QueryDenomMetadataRequest but receives denom as query string. + */ +export interface QueryDenomMetadataByQueryStringRequestAmino { + /** denom is the coin denom to query the metadata for. */ + denom?: string; +} +export interface QueryDenomMetadataByQueryStringRequestAminoMsg { + type: "cosmos-sdk/QueryDenomMetadataByQueryStringRequest"; + value: QueryDenomMetadataByQueryStringRequestAmino; +} +/** + * QueryDenomMetadataByQueryStringRequest is the request type for the Query/DenomMetadata RPC method. + * Identical with QueryDenomMetadataRequest but receives denom as query string. + */ +export interface QueryDenomMetadataByQueryStringRequestSDKType { + denom: string; +} +/** + * QueryDenomMetadataByQueryStringResponse is the response type for the Query/DenomMetadata RPC + * method. Identical with QueryDenomMetadataResponse but receives denom as query string in request. + */ +export interface QueryDenomMetadataByQueryStringResponse { + /** metadata describes and provides all the client information for the requested token. */ + metadata: Metadata; +} +export interface QueryDenomMetadataByQueryStringResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse"; + value: Uint8Array; +} +/** + * QueryDenomMetadataByQueryStringResponse is the response type for the Query/DenomMetadata RPC + * method. Identical with QueryDenomMetadataResponse but receives denom as query string in request. + */ +export interface QueryDenomMetadataByQueryStringResponseAmino { + /** metadata describes and provides all the client information for the requested token. */ + metadata: MetadataAmino; +} +export interface QueryDenomMetadataByQueryStringResponseAminoMsg { + type: "cosmos-sdk/QueryDenomMetadataByQueryStringResponse"; + value: QueryDenomMetadataByQueryStringResponseAmino; +} +/** + * QueryDenomMetadataByQueryStringResponse is the response type for the Query/DenomMetadata RPC + * method. Identical with QueryDenomMetadataResponse but receives denom as query string in request. + */ +export interface QueryDenomMetadataByQueryStringResponseSDKType { + metadata: MetadataSDKType; +} +/** + * QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, + * which queries for a paginated set of all account holders of a particular + * denomination. + */ +export interface QueryDenomOwnersRequest { + /** denom defines the coin denomination to query all account holders for. */ + denom: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryDenomOwnersRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersRequest"; + value: Uint8Array; +} +/** + * QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, + * which queries for a paginated set of all account holders of a particular + * denomination. + */ +export interface QueryDenomOwnersRequestAmino { + /** denom defines the coin denomination to query all account holders for. */ + denom?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryDenomOwnersRequestAminoMsg { + type: "cosmos-sdk/QueryDenomOwnersRequest"; + value: QueryDenomOwnersRequestAmino; +} +/** + * QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, + * which queries for a paginated set of all account holders of a particular + * denomination. + */ +export interface QueryDenomOwnersRequestSDKType { + denom: string; + pagination?: PageRequestSDKType; +} +/** + * DenomOwner defines structure representing an account that owns or holds a + * particular denominated token. It contains the account address and account + * balance of the denominated token. + * + * Since: cosmos-sdk 0.46 + */ +export interface DenomOwner { + /** address defines the address that owns a particular denomination. */ + address: string; + /** balance is the balance of the denominated coin for an account. */ + balance: Coin; +} +export interface DenomOwnerProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.DenomOwner"; + value: Uint8Array; +} +/** + * DenomOwner defines structure representing an account that owns or holds a + * particular denominated token. It contains the account address and account + * balance of the denominated token. + * + * Since: cosmos-sdk 0.46 + */ +export interface DenomOwnerAmino { + /** address defines the address that owns a particular denomination. */ + address?: string; + /** balance is the balance of the denominated coin for an account. */ + balance: CoinAmino; +} +export interface DenomOwnerAminoMsg { + type: "cosmos-sdk/DenomOwner"; + value: DenomOwnerAmino; +} +/** + * DenomOwner defines structure representing an account that owns or holds a + * particular denominated token. It contains the account address and account + * balance of the denominated token. + * + * Since: cosmos-sdk 0.46 + */ +export interface DenomOwnerSDKType { + address: string; + balance: CoinSDKType; +} +/** + * QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryDenomOwnersResponse { + denomOwners: DenomOwner[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryDenomOwnersResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersResponse"; + value: Uint8Array; +} +/** + * QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryDenomOwnersResponseAmino { + denom_owners?: DenomOwnerAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryDenomOwnersResponseAminoMsg { + type: "cosmos-sdk/QueryDenomOwnersResponse"; + value: QueryDenomOwnersResponseAmino; +} +/** + * QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryDenomOwnersResponseSDKType { + denom_owners: DenomOwnerSDKType[]; + pagination?: PageResponseSDKType; +} +/** + * QueryDenomOwnersByQueryRequest defines the request type for the DenomOwnersByQuery RPC query, + * which queries for a paginated set of all account holders of a particular + * denomination. + * + * Since: cosmos-sdk 0.50.3 + */ +export interface QueryDenomOwnersByQueryRequest { + /** denom defines the coin denomination to query all account holders for. */ + denom: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryDenomOwnersByQueryRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest"; + value: Uint8Array; +} +/** + * QueryDenomOwnersByQueryRequest defines the request type for the DenomOwnersByQuery RPC query, + * which queries for a paginated set of all account holders of a particular + * denomination. + * + * Since: cosmos-sdk 0.50.3 + */ +export interface QueryDenomOwnersByQueryRequestAmino { + /** denom defines the coin denomination to query all account holders for. */ + denom?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryDenomOwnersByQueryRequestAminoMsg { + type: "cosmos-sdk/QueryDenomOwnersByQueryRequest"; + value: QueryDenomOwnersByQueryRequestAmino; +} +/** + * QueryDenomOwnersByQueryRequest defines the request type for the DenomOwnersByQuery RPC query, + * which queries for a paginated set of all account holders of a particular + * denomination. + * + * Since: cosmos-sdk 0.50.3 + */ +export interface QueryDenomOwnersByQueryRequestSDKType { + denom: string; + pagination?: PageRequestSDKType; +} +/** + * QueryDenomOwnersByQueryResponse defines the RPC response of a DenomOwnersByQuery RPC query. + * + * Since: cosmos-sdk 0.50.3 + */ +export interface QueryDenomOwnersByQueryResponse { + denomOwners: DenomOwner[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryDenomOwnersByQueryResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse"; + value: Uint8Array; +} +/** + * QueryDenomOwnersByQueryResponse defines the RPC response of a DenomOwnersByQuery RPC query. + * + * Since: cosmos-sdk 0.50.3 + */ +export interface QueryDenomOwnersByQueryResponseAmino { + denom_owners?: DenomOwnerAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryDenomOwnersByQueryResponseAminoMsg { + type: "cosmos-sdk/QueryDenomOwnersByQueryResponse"; + value: QueryDenomOwnersByQueryResponseAmino; +} +/** + * QueryDenomOwnersByQueryResponse defines the RPC response of a DenomOwnersByQuery RPC query. + * + * Since: cosmos-sdk 0.50.3 + */ +export interface QueryDenomOwnersByQueryResponseSDKType { + denom_owners: DenomOwnerSDKType[]; + pagination?: PageResponseSDKType; +} +/** + * QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySendEnabledRequest { + /** denoms is the specific denoms you want look up. Leave empty to get all entries. */ + denoms: string[]; + /** + * pagination defines an optional pagination for the request. This field is + * only read if the denoms field is empty. + */ + pagination?: PageRequest; +} +export interface QuerySendEnabledRequestProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QuerySendEnabledRequest"; + value: Uint8Array; +} +/** + * QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySendEnabledRequestAmino { + /** denoms is the specific denoms you want look up. Leave empty to get all entries. */ + denoms?: string[]; + /** + * pagination defines an optional pagination for the request. This field is + * only read if the denoms field is empty. + */ + pagination?: PageRequestAmino; +} +export interface QuerySendEnabledRequestAminoMsg { + type: "cosmos-sdk/QuerySendEnabledRequest"; + value: QuerySendEnabledRequestAmino; +} +/** + * QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySendEnabledRequestSDKType { + denoms: string[]; + pagination?: PageRequestSDKType; +} +/** + * QuerySendEnabledResponse defines the RPC response of a SendEnable query. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySendEnabledResponse { + sendEnabled: SendEnabled[]; + /** + * pagination defines the pagination in the response. This field is only + * populated if the denoms field in the request is empty. + */ + pagination?: PageResponse; +} +export interface QuerySendEnabledResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.QuerySendEnabledResponse"; + value: Uint8Array; +} +/** + * QuerySendEnabledResponse defines the RPC response of a SendEnable query. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySendEnabledResponseAmino { + send_enabled?: SendEnabledAmino[]; + /** + * pagination defines the pagination in the response. This field is only + * populated if the denoms field in the request is empty. + */ + pagination?: PageResponseAmino; +} +export interface QuerySendEnabledResponseAminoMsg { + type: "cosmos-sdk/QuerySendEnabledResponse"; + value: QuerySendEnabledResponseAmino; +} +/** + * QuerySendEnabledResponse defines the RPC response of a SendEnable query. + * + * Since: cosmos-sdk 0.47 + */ +export interface QuerySendEnabledResponseSDKType { + send_enabled: SendEnabledSDKType[]; + pagination?: PageResponseSDKType; +} function createBaseQueryBalanceRequest(): QueryBalanceRequest { return { address: "", @@ -611,7 +1070,8 @@ export const QueryBalanceResponse = { function createBaseQueryAllBalancesRequest(): QueryAllBalancesRequest { return { address: "", - pagination: undefined + pagination: undefined, + resolveDenom: false }; } export const QueryAllBalancesRequest = { @@ -623,6 +1083,9 @@ export const QueryAllBalancesRequest = { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } + if (message.resolveDenom === true) { + writer.uint32(24).bool(message.resolveDenom); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryAllBalancesRequest { @@ -638,6 +1101,9 @@ export const QueryAllBalancesRequest = { case 2: message.pagination = PageRequest.decode(reader, reader.uint32()); break; + case 3: + message.resolveDenom = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -649,6 +1115,7 @@ export const QueryAllBalancesRequest = { const message = createBaseQueryAllBalancesRequest(); message.address = object.address ?? ""; message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + message.resolveDenom = object.resolveDenom ?? false; return message; }, fromAmino(object: QueryAllBalancesRequestAmino): QueryAllBalancesRequest { @@ -659,12 +1126,16 @@ export const QueryAllBalancesRequest = { if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageRequest.fromAmino(object.pagination); } + if (object.resolve_denom !== undefined && object.resolve_denom !== null) { + message.resolveDenom = object.resolve_denom; + } return message; }, toAmino(message: QueryAllBalancesRequest): QueryAllBalancesRequestAmino { const obj: any = {}; obj.address = message.address === "" ? undefined : message.address; obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + obj.resolve_denom = message.resolveDenom === false ? undefined : message.resolveDenom; return obj; }, fromAminoMsg(object: QueryAllBalancesRequestAminoMsg): QueryAllBalancesRequest { @@ -936,28 +1407,35 @@ export const QuerySpendableBalancesResponse = { }; } }; -function createBaseQueryTotalSupplyRequest(): QueryTotalSupplyRequest { +function createBaseQuerySpendableBalanceByDenomRequest(): QuerySpendableBalanceByDenomRequest { return { - pagination: undefined + address: "", + denom: "" }; } -export const QueryTotalSupplyRequest = { - typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyRequest", - encode(message: QueryTotalSupplyRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); +export const QuerySpendableBalanceByDenomRequest = { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest", + encode(message: QuerySpendableBalanceByDenomRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): QueryTotalSupplyRequest { + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpendableBalanceByDenomRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryTotalSupplyRequest(); + const message = createBaseQuerySpendableBalanceByDenomRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.pagination = PageRequest.decode(reader, reader.uint32()); + message.address = reader.string(); + break; + case 2: + message.denom = reader.string(); break; default: reader.skipType(tag & 7); @@ -966,36 +1444,179 @@ export const QueryTotalSupplyRequest = { } return message; }, - fromPartial(object: Partial): QueryTotalSupplyRequest { - const message = createBaseQueryTotalSupplyRequest(); - message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + fromPartial(object: Partial): QuerySpendableBalanceByDenomRequest { + const message = createBaseQuerySpendableBalanceByDenomRequest(); + message.address = object.address ?? ""; + message.denom = object.denom ?? ""; return message; }, - fromAmino(object: QueryTotalSupplyRequestAmino): QueryTotalSupplyRequest { - const message = createBaseQueryTotalSupplyRequest(); - if (object.pagination !== undefined && object.pagination !== null) { - message.pagination = PageRequest.fromAmino(object.pagination); + fromAmino(object: QuerySpendableBalanceByDenomRequestAmino): QuerySpendableBalanceByDenomRequest { + const message = createBaseQuerySpendableBalanceByDenomRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; } return message; }, - toAmino(message: QueryTotalSupplyRequest): QueryTotalSupplyRequestAmino { + toAmino(message: QuerySpendableBalanceByDenomRequest): QuerySpendableBalanceByDenomRequestAmino { const obj: any = {}; - obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + obj.address = message.address === "" ? undefined : message.address; + obj.denom = message.denom === "" ? undefined : message.denom; return obj; }, - fromAminoMsg(object: QueryTotalSupplyRequestAminoMsg): QueryTotalSupplyRequest { - return QueryTotalSupplyRequest.fromAmino(object.value); + fromAminoMsg(object: QuerySpendableBalanceByDenomRequestAminoMsg): QuerySpendableBalanceByDenomRequest { + return QuerySpendableBalanceByDenomRequest.fromAmino(object.value); }, - toAminoMsg(message: QueryTotalSupplyRequest): QueryTotalSupplyRequestAminoMsg { + toAminoMsg(message: QuerySpendableBalanceByDenomRequest): QuerySpendableBalanceByDenomRequestAminoMsg { return { - type: "cosmos-sdk/QueryTotalSupplyRequest", - value: QueryTotalSupplyRequest.toAmino(message) + type: "cosmos-sdk/QuerySpendableBalanceByDenomRequest", + value: QuerySpendableBalanceByDenomRequest.toAmino(message) }; }, - fromProtoMsg(message: QueryTotalSupplyRequestProtoMsg): QueryTotalSupplyRequest { - return QueryTotalSupplyRequest.decode(message.value); + fromProtoMsg(message: QuerySpendableBalanceByDenomRequestProtoMsg): QuerySpendableBalanceByDenomRequest { + return QuerySpendableBalanceByDenomRequest.decode(message.value); }, - toProto(message: QueryTotalSupplyRequest): Uint8Array { + toProto(message: QuerySpendableBalanceByDenomRequest): Uint8Array { + return QuerySpendableBalanceByDenomRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySpendableBalanceByDenomRequest): QuerySpendableBalanceByDenomRequestProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest", + value: QuerySpendableBalanceByDenomRequest.encode(message).finish() + }; + } +}; +function createBaseQuerySpendableBalanceByDenomResponse(): QuerySpendableBalanceByDenomResponse { + return { + balance: undefined + }; +} +export const QuerySpendableBalanceByDenomResponse = { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse", + encode(message: QuerySpendableBalanceByDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.balance !== undefined) { + Coin.encode(message.balance, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySpendableBalanceByDenomResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpendableBalanceByDenomResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.balance = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QuerySpendableBalanceByDenomResponse { + const message = createBaseQuerySpendableBalanceByDenomResponse(); + message.balance = object.balance !== undefined && object.balance !== null ? Coin.fromPartial(object.balance) : undefined; + return message; + }, + fromAmino(object: QuerySpendableBalanceByDenomResponseAmino): QuerySpendableBalanceByDenomResponse { + const message = createBaseQuerySpendableBalanceByDenomResponse(); + if (object.balance !== undefined && object.balance !== null) { + message.balance = Coin.fromAmino(object.balance); + } + return message; + }, + toAmino(message: QuerySpendableBalanceByDenomResponse): QuerySpendableBalanceByDenomResponseAmino { + const obj: any = {}; + obj.balance = message.balance ? Coin.toAmino(message.balance) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySpendableBalanceByDenomResponseAminoMsg): QuerySpendableBalanceByDenomResponse { + return QuerySpendableBalanceByDenomResponse.fromAmino(object.value); + }, + toAminoMsg(message: QuerySpendableBalanceByDenomResponse): QuerySpendableBalanceByDenomResponseAminoMsg { + return { + type: "cosmos-sdk/QuerySpendableBalanceByDenomResponse", + value: QuerySpendableBalanceByDenomResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySpendableBalanceByDenomResponseProtoMsg): QuerySpendableBalanceByDenomResponse { + return QuerySpendableBalanceByDenomResponse.decode(message.value); + }, + toProto(message: QuerySpendableBalanceByDenomResponse): Uint8Array { + return QuerySpendableBalanceByDenomResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySpendableBalanceByDenomResponse): QuerySpendableBalanceByDenomResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse", + value: QuerySpendableBalanceByDenomResponse.encode(message).finish() + }; + } +}; +function createBaseQueryTotalSupplyRequest(): QueryTotalSupplyRequest { + return { + pagination: undefined + }; +} +export const QueryTotalSupplyRequest = { + typeUrl: "/cosmos.bank.v1beta1.QueryTotalSupplyRequest", + encode(message: QueryTotalSupplyRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTotalSupplyRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTotalSupplyRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryTotalSupplyRequest { + const message = createBaseQueryTotalSupplyRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryTotalSupplyRequestAmino): QueryTotalSupplyRequest { + const message = createBaseQueryTotalSupplyRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryTotalSupplyRequest): QueryTotalSupplyRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryTotalSupplyRequestAminoMsg): QueryTotalSupplyRequest { + return QueryTotalSupplyRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryTotalSupplyRequest): QueryTotalSupplyRequestAminoMsg { + return { + type: "cosmos-sdk/QueryTotalSupplyRequest", + value: QueryTotalSupplyRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryTotalSupplyRequestProtoMsg): QueryTotalSupplyRequest { + return QueryTotalSupplyRequest.decode(message.value); + }, + toProto(message: QueryTotalSupplyRequest): Uint8Array { return QueryTotalSupplyRequest.encode(message).finish(); }, toProtoMsg(message: QueryTotalSupplyRequest): QueryTotalSupplyRequestProtoMsg { @@ -1201,7 +1822,7 @@ export const QuerySupplyOfResponse = { }, toAmino(message: QuerySupplyOfResponse): QuerySupplyOfResponseAmino { const obj: any = {}; - obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + obj.amount = message.amount ? Coin.toAmino(message.amount) : Coin.toAmino(Coin.fromPartial({})); return obj; }, fromAminoMsg(object: QuerySupplyOfResponseAminoMsg): QuerySupplyOfResponse { @@ -1326,7 +1947,7 @@ export const QueryParamsResponse = { }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.params = message.params ? Params.toAmino(message.params) : Params.toAmino(Params.fromPartial({})); return obj; }, fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { @@ -1616,7 +2237,7 @@ export const QueryDenomMetadataResponse = { }, toAmino(message: QueryDenomMetadataResponse): QueryDenomMetadataResponseAmino { const obj: any = {}; - obj.metadata = message.metadata ? Metadata.toAmino(message.metadata) : undefined; + obj.metadata = message.metadata ? Metadata.toAmino(message.metadata) : Metadata.toAmino(Metadata.fromPartial({})); return obj; }, fromAminoMsg(object: QueryDenomMetadataResponseAminoMsg): QueryDenomMetadataResponse { @@ -1640,4 +2261,717 @@ export const QueryDenomMetadataResponse = { value: QueryDenomMetadataResponse.encode(message).finish() }; } +}; +function createBaseQueryDenomMetadataByQueryStringRequest(): QueryDenomMetadataByQueryStringRequest { + return { + denom: "" + }; +} +export const QueryDenomMetadataByQueryStringRequest = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest", + encode(message: QueryDenomMetadataByQueryStringRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomMetadataByQueryStringRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomMetadataByQueryStringRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDenomMetadataByQueryStringRequest { + const message = createBaseQueryDenomMetadataByQueryStringRequest(); + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: QueryDenomMetadataByQueryStringRequestAmino): QueryDenomMetadataByQueryStringRequest { + const message = createBaseQueryDenomMetadataByQueryStringRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: QueryDenomMetadataByQueryStringRequest): QueryDenomMetadataByQueryStringRequestAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + return obj; + }, + fromAminoMsg(object: QueryDenomMetadataByQueryStringRequestAminoMsg): QueryDenomMetadataByQueryStringRequest { + return QueryDenomMetadataByQueryStringRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDenomMetadataByQueryStringRequest): QueryDenomMetadataByQueryStringRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDenomMetadataByQueryStringRequest", + value: QueryDenomMetadataByQueryStringRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDenomMetadataByQueryStringRequestProtoMsg): QueryDenomMetadataByQueryStringRequest { + return QueryDenomMetadataByQueryStringRequest.decode(message.value); + }, + toProto(message: QueryDenomMetadataByQueryStringRequest): Uint8Array { + return QueryDenomMetadataByQueryStringRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomMetadataByQueryStringRequest): QueryDenomMetadataByQueryStringRequestProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest", + value: QueryDenomMetadataByQueryStringRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDenomMetadataByQueryStringResponse(): QueryDenomMetadataByQueryStringResponse { + return { + metadata: Metadata.fromPartial({}) + }; +} +export const QueryDenomMetadataByQueryStringResponse = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse", + encode(message: QueryDenomMetadataByQueryStringResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.metadata !== undefined) { + Metadata.encode(message.metadata, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomMetadataByQueryStringResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomMetadataByQueryStringResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.metadata = Metadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDenomMetadataByQueryStringResponse { + const message = createBaseQueryDenomMetadataByQueryStringResponse(); + message.metadata = object.metadata !== undefined && object.metadata !== null ? Metadata.fromPartial(object.metadata) : undefined; + return message; + }, + fromAmino(object: QueryDenomMetadataByQueryStringResponseAmino): QueryDenomMetadataByQueryStringResponse { + const message = createBaseQueryDenomMetadataByQueryStringResponse(); + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = Metadata.fromAmino(object.metadata); + } + return message; + }, + toAmino(message: QueryDenomMetadataByQueryStringResponse): QueryDenomMetadataByQueryStringResponseAmino { + const obj: any = {}; + obj.metadata = message.metadata ? Metadata.toAmino(message.metadata) : Metadata.toAmino(Metadata.fromPartial({})); + return obj; + }, + fromAminoMsg(object: QueryDenomMetadataByQueryStringResponseAminoMsg): QueryDenomMetadataByQueryStringResponse { + return QueryDenomMetadataByQueryStringResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDenomMetadataByQueryStringResponse): QueryDenomMetadataByQueryStringResponseAminoMsg { + return { + type: "cosmos-sdk/QueryDenomMetadataByQueryStringResponse", + value: QueryDenomMetadataByQueryStringResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDenomMetadataByQueryStringResponseProtoMsg): QueryDenomMetadataByQueryStringResponse { + return QueryDenomMetadataByQueryStringResponse.decode(message.value); + }, + toProto(message: QueryDenomMetadataByQueryStringResponse): Uint8Array { + return QueryDenomMetadataByQueryStringResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomMetadataByQueryStringResponse): QueryDenomMetadataByQueryStringResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse", + value: QueryDenomMetadataByQueryStringResponse.encode(message).finish() + }; + } +}; +function createBaseQueryDenomOwnersRequest(): QueryDenomOwnersRequest { + return { + denom: "", + pagination: undefined + }; +} +export const QueryDenomOwnersRequest = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersRequest", + encode(message: QueryDenomOwnersRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomOwnersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomOwnersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDenomOwnersRequest { + const message = createBaseQueryDenomOwnersRequest(); + message.denom = object.denom ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDenomOwnersRequestAmino): QueryDenomOwnersRequest { + const message = createBaseQueryDenomOwnersRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDenomOwnersRequest): QueryDenomOwnersRequestAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDenomOwnersRequestAminoMsg): QueryDenomOwnersRequest { + return QueryDenomOwnersRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDenomOwnersRequest): QueryDenomOwnersRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDenomOwnersRequest", + value: QueryDenomOwnersRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDenomOwnersRequestProtoMsg): QueryDenomOwnersRequest { + return QueryDenomOwnersRequest.decode(message.value); + }, + toProto(message: QueryDenomOwnersRequest): Uint8Array { + return QueryDenomOwnersRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomOwnersRequest): QueryDenomOwnersRequestProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersRequest", + value: QueryDenomOwnersRequest.encode(message).finish() + }; + } +}; +function createBaseDenomOwner(): DenomOwner { + return { + address: "", + balance: Coin.fromPartial({}) + }; +} +export const DenomOwner = { + typeUrl: "/cosmos.bank.v1beta1.DenomOwner", + encode(message: DenomOwner, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.balance !== undefined) { + Coin.encode(message.balance, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DenomOwner { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenomOwner(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.balance = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DenomOwner { + const message = createBaseDenomOwner(); + message.address = object.address ?? ""; + message.balance = object.balance !== undefined && object.balance !== null ? Coin.fromPartial(object.balance) : undefined; + return message; + }, + fromAmino(object: DenomOwnerAmino): DenomOwner { + const message = createBaseDenomOwner(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.balance !== undefined && object.balance !== null) { + message.balance = Coin.fromAmino(object.balance); + } + return message; + }, + toAmino(message: DenomOwner): DenomOwnerAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.balance = message.balance ? Coin.toAmino(message.balance) : Coin.toAmino(Coin.fromPartial({})); + return obj; + }, + fromAminoMsg(object: DenomOwnerAminoMsg): DenomOwner { + return DenomOwner.fromAmino(object.value); + }, + toAminoMsg(message: DenomOwner): DenomOwnerAminoMsg { + return { + type: "cosmos-sdk/DenomOwner", + value: DenomOwner.toAmino(message) + }; + }, + fromProtoMsg(message: DenomOwnerProtoMsg): DenomOwner { + return DenomOwner.decode(message.value); + }, + toProto(message: DenomOwner): Uint8Array { + return DenomOwner.encode(message).finish(); + }, + toProtoMsg(message: DenomOwner): DenomOwnerProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.DenomOwner", + value: DenomOwner.encode(message).finish() + }; + } +}; +function createBaseQueryDenomOwnersResponse(): QueryDenomOwnersResponse { + return { + denomOwners: [], + pagination: undefined + }; +} +export const QueryDenomOwnersResponse = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersResponse", + encode(message: QueryDenomOwnersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.denomOwners) { + DenomOwner.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomOwnersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomOwnersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denomOwners.push(DenomOwner.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDenomOwnersResponse { + const message = createBaseQueryDenomOwnersResponse(); + message.denomOwners = object.denomOwners?.map(e => DenomOwner.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDenomOwnersResponseAmino): QueryDenomOwnersResponse { + const message = createBaseQueryDenomOwnersResponse(); + message.denomOwners = object.denom_owners?.map(e => DenomOwner.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDenomOwnersResponse): QueryDenomOwnersResponseAmino { + const obj: any = {}; + if (message.denomOwners) { + obj.denom_owners = message.denomOwners.map(e => e ? DenomOwner.toAmino(e) : undefined); + } else { + obj.denom_owners = message.denomOwners; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDenomOwnersResponseAminoMsg): QueryDenomOwnersResponse { + return QueryDenomOwnersResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDenomOwnersResponse): QueryDenomOwnersResponseAminoMsg { + return { + type: "cosmos-sdk/QueryDenomOwnersResponse", + value: QueryDenomOwnersResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDenomOwnersResponseProtoMsg): QueryDenomOwnersResponse { + return QueryDenomOwnersResponse.decode(message.value); + }, + toProto(message: QueryDenomOwnersResponse): Uint8Array { + return QueryDenomOwnersResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomOwnersResponse): QueryDenomOwnersResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersResponse", + value: QueryDenomOwnersResponse.encode(message).finish() + }; + } +}; +function createBaseQueryDenomOwnersByQueryRequest(): QueryDenomOwnersByQueryRequest { + return { + denom: "", + pagination: undefined + }; +} +export const QueryDenomOwnersByQueryRequest = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest", + encode(message: QueryDenomOwnersByQueryRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomOwnersByQueryRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomOwnersByQueryRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDenomOwnersByQueryRequest { + const message = createBaseQueryDenomOwnersByQueryRequest(); + message.denom = object.denom ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDenomOwnersByQueryRequestAmino): QueryDenomOwnersByQueryRequest { + const message = createBaseQueryDenomOwnersByQueryRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDenomOwnersByQueryRequest): QueryDenomOwnersByQueryRequestAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDenomOwnersByQueryRequestAminoMsg): QueryDenomOwnersByQueryRequest { + return QueryDenomOwnersByQueryRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDenomOwnersByQueryRequest): QueryDenomOwnersByQueryRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDenomOwnersByQueryRequest", + value: QueryDenomOwnersByQueryRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDenomOwnersByQueryRequestProtoMsg): QueryDenomOwnersByQueryRequest { + return QueryDenomOwnersByQueryRequest.decode(message.value); + }, + toProto(message: QueryDenomOwnersByQueryRequest): Uint8Array { + return QueryDenomOwnersByQueryRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomOwnersByQueryRequest): QueryDenomOwnersByQueryRequestProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest", + value: QueryDenomOwnersByQueryRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDenomOwnersByQueryResponse(): QueryDenomOwnersByQueryResponse { + return { + denomOwners: [], + pagination: undefined + }; +} +export const QueryDenomOwnersByQueryResponse = { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse", + encode(message: QueryDenomOwnersByQueryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.denomOwners) { + DenomOwner.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomOwnersByQueryResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomOwnersByQueryResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denomOwners.push(DenomOwner.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDenomOwnersByQueryResponse { + const message = createBaseQueryDenomOwnersByQueryResponse(); + message.denomOwners = object.denomOwners?.map(e => DenomOwner.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDenomOwnersByQueryResponseAmino): QueryDenomOwnersByQueryResponse { + const message = createBaseQueryDenomOwnersByQueryResponse(); + message.denomOwners = object.denom_owners?.map(e => DenomOwner.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDenomOwnersByQueryResponse): QueryDenomOwnersByQueryResponseAmino { + const obj: any = {}; + if (message.denomOwners) { + obj.denom_owners = message.denomOwners.map(e => e ? DenomOwner.toAmino(e) : undefined); + } else { + obj.denom_owners = message.denomOwners; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDenomOwnersByQueryResponseAminoMsg): QueryDenomOwnersByQueryResponse { + return QueryDenomOwnersByQueryResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDenomOwnersByQueryResponse): QueryDenomOwnersByQueryResponseAminoMsg { + return { + type: "cosmos-sdk/QueryDenomOwnersByQueryResponse", + value: QueryDenomOwnersByQueryResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDenomOwnersByQueryResponseProtoMsg): QueryDenomOwnersByQueryResponse { + return QueryDenomOwnersByQueryResponse.decode(message.value); + }, + toProto(message: QueryDenomOwnersByQueryResponse): Uint8Array { + return QueryDenomOwnersByQueryResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomOwnersByQueryResponse): QueryDenomOwnersByQueryResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse", + value: QueryDenomOwnersByQueryResponse.encode(message).finish() + }; + } +}; +function createBaseQuerySendEnabledRequest(): QuerySendEnabledRequest { + return { + denoms: [], + pagination: undefined + }; +} +export const QuerySendEnabledRequest = { + typeUrl: "/cosmos.bank.v1beta1.QuerySendEnabledRequest", + encode(message: QuerySendEnabledRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.denoms) { + writer.uint32(10).string(v!); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(794).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySendEnabledRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySendEnabledRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denoms.push(reader.string()); + break; + case 99: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QuerySendEnabledRequest { + const message = createBaseQuerySendEnabledRequest(); + message.denoms = object.denoms?.map(e => e) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QuerySendEnabledRequestAmino): QuerySendEnabledRequest { + const message = createBaseQuerySendEnabledRequest(); + message.denoms = object.denoms?.map(e => e) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QuerySendEnabledRequest): QuerySendEnabledRequestAmino { + const obj: any = {}; + if (message.denoms) { + obj.denoms = message.denoms.map(e => e); + } else { + obj.denoms = message.denoms; + } + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySendEnabledRequestAminoMsg): QuerySendEnabledRequest { + return QuerySendEnabledRequest.fromAmino(object.value); + }, + toAminoMsg(message: QuerySendEnabledRequest): QuerySendEnabledRequestAminoMsg { + return { + type: "cosmos-sdk/QuerySendEnabledRequest", + value: QuerySendEnabledRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySendEnabledRequestProtoMsg): QuerySendEnabledRequest { + return QuerySendEnabledRequest.decode(message.value); + }, + toProto(message: QuerySendEnabledRequest): Uint8Array { + return QuerySendEnabledRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySendEnabledRequest): QuerySendEnabledRequestProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QuerySendEnabledRequest", + value: QuerySendEnabledRequest.encode(message).finish() + }; + } +}; +function createBaseQuerySendEnabledResponse(): QuerySendEnabledResponse { + return { + sendEnabled: [], + pagination: undefined + }; +} +export const QuerySendEnabledResponse = { + typeUrl: "/cosmos.bank.v1beta1.QuerySendEnabledResponse", + encode(message: QuerySendEnabledResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.sendEnabled) { + SendEnabled.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(794).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySendEnabledResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySendEnabledResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sendEnabled.push(SendEnabled.decode(reader, reader.uint32())); + break; + case 99: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QuerySendEnabledResponse { + const message = createBaseQuerySendEnabledResponse(); + message.sendEnabled = object.sendEnabled?.map(e => SendEnabled.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QuerySendEnabledResponseAmino): QuerySendEnabledResponse { + const message = createBaseQuerySendEnabledResponse(); + message.sendEnabled = object.send_enabled?.map(e => SendEnabled.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QuerySendEnabledResponse): QuerySendEnabledResponseAmino { + const obj: any = {}; + if (message.sendEnabled) { + obj.send_enabled = message.sendEnabled.map(e => e ? SendEnabled.toAmino(e) : undefined); + } else { + obj.send_enabled = message.sendEnabled; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QuerySendEnabledResponseAminoMsg): QuerySendEnabledResponse { + return QuerySendEnabledResponse.fromAmino(object.value); + }, + toAminoMsg(message: QuerySendEnabledResponse): QuerySendEnabledResponseAminoMsg { + return { + type: "cosmos-sdk/QuerySendEnabledResponse", + value: QuerySendEnabledResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySendEnabledResponseProtoMsg): QuerySendEnabledResponse { + return QuerySendEnabledResponse.decode(message.value); + }, + toProto(message: QuerySendEnabledResponse): Uint8Array { + return QuerySendEnabledResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySendEnabledResponse): QuerySendEnabledResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.QuerySendEnabledResponse", + value: QuerySendEnabledResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/src/codegen/cosmos/bank/v1beta1/tx.amino.ts b/src/codegen/cosmos/bank/v1beta1/tx.amino.ts index 1aa9a24..f146051 100644 --- a/src/codegen/cosmos/bank/v1beta1/tx.amino.ts +++ b/src/codegen/cosmos/bank/v1beta1/tx.amino.ts @@ -1,4 +1,4 @@ -import { MsgSend, MsgMultiSend } from "./tx"; +import { MsgSend, MsgMultiSend, MsgUpdateParams, MsgSetSendEnabled } from "./tx"; export const AminoConverter = { "/cosmos.bank.v1beta1.MsgSend": { aminoType: "cosmos-sdk/MsgSend", @@ -9,5 +9,15 @@ export const AminoConverter = { aminoType: "cosmos-sdk/MsgMultiSend", toAmino: MsgMultiSend.toAmino, fromAmino: MsgMultiSend.fromAmino + }, + "/cosmos.bank.v1beta1.MsgUpdateParams": { + aminoType: "cosmos-sdk/x/bank/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + }, + "/cosmos.bank.v1beta1.MsgSetSendEnabled": { + aminoType: "cosmos-sdk/MsgSetSendEnabled", + toAmino: MsgSetSendEnabled.toAmino, + fromAmino: MsgSetSendEnabled.fromAmino } }; \ No newline at end of file diff --git a/src/codegen/cosmos/bank/v1beta1/tx.registry.ts b/src/codegen/cosmos/bank/v1beta1/tx.registry.ts index 9a00ea4..382b431 100644 --- a/src/codegen/cosmos/bank/v1beta1/tx.registry.ts +++ b/src/codegen/cosmos/bank/v1beta1/tx.registry.ts @@ -1,6 +1,6 @@ import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgSend, MsgMultiSend } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.bank.v1beta1.MsgSend", MsgSend], ["/cosmos.bank.v1beta1.MsgMultiSend", MsgMultiSend]]; +import { MsgSend, MsgMultiSend, MsgUpdateParams, MsgSetSendEnabled } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.bank.v1beta1.MsgSend", MsgSend], ["/cosmos.bank.v1beta1.MsgMultiSend", MsgMultiSend], ["/cosmos.bank.v1beta1.MsgUpdateParams", MsgUpdateParams], ["/cosmos.bank.v1beta1.MsgSetSendEnabled", MsgSetSendEnabled]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -19,6 +19,18 @@ export const MessageComposer = { typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend", value: MsgMultiSend.encode(value).finish() }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + }, + setSendEnabled(value: MsgSetSendEnabled) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabled", + value: MsgSetSendEnabled.encode(value).finish() + }; } }, withTypeUrl: { @@ -33,6 +45,18 @@ export const MessageComposer = { typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend", value }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParams", + value + }; + }, + setSendEnabled(value: MsgSetSendEnabled) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabled", + value + }; } }, fromPartial: { @@ -47,6 +71,18 @@ export const MessageComposer = { typeUrl: "/cosmos.bank.v1beta1.MsgMultiSend", value: MsgMultiSend.fromPartial(value) }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + }, + setSendEnabled(value: MsgSetSendEnabled) { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabled", + value: MsgSetSendEnabled.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/src/codegen/cosmos/bank/v1beta1/tx.rpc.msg.ts b/src/codegen/cosmos/bank/v1beta1/tx.rpc.msg.ts index 370da8f..5433ee1 100644 --- a/src/codegen/cosmos/bank/v1beta1/tx.rpc.msg.ts +++ b/src/codegen/cosmos/bank/v1beta1/tx.rpc.msg.ts @@ -1,12 +1,28 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; -import { MsgSend, MsgSendResponse, MsgMultiSend, MsgMultiSendResponse } from "./tx"; +import { MsgSend, MsgSendResponse, MsgMultiSend, MsgMultiSendResponse, MsgUpdateParams, MsgUpdateParamsResponse, MsgSetSendEnabled, MsgSetSendEnabledResponse } from "./tx"; /** Msg defines the bank Msg service. */ export interface Msg { /** Send defines a method for sending coins from one account to another account. */ send(request: MsgSend): Promise; /** MultiSend defines a method for sending coins from some accounts to other accounts. */ multiSend(request: MsgMultiSend): Promise; + /** + * UpdateParams defines a governance operation for updating the x/bank module parameters. + * The authority is defined in the keeper. + * + * Since: cosmos-sdk 0.47 + */ + updateParams(request: MsgUpdateParams): Promise; + /** + * SetSendEnabled is a governance operation for setting the SendEnabled flag + * on any number of Denoms. Only the entries to add or update should be + * included. Entries that already exist in the store, but that aren't + * included in this message, will be left unchanged. + * + * Since: cosmos-sdk 0.47 + */ + setSendEnabled(request: MsgSetSendEnabled): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -14,6 +30,8 @@ export class MsgClientImpl implements Msg { this.rpc = rpc; this.send = this.send.bind(this); this.multiSend = this.multiSend.bind(this); + this.updateParams = this.updateParams.bind(this); + this.setSendEnabled = this.setSendEnabled.bind(this); } send(request: MsgSend): Promise { const data = MsgSend.encode(request).finish(); @@ -25,4 +43,14 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "MultiSend", data); return promise.then(data => MsgMultiSendResponse.decode(new BinaryReader(data))); } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } + setSendEnabled(request: MsgSetSendEnabled): Promise { + const data = MsgSetSendEnabled.encode(request).finish(); + const promise = this.rpc.request("cosmos.bank.v1beta1.Msg", "SetSendEnabled", data); + return promise.then(data => MsgSetSendEnabledResponse.decode(new BinaryReader(data))); + } } \ No newline at end of file diff --git a/src/codegen/cosmos/bank/v1beta1/tx.ts b/src/codegen/cosmos/bank/v1beta1/tx.ts index 44e8e87..5fc1f84 100644 --- a/src/codegen/cosmos/bank/v1beta1/tx.ts +++ b/src/codegen/cosmos/bank/v1beta1/tx.ts @@ -1,5 +1,5 @@ import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; -import { Input, InputAmino, InputSDKType, Output, OutputAmino, OutputSDKType } from "./bank"; +import { Input, InputAmino, InputSDKType, Output, OutputAmino, OutputSDKType, Params, ParamsAmino, ParamsSDKType, SendEnabled, SendEnabledAmino, SendEnabledSDKType } from "./bank"; import { BinaryReader, BinaryWriter } from "../../../binary"; /** MsgSend represents a message to send coins from one account to another. */ export interface MsgSend { @@ -15,7 +15,7 @@ export interface MsgSendProtoMsg { export interface MsgSendAmino { from_address?: string; to_address?: string; - amount?: CoinAmino[]; + amount: CoinAmino[]; } export interface MsgSendAminoMsg { type: "cosmos-sdk/MsgSend"; @@ -43,6 +43,10 @@ export interface MsgSendResponseAminoMsg { export interface MsgSendResponseSDKType {} /** MsgMultiSend represents an arbitrary multi-in, multi-out send message. */ export interface MsgMultiSend { + /** + * Inputs, despite being `repeated`, only allows one sender input. This is + * checked in MsgMultiSend's ValidateBasic. + */ inputs: Input[]; outputs: Output[]; } @@ -52,8 +56,12 @@ export interface MsgMultiSendProtoMsg { } /** MsgMultiSend represents an arbitrary multi-in, multi-out send message. */ export interface MsgMultiSendAmino { - inputs?: InputAmino[]; - outputs?: OutputAmino[]; + /** + * Inputs, despite being `repeated`, only allows one sender input. This is + * checked in MsgMultiSend's ValidateBasic. + */ + inputs: InputAmino[]; + outputs: OutputAmino[]; } export interface MsgMultiSendAminoMsg { type: "cosmos-sdk/MsgMultiSend"; @@ -78,6 +86,174 @@ export interface MsgMultiSendResponseAminoMsg { } /** MsgMultiSendResponse defines the Msg/MultiSend response type. */ export interface MsgMultiSendResponseSDKType {} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** + * params defines the x/bank parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParams"; + value: Uint8Array; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; + /** + * params defines the x/bank parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/x/bank/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsSDKType; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseSDKType {} +/** + * MsgSetSendEnabled is the Msg/SetSendEnabled request type. + * + * Only entries to add/update/delete need to be included. + * Existing SendEnabled entries that are not included in this + * message are left unchanged. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgSetSendEnabled { + /** authority is the address that controls the module. */ + authority: string; + /** send_enabled is the list of entries to add or update. */ + sendEnabled: SendEnabled[]; + /** + * use_default_for is a list of denoms that should use the params.default_send_enabled value. + * Denoms listed here will have their SendEnabled entries deleted. + * If a denom is included that doesn't have a SendEnabled entry, + * it will be ignored. + */ + useDefaultFor: string[]; +} +export interface MsgSetSendEnabledProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabled"; + value: Uint8Array; +} +/** + * MsgSetSendEnabled is the Msg/SetSendEnabled request type. + * + * Only entries to add/update/delete need to be included. + * Existing SendEnabled entries that are not included in this + * message are left unchanged. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgSetSendEnabledAmino { + /** authority is the address that controls the module. */ + authority?: string; + /** send_enabled is the list of entries to add or update. */ + send_enabled?: SendEnabledAmino[]; + /** + * use_default_for is a list of denoms that should use the params.default_send_enabled value. + * Denoms listed here will have their SendEnabled entries deleted. + * If a denom is included that doesn't have a SendEnabled entry, + * it will be ignored. + */ + use_default_for?: string[]; +} +export interface MsgSetSendEnabledAminoMsg { + type: "cosmos-sdk/MsgSetSendEnabled"; + value: MsgSetSendEnabledAmino; +} +/** + * MsgSetSendEnabled is the Msg/SetSendEnabled request type. + * + * Only entries to add/update/delete need to be included. + * Existing SendEnabled entries that are not included in this + * message are left unchanged. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgSetSendEnabledSDKType { + authority: string; + send_enabled: SendEnabledSDKType[]; + use_default_for: string[]; +} +/** + * MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgSetSendEnabledResponse {} +export interface MsgSetSendEnabledResponseProtoMsg { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabledResponse"; + value: Uint8Array; +} +/** + * MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgSetSendEnabledResponseAmino {} +export interface MsgSetSendEnabledResponseAminoMsg { + type: "cosmos-sdk/MsgSetSendEnabledResponse"; + value: MsgSetSendEnabledResponseAmino; +} +/** + * MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgSetSendEnabledResponseSDKType {} function createBaseMsgSend(): MsgSend { return { fromAddress: "", @@ -369,4 +545,294 @@ export const MsgMultiSendResponse = { value: MsgMultiSendResponse.encode(message).finish() }; } +}; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.params = message.params ? Params.toAmino(message.params) : Params.toAmino(Params.fromPartial({})); + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/x/bank/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSetSendEnabled(): MsgSetSendEnabled { + return { + authority: "", + sendEnabled: [], + useDefaultFor: [] + }; +} +export const MsgSetSendEnabled = { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabled", + encode(message: MsgSetSendEnabled, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + for (const v of message.sendEnabled) { + SendEnabled.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.useDefaultFor) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetSendEnabled { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetSendEnabled(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.sendEnabled.push(SendEnabled.decode(reader, reader.uint32())); + break; + case 3: + message.useDefaultFor.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetSendEnabled { + const message = createBaseMsgSetSendEnabled(); + message.authority = object.authority ?? ""; + message.sendEnabled = object.sendEnabled?.map(e => SendEnabled.fromPartial(e)) || []; + message.useDefaultFor = object.useDefaultFor?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgSetSendEnabledAmino): MsgSetSendEnabled { + const message = createBaseMsgSetSendEnabled(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + message.sendEnabled = object.send_enabled?.map(e => SendEnabled.fromAmino(e)) || []; + message.useDefaultFor = object.use_default_for?.map(e => e) || []; + return message; + }, + toAmino(message: MsgSetSendEnabled): MsgSetSendEnabledAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + if (message.sendEnabled) { + obj.send_enabled = message.sendEnabled.map(e => e ? SendEnabled.toAmino(e) : undefined); + } else { + obj.send_enabled = message.sendEnabled; + } + if (message.useDefaultFor) { + obj.use_default_for = message.useDefaultFor.map(e => e); + } else { + obj.use_default_for = message.useDefaultFor; + } + return obj; + }, + fromAminoMsg(object: MsgSetSendEnabledAminoMsg): MsgSetSendEnabled { + return MsgSetSendEnabled.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetSendEnabled): MsgSetSendEnabledAminoMsg { + return { + type: "cosmos-sdk/MsgSetSendEnabled", + value: MsgSetSendEnabled.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSetSendEnabledProtoMsg): MsgSetSendEnabled { + return MsgSetSendEnabled.decode(message.value); + }, + toProto(message: MsgSetSendEnabled): Uint8Array { + return MsgSetSendEnabled.encode(message).finish(); + }, + toProtoMsg(message: MsgSetSendEnabled): MsgSetSendEnabledProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabled", + value: MsgSetSendEnabled.encode(message).finish() + }; + } +}; +function createBaseMsgSetSendEnabledResponse(): MsgSetSendEnabledResponse { + return {}; +} +export const MsgSetSendEnabledResponse = { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabledResponse", + encode(_: MsgSetSendEnabledResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetSendEnabledResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetSendEnabledResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSetSendEnabledResponse { + const message = createBaseMsgSetSendEnabledResponse(); + return message; + }, + fromAmino(_: MsgSetSendEnabledResponseAmino): MsgSetSendEnabledResponse { + const message = createBaseMsgSetSendEnabledResponse(); + return message; + }, + toAmino(_: MsgSetSendEnabledResponse): MsgSetSendEnabledResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetSendEnabledResponseAminoMsg): MsgSetSendEnabledResponse { + return MsgSetSendEnabledResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetSendEnabledResponse): MsgSetSendEnabledResponseAminoMsg { + return { + type: "cosmos-sdk/MsgSetSendEnabledResponse", + value: MsgSetSendEnabledResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSetSendEnabledResponseProtoMsg): MsgSetSendEnabledResponse { + return MsgSetSendEnabledResponse.decode(message.value); + }, + toProto(message: MsgSetSendEnabledResponse): Uint8Array { + return MsgSetSendEnabledResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetSendEnabledResponse): MsgSetSendEnabledResponseProtoMsg { + return { + typeUrl: "/cosmos.bank.v1beta1.MsgSetSendEnabledResponse", + value: MsgSetSendEnabledResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/src/codegen/cosmos/base/abci/v1beta1/abci.ts b/src/codegen/cosmos/base/abci/v1beta1/abci.ts index f9c70bd..f81c696 100644 --- a/src/codegen/cosmos/base/abci/v1beta1/abci.ts +++ b/src/codegen/cosmos/base/abci/v1beta1/abci.ts @@ -1,5 +1,6 @@ import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; import { Event, EventAmino, EventSDKType } from "../../../../tendermint/abci/types"; +import { Block, BlockAmino, BlockSDKType } from "../../../../tendermint/types/block"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** @@ -41,7 +42,7 @@ export interface TxResponse { /** * Events defines all the events emitted by processing a transaction. Note, * these events include those emitted by processing all the messages and those - * emitted from the ante handler. Whereas Logs contains the events, with + * emitted from the ante. Whereas Logs contains the events, with * additional metadata, emitted only by processing the messages. * * Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 @@ -91,7 +92,7 @@ export interface TxResponseAmino { /** * Events defines all the events emitted by processing a transaction. Note, * these events include those emitted by processing all the messages and those - * emitted from the ante handler. Whereas Logs contains the events, with + * emitted from the ante. Whereas Logs contains the events, with * additional metadata, emitted only by processing the messages. * * Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 @@ -137,7 +138,7 @@ export interface ABCIMessageLogProtoMsg { } /** ABCIMessageLog defines a structure containing an indexed tx ABCI message log. */ export interface ABCIMessageLogAmino { - msg_index?: number; + msg_index: number; log?: string; /** * Events contains a slice of Event objects that were emitted during some @@ -251,7 +252,10 @@ export interface Result { /** * Data is any data returned from message or handler execution. It MUST be * length prefixed in order to separate data from multiple message executions. + * Deprecated. This field is still populated, but prefer msg_response instead + * because it also contains the Msg response typeURL. */ + /** @deprecated */ data: Uint8Array; /** Log contains the log information from message or handler execution. */ log: string; @@ -260,6 +264,12 @@ export interface Result { * or handler execution. */ events: Event[]; + /** + * msg_responses contains the Msg handler responses type packed in Anys. + * + * Since: cosmos-sdk 0.46 + */ + msgResponses: Any[]; } export interface ResultProtoMsg { typeUrl: "/cosmos.base.abci.v1beta1.Result"; @@ -270,7 +280,10 @@ export interface ResultAmino { /** * Data is any data returned from message or handler execution. It MUST be * length prefixed in order to separate data from multiple message executions. + * Deprecated. This field is still populated, but prefer msg_response instead + * because it also contains the Msg response typeURL. */ + /** @deprecated */ data?: string; /** Log contains the log information from message or handler execution. */ log?: string; @@ -279,6 +292,12 @@ export interface ResultAmino { * or handler execution. */ events?: EventAmino[]; + /** + * msg_responses contains the Msg handler responses type packed in Anys. + * + * Since: cosmos-sdk 0.46 + */ + msg_responses?: AnyAmino[]; } export interface ResultAminoMsg { type: "cosmos-sdk/Result"; @@ -286,9 +305,11 @@ export interface ResultAminoMsg { } /** Result is the union of ResponseFormat and ResponseCheckTx. */ export interface ResultSDKType { + /** @deprecated */ data: Uint8Array; log: string; events: EventSDKType[]; + msg_responses: AnySDKType[]; } /** * SimulationResponse defines the response generated when a transaction is @@ -326,6 +347,7 @@ export interface SimulationResponseSDKType { * MsgData defines the data returned in a Result object during message * execution. */ +/** @deprecated */ export interface MsgData { msgType: string; data: Uint8Array; @@ -338,6 +360,7 @@ export interface MsgDataProtoMsg { * MsgData defines the data returned in a Result object during message * execution. */ +/** @deprecated */ export interface MsgDataAmino { msg_type?: string; data?: string; @@ -350,6 +373,7 @@ export interface MsgDataAminoMsg { * MsgData defines the data returned in a Result object during message * execution. */ +/** @deprecated */ export interface MsgDataSDKType { msg_type: string; data: Uint8Array; @@ -359,7 +383,15 @@ export interface MsgDataSDKType { * for each message. */ export interface TxMsgData { + /** data field is deprecated and not populated. */ + /** @deprecated */ data: MsgData[]; + /** + * msg_responses contains the Msg handler responses packed into Anys. + * + * Since: cosmos-sdk 0.46 + */ + msgResponses: Any[]; } export interface TxMsgDataProtoMsg { typeUrl: "/cosmos.base.abci.v1beta1.TxMsgData"; @@ -370,7 +402,15 @@ export interface TxMsgDataProtoMsg { * for each message. */ export interface TxMsgDataAmino { + /** data field is deprecated and not populated. */ + /** @deprecated */ data?: MsgDataAmino[]; + /** + * msg_responses contains the Msg handler responses packed into Anys. + * + * Since: cosmos-sdk 0.46 + */ + msg_responses?: AnyAmino[]; } export interface TxMsgDataAminoMsg { type: "cosmos-sdk/TxMsgData"; @@ -381,7 +421,9 @@ export interface TxMsgDataAminoMsg { * for each message. */ export interface TxMsgDataSDKType { + /** @deprecated */ data: MsgDataSDKType[]; + msg_responses: AnySDKType[]; } /** SearchTxsResult defines a structure for querying txs pageable */ export interface SearchTxsResult { @@ -405,13 +447,13 @@ export interface SearchTxsResultProtoMsg { /** SearchTxsResult defines a structure for querying txs pageable */ export interface SearchTxsResultAmino { /** Count of all txs */ - total_count: string; + total_count?: string; /** Count of txs in current page */ count?: string; /** Index of current page, start from 1 */ - page_number: string; + page_number?: string; /** Count of total pages */ - page_total: string; + page_total?: string; /** Max count txs per page */ limit?: string; /** List of txs in current page */ @@ -430,6 +472,53 @@ export interface SearchTxsResultSDKType { limit: bigint; txs: TxResponseSDKType[]; } +/** SearchBlocksResult defines a structure for querying blocks pageable */ +export interface SearchBlocksResult { + /** Count of all blocks */ + totalCount: bigint; + /** Count of blocks in current page */ + count: bigint; + /** Index of current page, start from 1 */ + pageNumber: bigint; + /** Count of total pages */ + pageTotal: bigint; + /** Max count blocks per page */ + limit: bigint; + /** List of blocks in current page */ + blocks: Block[]; +} +export interface SearchBlocksResultProtoMsg { + typeUrl: "/cosmos.base.abci.v1beta1.SearchBlocksResult"; + value: Uint8Array; +} +/** SearchBlocksResult defines a structure for querying blocks pageable */ +export interface SearchBlocksResultAmino { + /** Count of all blocks */ + total_count?: string; + /** Count of blocks in current page */ + count?: string; + /** Index of current page, start from 1 */ + page_number?: string; + /** Count of total pages */ + page_total?: string; + /** Max count blocks per page */ + limit?: string; + /** List of blocks in current page */ + blocks?: BlockAmino[]; +} +export interface SearchBlocksResultAminoMsg { + type: "cosmos-sdk/SearchBlocksResult"; + value: SearchBlocksResultAmino; +} +/** SearchBlocksResult defines a structure for querying blocks pageable */ +export interface SearchBlocksResultSDKType { + total_count: bigint; + count: bigint; + page_number: bigint; + page_total: bigint; + limit: bigint; + blocks: BlockSDKType[]; +} function createBaseTxResponse(): TxResponse { return { height: BigInt(0), @@ -711,7 +800,7 @@ export const ABCIMessageLog = { }, toAmino(message: ABCIMessageLog): ABCIMessageLogAmino { const obj: any = {}; - obj.msg_index = message.msgIndex === 0 ? undefined : message.msgIndex; + obj.msg_index = message.msgIndex ?? 0; obj.log = message.log === "" ? undefined : message.log; if (message.events) { obj.events = message.events.map(e => e ? StringEvent.toAmino(e) : undefined); @@ -991,7 +1080,8 @@ function createBaseResult(): Result { return { data: new Uint8Array(), log: "", - events: [] + events: [], + msgResponses: [] }; } export const Result = { @@ -1006,6 +1096,9 @@ export const Result = { for (const v of message.events) { Event.encode(v!, writer.uint32(26).fork()).ldelim(); } + for (const v of message.msgResponses) { + Any.encode(v!, writer.uint32(34).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Result { @@ -1024,6 +1117,9 @@ export const Result = { case 3: message.events.push(Event.decode(reader, reader.uint32())); break; + case 4: + message.msgResponses.push(Any.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -1036,6 +1132,7 @@ export const Result = { message.data = object.data ?? new Uint8Array(); message.log = object.log ?? ""; message.events = object.events?.map(e => Event.fromPartial(e)) || []; + message.msgResponses = object.msgResponses?.map(e => Any.fromPartial(e)) || []; return message; }, fromAmino(object: ResultAmino): Result { @@ -1047,6 +1144,7 @@ export const Result = { message.log = object.log; } message.events = object.events?.map(e => Event.fromAmino(e)) || []; + message.msgResponses = object.msg_responses?.map(e => Any.fromAmino(e)) || []; return message; }, toAmino(message: Result): ResultAmino { @@ -1058,6 +1156,11 @@ export const Result = { } else { obj.events = message.events; } + if (message.msgResponses) { + obj.msg_responses = message.msgResponses.map(e => e ? Any.toAmino(e) : undefined); + } else { + obj.msg_responses = message.msgResponses; + } return obj; }, fromAminoMsg(object: ResultAminoMsg): Result { @@ -1246,7 +1349,8 @@ export const MsgData = { }; function createBaseTxMsgData(): TxMsgData { return { - data: [] + data: [], + msgResponses: [] }; } export const TxMsgData = { @@ -1255,6 +1359,9 @@ export const TxMsgData = { for (const v of message.data) { MsgData.encode(v!, writer.uint32(10).fork()).ldelim(); } + for (const v of message.msgResponses) { + Any.encode(v!, writer.uint32(18).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): TxMsgData { @@ -1267,6 +1374,9 @@ export const TxMsgData = { case 1: message.data.push(MsgData.decode(reader, reader.uint32())); break; + case 2: + message.msgResponses.push(Any.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -1277,11 +1387,13 @@ export const TxMsgData = { fromPartial(object: Partial): TxMsgData { const message = createBaseTxMsgData(); message.data = object.data?.map(e => MsgData.fromPartial(e)) || []; + message.msgResponses = object.msgResponses?.map(e => Any.fromPartial(e)) || []; return message; }, fromAmino(object: TxMsgDataAmino): TxMsgData { const message = createBaseTxMsgData(); message.data = object.data?.map(e => MsgData.fromAmino(e)) || []; + message.msgResponses = object.msg_responses?.map(e => Any.fromAmino(e)) || []; return message; }, toAmino(message: TxMsgData): TxMsgDataAmino { @@ -1291,6 +1403,11 @@ export const TxMsgData = { } else { obj.data = message.data; } + if (message.msgResponses) { + obj.msg_responses = message.msgResponses.map(e => e ? Any.toAmino(e) : undefined); + } else { + obj.msg_responses = message.msgResponses; + } return obj; }, fromAminoMsg(object: TxMsgDataAminoMsg): TxMsgData { @@ -1412,10 +1529,10 @@ export const SearchTxsResult = { }, toAmino(message: SearchTxsResult): SearchTxsResultAmino { const obj: any = {}; - obj.total_count = message.totalCount ? message.totalCount.toString() : "0"; + obj.total_count = message.totalCount !== BigInt(0) ? message.totalCount.toString() : undefined; obj.count = message.count !== BigInt(0) ? message.count.toString() : undefined; - obj.page_number = message.pageNumber ? message.pageNumber.toString() : "0"; - obj.page_total = message.pageTotal ? message.pageTotal.toString() : "0"; + obj.page_number = message.pageNumber !== BigInt(0) ? message.pageNumber.toString() : undefined; + obj.page_total = message.pageTotal !== BigInt(0) ? message.pageTotal.toString() : undefined; obj.limit = message.limit !== BigInt(0) ? message.limit.toString() : undefined; if (message.txs) { obj.txs = message.txs.map(e => e ? TxResponse.toAmino(e) : undefined); @@ -1445,4 +1562,135 @@ export const SearchTxsResult = { value: SearchTxsResult.encode(message).finish() }; } +}; +function createBaseSearchBlocksResult(): SearchBlocksResult { + return { + totalCount: BigInt(0), + count: BigInt(0), + pageNumber: BigInt(0), + pageTotal: BigInt(0), + limit: BigInt(0), + blocks: [] + }; +} +export const SearchBlocksResult = { + typeUrl: "/cosmos.base.abci.v1beta1.SearchBlocksResult", + encode(message: SearchBlocksResult, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.totalCount !== BigInt(0)) { + writer.uint32(8).int64(message.totalCount); + } + if (message.count !== BigInt(0)) { + writer.uint32(16).int64(message.count); + } + if (message.pageNumber !== BigInt(0)) { + writer.uint32(24).int64(message.pageNumber); + } + if (message.pageTotal !== BigInt(0)) { + writer.uint32(32).int64(message.pageTotal); + } + if (message.limit !== BigInt(0)) { + writer.uint32(40).int64(message.limit); + } + for (const v of message.blocks) { + Block.encode(v!, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SearchBlocksResult { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSearchBlocksResult(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.totalCount = reader.int64(); + break; + case 2: + message.count = reader.int64(); + break; + case 3: + message.pageNumber = reader.int64(); + break; + case 4: + message.pageTotal = reader.int64(); + break; + case 5: + message.limit = reader.int64(); + break; + case 6: + message.blocks.push(Block.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SearchBlocksResult { + const message = createBaseSearchBlocksResult(); + message.totalCount = object.totalCount !== undefined && object.totalCount !== null ? BigInt(object.totalCount.toString()) : BigInt(0); + message.count = object.count !== undefined && object.count !== null ? BigInt(object.count.toString()) : BigInt(0); + message.pageNumber = object.pageNumber !== undefined && object.pageNumber !== null ? BigInt(object.pageNumber.toString()) : BigInt(0); + message.pageTotal = object.pageTotal !== undefined && object.pageTotal !== null ? BigInt(object.pageTotal.toString()) : BigInt(0); + message.limit = object.limit !== undefined && object.limit !== null ? BigInt(object.limit.toString()) : BigInt(0); + message.blocks = object.blocks?.map(e => Block.fromPartial(e)) || []; + return message; + }, + fromAmino(object: SearchBlocksResultAmino): SearchBlocksResult { + const message = createBaseSearchBlocksResult(); + if (object.total_count !== undefined && object.total_count !== null) { + message.totalCount = BigInt(object.total_count); + } + if (object.count !== undefined && object.count !== null) { + message.count = BigInt(object.count); + } + if (object.page_number !== undefined && object.page_number !== null) { + message.pageNumber = BigInt(object.page_number); + } + if (object.page_total !== undefined && object.page_total !== null) { + message.pageTotal = BigInt(object.page_total); + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = BigInt(object.limit); + } + message.blocks = object.blocks?.map(e => Block.fromAmino(e)) || []; + return message; + }, + toAmino(message: SearchBlocksResult): SearchBlocksResultAmino { + const obj: any = {}; + obj.total_count = message.totalCount !== BigInt(0) ? message.totalCount.toString() : undefined; + obj.count = message.count !== BigInt(0) ? message.count.toString() : undefined; + obj.page_number = message.pageNumber !== BigInt(0) ? message.pageNumber.toString() : undefined; + obj.page_total = message.pageTotal !== BigInt(0) ? message.pageTotal.toString() : undefined; + obj.limit = message.limit !== BigInt(0) ? message.limit.toString() : undefined; + if (message.blocks) { + obj.blocks = message.blocks.map(e => e ? Block.toAmino(e) : undefined); + } else { + obj.blocks = message.blocks; + } + return obj; + }, + fromAminoMsg(object: SearchBlocksResultAminoMsg): SearchBlocksResult { + return SearchBlocksResult.fromAmino(object.value); + }, + toAminoMsg(message: SearchBlocksResult): SearchBlocksResultAminoMsg { + return { + type: "cosmos-sdk/SearchBlocksResult", + value: SearchBlocksResult.toAmino(message) + }; + }, + fromProtoMsg(message: SearchBlocksResultProtoMsg): SearchBlocksResult { + return SearchBlocksResult.decode(message.value); + }, + toProto(message: SearchBlocksResult): Uint8Array { + return SearchBlocksResult.encode(message).finish(); + }, + toProtoMsg(message: SearchBlocksResult): SearchBlocksResultProtoMsg { + return { + typeUrl: "/cosmos.base.abci.v1beta1.SearchBlocksResult", + value: SearchBlocksResult.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/src/codegen/cosmos/base/node/v1beta1/query.lcd.ts b/src/codegen/cosmos/base/node/v1beta1/query.lcd.ts index 4d1214c..4692173 100644 --- a/src/codegen/cosmos/base/node/v1beta1/query.lcd.ts +++ b/src/codegen/cosmos/base/node/v1beta1/query.lcd.ts @@ -1,5 +1,5 @@ import { LCDClient } from "@cosmology/lcd"; -import { ConfigRequest, ConfigResponseSDKType } from "./query"; +import { ConfigRequest, ConfigResponseSDKType, StatusRequest, StatusResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -9,10 +9,16 @@ export class LCDQueryClient { }) { this.req = requestClient; this.config = this.config.bind(this); + this.status = this.status.bind(this); } /* Config queries for the operator configuration. */ async config(_params: ConfigRequest = {}): Promise { const endpoint = `cosmos/base/node/v1beta1/config`; return await this.req.get(endpoint); } + /* Status queries for the node status. */ + async status(_params: StatusRequest = {}): Promise { + const endpoint = `cosmos/base/node/v1beta1/status`; + return await this.req.get(endpoint); + } } \ No newline at end of file diff --git a/src/codegen/cosmos/base/node/v1beta1/query.rpc.Service.ts b/src/codegen/cosmos/base/node/v1beta1/query.rpc.Service.ts index 1651b09..d0b98ba 100644 --- a/src/codegen/cosmos/base/node/v1beta1/query.rpc.Service.ts +++ b/src/codegen/cosmos/base/node/v1beta1/query.rpc.Service.ts @@ -1,23 +1,31 @@ import { Rpc } from "../../../../helpers"; import { BinaryReader } from "../../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { ConfigRequest, ConfigResponse } from "./query"; +import { ConfigRequest, ConfigResponse, StatusRequest, StatusResponse } from "./query"; /** Service defines the gRPC querier service for node related queries. */ export interface Service { /** Config queries for the operator configuration. */ config(request?: ConfigRequest): Promise; + /** Status queries for the node status. */ + status(request?: StatusRequest): Promise; } export class ServiceClientImpl implements Service { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; this.config = this.config.bind(this); + this.status = this.status.bind(this); } config(request: ConfigRequest = {}): Promise { const data = ConfigRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.base.node.v1beta1.Service", "Config", data); return promise.then(data => ConfigResponse.decode(new BinaryReader(data))); } + status(request: StatusRequest = {}): Promise { + const data = StatusRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.base.node.v1beta1.Service", "Status", data); + return promise.then(data => StatusResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -25,6 +33,9 @@ export const createRpcQueryExtension = (base: QueryClient) => { return { config(request?: ConfigRequest): Promise { return queryService.config(request); + }, + status(request?: StatusRequest): Promise { + return queryService.status(request); } }; }; \ No newline at end of file diff --git a/src/codegen/cosmos/base/node/v1beta1/query.ts b/src/codegen/cosmos/base/node/v1beta1/query.ts index 3762b8e..781094d 100644 --- a/src/codegen/cosmos/base/node/v1beta1/query.ts +++ b/src/codegen/cosmos/base/node/v1beta1/query.ts @@ -1,4 +1,6 @@ +import { Timestamp } from "../../../../google/protobuf/timestamp"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { toTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** ConfigRequest defines the request structure for the Config gRPC query. */ export interface ConfigRequest {} export interface ConfigRequestProtoMsg { @@ -16,6 +18,9 @@ export interface ConfigRequestSDKType {} /** ConfigResponse defines the response structure for the Config gRPC query. */ export interface ConfigResponse { minimumGasPrice: string; + pruningKeepRecent: string; + pruningInterval: string; + haltHeight: bigint; } export interface ConfigResponseProtoMsg { typeUrl: "/cosmos.base.node.v1beta1.ConfigResponse"; @@ -24,6 +29,9 @@ export interface ConfigResponseProtoMsg { /** ConfigResponse defines the response structure for the Config gRPC query. */ export interface ConfigResponseAmino { minimum_gas_price?: string; + pruning_keep_recent?: string; + pruning_interval?: string; + halt_height?: string; } export interface ConfigResponseAminoMsg { type: "cosmos-sdk/ConfigResponse"; @@ -32,6 +40,65 @@ export interface ConfigResponseAminoMsg { /** ConfigResponse defines the response structure for the Config gRPC query. */ export interface ConfigResponseSDKType { minimum_gas_price: string; + pruning_keep_recent: string; + pruning_interval: string; + halt_height: bigint; +} +/** StateRequest defines the request structure for the status of a node. */ +export interface StatusRequest {} +export interface StatusRequestProtoMsg { + typeUrl: "/cosmos.base.node.v1beta1.StatusRequest"; + value: Uint8Array; +} +/** StateRequest defines the request structure for the status of a node. */ +export interface StatusRequestAmino {} +export interface StatusRequestAminoMsg { + type: "cosmos-sdk/StatusRequest"; + value: StatusRequestAmino; +} +/** StateRequest defines the request structure for the status of a node. */ +export interface StatusRequestSDKType {} +/** StateResponse defines the response structure for the status of a node. */ +export interface StatusResponse { + /** earliest block height available in the store */ + earliestStoreHeight: bigint; + /** current block height */ + height: bigint; + /** block height timestamp */ + timestamp?: Date; + /** app hash of the current block */ + appHash: Uint8Array; + /** validator hash provided by the consensus header */ + validatorHash: Uint8Array; +} +export interface StatusResponseProtoMsg { + typeUrl: "/cosmos.base.node.v1beta1.StatusResponse"; + value: Uint8Array; +} +/** StateResponse defines the response structure for the status of a node. */ +export interface StatusResponseAmino { + /** earliest block height available in the store */ + earliest_store_height?: string; + /** current block height */ + height?: string; + /** block height timestamp */ + timestamp?: string; + /** app hash of the current block */ + app_hash?: string; + /** validator hash provided by the consensus header */ + validator_hash?: string; +} +export interface StatusResponseAminoMsg { + type: "cosmos-sdk/StatusResponse"; + value: StatusResponseAmino; +} +/** StateResponse defines the response structure for the status of a node. */ +export interface StatusResponseSDKType { + earliest_store_height: bigint; + height: bigint; + timestamp?: Date; + app_hash: Uint8Array; + validator_hash: Uint8Array; } function createBaseConfigRequest(): ConfigRequest { return {}; @@ -91,7 +158,10 @@ export const ConfigRequest = { }; function createBaseConfigResponse(): ConfigResponse { return { - minimumGasPrice: "" + minimumGasPrice: "", + pruningKeepRecent: "", + pruningInterval: "", + haltHeight: BigInt(0) }; } export const ConfigResponse = { @@ -100,6 +170,15 @@ export const ConfigResponse = { if (message.minimumGasPrice !== "") { writer.uint32(10).string(message.minimumGasPrice); } + if (message.pruningKeepRecent !== "") { + writer.uint32(18).string(message.pruningKeepRecent); + } + if (message.pruningInterval !== "") { + writer.uint32(26).string(message.pruningInterval); + } + if (message.haltHeight !== BigInt(0)) { + writer.uint32(32).uint64(message.haltHeight); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ConfigResponse { @@ -112,6 +191,15 @@ export const ConfigResponse = { case 1: message.minimumGasPrice = reader.string(); break; + case 2: + message.pruningKeepRecent = reader.string(); + break; + case 3: + message.pruningInterval = reader.string(); + break; + case 4: + message.haltHeight = reader.uint64(); + break; default: reader.skipType(tag & 7); break; @@ -122,6 +210,9 @@ export const ConfigResponse = { fromPartial(object: Partial): ConfigResponse { const message = createBaseConfigResponse(); message.minimumGasPrice = object.minimumGasPrice ?? ""; + message.pruningKeepRecent = object.pruningKeepRecent ?? ""; + message.pruningInterval = object.pruningInterval ?? ""; + message.haltHeight = object.haltHeight !== undefined && object.haltHeight !== null ? BigInt(object.haltHeight.toString()) : BigInt(0); return message; }, fromAmino(object: ConfigResponseAmino): ConfigResponse { @@ -129,11 +220,23 @@ export const ConfigResponse = { if (object.minimum_gas_price !== undefined && object.minimum_gas_price !== null) { message.minimumGasPrice = object.minimum_gas_price; } + if (object.pruning_keep_recent !== undefined && object.pruning_keep_recent !== null) { + message.pruningKeepRecent = object.pruning_keep_recent; + } + if (object.pruning_interval !== undefined && object.pruning_interval !== null) { + message.pruningInterval = object.pruning_interval; + } + if (object.halt_height !== undefined && object.halt_height !== null) { + message.haltHeight = BigInt(object.halt_height); + } return message; }, toAmino(message: ConfigResponse): ConfigResponseAmino { const obj: any = {}; obj.minimum_gas_price = message.minimumGasPrice === "" ? undefined : message.minimumGasPrice; + obj.pruning_keep_recent = message.pruningKeepRecent === "" ? undefined : message.pruningKeepRecent; + obj.pruning_interval = message.pruningInterval === "" ? undefined : message.pruningInterval; + obj.halt_height = message.haltHeight !== BigInt(0) ? message.haltHeight.toString() : undefined; return obj; }, fromAminoMsg(object: ConfigResponseAminoMsg): ConfigResponse { @@ -157,4 +260,177 @@ export const ConfigResponse = { value: ConfigResponse.encode(message).finish() }; } +}; +function createBaseStatusRequest(): StatusRequest { + return {}; +} +export const StatusRequest = { + typeUrl: "/cosmos.base.node.v1beta1.StatusRequest", + encode(_: StatusRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StatusRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStatusRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): StatusRequest { + const message = createBaseStatusRequest(); + return message; + }, + fromAmino(_: StatusRequestAmino): StatusRequest { + const message = createBaseStatusRequest(); + return message; + }, + toAmino(_: StatusRequest): StatusRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: StatusRequestAminoMsg): StatusRequest { + return StatusRequest.fromAmino(object.value); + }, + toAminoMsg(message: StatusRequest): StatusRequestAminoMsg { + return { + type: "cosmos-sdk/StatusRequest", + value: StatusRequest.toAmino(message) + }; + }, + fromProtoMsg(message: StatusRequestProtoMsg): StatusRequest { + return StatusRequest.decode(message.value); + }, + toProto(message: StatusRequest): Uint8Array { + return StatusRequest.encode(message).finish(); + }, + toProtoMsg(message: StatusRequest): StatusRequestProtoMsg { + return { + typeUrl: "/cosmos.base.node.v1beta1.StatusRequest", + value: StatusRequest.encode(message).finish() + }; + } +}; +function createBaseStatusResponse(): StatusResponse { + return { + earliestStoreHeight: BigInt(0), + height: BigInt(0), + timestamp: undefined, + appHash: new Uint8Array(), + validatorHash: new Uint8Array() + }; +} +export const StatusResponse = { + typeUrl: "/cosmos.base.node.v1beta1.StatusResponse", + encode(message: StatusResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.earliestStoreHeight !== BigInt(0)) { + writer.uint32(8).uint64(message.earliestStoreHeight); + } + if (message.height !== BigInt(0)) { + writer.uint32(16).uint64(message.height); + } + if (message.timestamp !== undefined) { + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(26).fork()).ldelim(); + } + if (message.appHash.length !== 0) { + writer.uint32(34).bytes(message.appHash); + } + if (message.validatorHash.length !== 0) { + writer.uint32(42).bytes(message.validatorHash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StatusResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStatusResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.earliestStoreHeight = reader.uint64(); + break; + case 2: + message.height = reader.uint64(); + break; + case 3: + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 4: + message.appHash = reader.bytes(); + break; + case 5: + message.validatorHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StatusResponse { + const message = createBaseStatusResponse(); + message.earliestStoreHeight = object.earliestStoreHeight !== undefined && object.earliestStoreHeight !== null ? BigInt(object.earliestStoreHeight.toString()) : BigInt(0); + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.timestamp = object.timestamp ?? undefined; + message.appHash = object.appHash ?? new Uint8Array(); + message.validatorHash = object.validatorHash ?? new Uint8Array(); + return message; + }, + fromAmino(object: StatusResponseAmino): StatusResponse { + const message = createBaseStatusResponse(); + if (object.earliest_store_height !== undefined && object.earliest_store_height !== null) { + message.earliestStoreHeight = BigInt(object.earliest_store_height); + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + if (object.app_hash !== undefined && object.app_hash !== null) { + message.appHash = bytesFromBase64(object.app_hash); + } + if (object.validator_hash !== undefined && object.validator_hash !== null) { + message.validatorHash = bytesFromBase64(object.validator_hash); + } + return message; + }, + toAmino(message: StatusResponse): StatusResponseAmino { + const obj: any = {}; + obj.earliest_store_height = message.earliestStoreHeight !== BigInt(0) ? message.earliestStoreHeight.toString() : undefined; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; + obj.app_hash = message.appHash ? base64FromBytes(message.appHash) : undefined; + obj.validator_hash = message.validatorHash ? base64FromBytes(message.validatorHash) : undefined; + return obj; + }, + fromAminoMsg(object: StatusResponseAminoMsg): StatusResponse { + return StatusResponse.fromAmino(object.value); + }, + toAminoMsg(message: StatusResponse): StatusResponseAminoMsg { + return { + type: "cosmos-sdk/StatusResponse", + value: StatusResponse.toAmino(message) + }; + }, + fromProtoMsg(message: StatusResponseProtoMsg): StatusResponse { + return StatusResponse.decode(message.value); + }, + toProto(message: StatusResponse): Uint8Array { + return StatusResponse.encode(message).finish(); + }, + toProtoMsg(message: StatusResponse): StatusResponseProtoMsg { + return { + typeUrl: "/cosmos.base.node.v1beta1.StatusResponse", + value: StatusResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/src/codegen/cosmos/base/query/v1beta1/pagination.ts b/src/codegen/cosmos/base/query/v1beta1/pagination.ts index d9781f6..bc7ec00 100644 --- a/src/codegen/cosmos/base/query/v1beta1/pagination.ts +++ b/src/codegen/cosmos/base/query/v1beta1/pagination.ts @@ -118,7 +118,8 @@ export interface PageRequestSDKType { export interface PageResponse { /** * next_key is the key to be passed to PageRequest.key to - * query the next page most efficiently + * query the next page most efficiently. It will be empty if + * there are no more results. */ nextKey: Uint8Array; /** @@ -143,7 +144,8 @@ export interface PageResponseProtoMsg { export interface PageResponseAmino { /** * next_key is the key to be passed to PageRequest.key to - * query the next page most efficiently + * query the next page most efficiently. It will be empty if + * there are no more results. */ next_key?: string; /** diff --git a/src/codegen/cosmos/base/store/v1beta1/listening.ts b/src/codegen/cosmos/base/store/v1beta1/listening.ts index 0cdeb95..7653231 100644 --- a/src/codegen/cosmos/base/store/v1beta1/listening.ts +++ b/src/codegen/cosmos/base/store/v1beta1/listening.ts @@ -1,4 +1,4 @@ -import { RequestDeliverTx, RequestDeliverTxAmino, RequestDeliverTxSDKType, ResponseDeliverTx, ResponseDeliverTxAmino, ResponseDeliverTxSDKType, RequestBeginBlock, RequestBeginBlockAmino, RequestBeginBlockSDKType, ResponseBeginBlock, ResponseBeginBlockAmino, ResponseBeginBlockSDKType, RequestEndBlock, RequestEndBlockAmino, RequestEndBlockSDKType, ResponseEndBlock, ResponseEndBlockAmino, ResponseEndBlockSDKType, ResponseCommit, ResponseCommitAmino, ResponseCommitSDKType } from "../../../../tendermint/abci/types"; +import { ResponseCommit, ResponseCommitAmino, ResponseCommitSDKType } from "../../../../tendermint/abci/types"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** @@ -57,11 +57,7 @@ export interface StoreKVPairSDKType { * the file streamer dump them into files together with the state changes. */ export interface BlockMetadata { - requestBeginBlock?: RequestBeginBlock; - responseBeginBlock?: ResponseBeginBlock; deliverTxs: BlockMetadata_DeliverTx[]; - requestEndBlock?: RequestEndBlock; - responseEndBlock?: ResponseEndBlock; responseCommit?: ResponseCommit; } export interface BlockMetadataProtoMsg { @@ -73,11 +69,7 @@ export interface BlockMetadataProtoMsg { * the file streamer dump them into files together with the state changes. */ export interface BlockMetadataAmino { - request_begin_block?: RequestBeginBlockAmino; - response_begin_block?: ResponseBeginBlockAmino; deliver_txs?: BlockMetadata_DeliverTxAmino[]; - request_end_block?: RequestEndBlockAmino; - response_end_block?: ResponseEndBlockAmino; response_commit?: ResponseCommitAmino; } export interface BlockMetadataAminoMsg { @@ -89,36 +81,23 @@ export interface BlockMetadataAminoMsg { * the file streamer dump them into files together with the state changes. */ export interface BlockMetadataSDKType { - request_begin_block?: RequestBeginBlockSDKType; - response_begin_block?: ResponseBeginBlockSDKType; deliver_txs: BlockMetadata_DeliverTxSDKType[]; - request_end_block?: RequestEndBlockSDKType; - response_end_block?: ResponseEndBlockSDKType; response_commit?: ResponseCommitSDKType; } /** DeliverTx encapulate deliver tx request and response. */ -export interface BlockMetadata_DeliverTx { - request?: RequestDeliverTx; - response?: ResponseDeliverTx; -} +export interface BlockMetadata_DeliverTx {} export interface BlockMetadata_DeliverTxProtoMsg { typeUrl: "/cosmos.base.store.v1beta1.DeliverTx"; value: Uint8Array; } /** DeliverTx encapulate deliver tx request and response. */ -export interface BlockMetadata_DeliverTxAmino { - request?: RequestDeliverTxAmino; - response?: ResponseDeliverTxAmino; -} +export interface BlockMetadata_DeliverTxAmino {} export interface BlockMetadata_DeliverTxAminoMsg { type: "cosmos-sdk/DeliverTx"; value: BlockMetadata_DeliverTxAmino; } /** DeliverTx encapulate deliver tx request and response. */ -export interface BlockMetadata_DeliverTxSDKType { - request?: RequestDeliverTxSDKType; - response?: ResponseDeliverTxSDKType; -} +export interface BlockMetadata_DeliverTxSDKType {} function createBaseStoreKVPair(): StoreKVPair { return { storeKey: "", @@ -226,32 +205,16 @@ export const StoreKVPair = { }; function createBaseBlockMetadata(): BlockMetadata { return { - requestBeginBlock: undefined, - responseBeginBlock: undefined, deliverTxs: [], - requestEndBlock: undefined, - responseEndBlock: undefined, responseCommit: undefined }; } export const BlockMetadata = { typeUrl: "/cosmos.base.store.v1beta1.BlockMetadata", encode(message: BlockMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.requestBeginBlock !== undefined) { - RequestBeginBlock.encode(message.requestBeginBlock, writer.uint32(10).fork()).ldelim(); - } - if (message.responseBeginBlock !== undefined) { - ResponseBeginBlock.encode(message.responseBeginBlock, writer.uint32(18).fork()).ldelim(); - } for (const v of message.deliverTxs) { BlockMetadata_DeliverTx.encode(v!, writer.uint32(26).fork()).ldelim(); } - if (message.requestEndBlock !== undefined) { - RequestEndBlock.encode(message.requestEndBlock, writer.uint32(34).fork()).ldelim(); - } - if (message.responseEndBlock !== undefined) { - ResponseEndBlock.encode(message.responseEndBlock, writer.uint32(42).fork()).ldelim(); - } if (message.responseCommit !== undefined) { ResponseCommit.encode(message.responseCommit, writer.uint32(50).fork()).ldelim(); } @@ -264,21 +227,9 @@ export const BlockMetadata = { while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.requestBeginBlock = RequestBeginBlock.decode(reader, reader.uint32()); - break; - case 2: - message.responseBeginBlock = ResponseBeginBlock.decode(reader, reader.uint32()); - break; case 3: message.deliverTxs.push(BlockMetadata_DeliverTx.decode(reader, reader.uint32())); break; - case 4: - message.requestEndBlock = RequestEndBlock.decode(reader, reader.uint32()); - break; - case 5: - message.responseEndBlock = ResponseEndBlock.decode(reader, reader.uint32()); - break; case 6: message.responseCommit = ResponseCommit.decode(reader, reader.uint32()); break; @@ -291,29 +242,13 @@ export const BlockMetadata = { }, fromPartial(object: Partial): BlockMetadata { const message = createBaseBlockMetadata(); - message.requestBeginBlock = object.requestBeginBlock !== undefined && object.requestBeginBlock !== null ? RequestBeginBlock.fromPartial(object.requestBeginBlock) : undefined; - message.responseBeginBlock = object.responseBeginBlock !== undefined && object.responseBeginBlock !== null ? ResponseBeginBlock.fromPartial(object.responseBeginBlock) : undefined; message.deliverTxs = object.deliverTxs?.map(e => BlockMetadata_DeliverTx.fromPartial(e)) || []; - message.requestEndBlock = object.requestEndBlock !== undefined && object.requestEndBlock !== null ? RequestEndBlock.fromPartial(object.requestEndBlock) : undefined; - message.responseEndBlock = object.responseEndBlock !== undefined && object.responseEndBlock !== null ? ResponseEndBlock.fromPartial(object.responseEndBlock) : undefined; message.responseCommit = object.responseCommit !== undefined && object.responseCommit !== null ? ResponseCommit.fromPartial(object.responseCommit) : undefined; return message; }, fromAmino(object: BlockMetadataAmino): BlockMetadata { const message = createBaseBlockMetadata(); - if (object.request_begin_block !== undefined && object.request_begin_block !== null) { - message.requestBeginBlock = RequestBeginBlock.fromAmino(object.request_begin_block); - } - if (object.response_begin_block !== undefined && object.response_begin_block !== null) { - message.responseBeginBlock = ResponseBeginBlock.fromAmino(object.response_begin_block); - } message.deliverTxs = object.deliver_txs?.map(e => BlockMetadata_DeliverTx.fromAmino(e)) || []; - if (object.request_end_block !== undefined && object.request_end_block !== null) { - message.requestEndBlock = RequestEndBlock.fromAmino(object.request_end_block); - } - if (object.response_end_block !== undefined && object.response_end_block !== null) { - message.responseEndBlock = ResponseEndBlock.fromAmino(object.response_end_block); - } if (object.response_commit !== undefined && object.response_commit !== null) { message.responseCommit = ResponseCommit.fromAmino(object.response_commit); } @@ -321,15 +256,11 @@ export const BlockMetadata = { }, toAmino(message: BlockMetadata): BlockMetadataAmino { const obj: any = {}; - obj.request_begin_block = message.requestBeginBlock ? RequestBeginBlock.toAmino(message.requestBeginBlock) : undefined; - obj.response_begin_block = message.responseBeginBlock ? ResponseBeginBlock.toAmino(message.responseBeginBlock) : undefined; if (message.deliverTxs) { obj.deliver_txs = message.deliverTxs.map(e => e ? BlockMetadata_DeliverTx.toAmino(e) : undefined); } else { obj.deliver_txs = message.deliverTxs; } - obj.request_end_block = message.requestEndBlock ? RequestEndBlock.toAmino(message.requestEndBlock) : undefined; - obj.response_end_block = message.responseEndBlock ? ResponseEndBlock.toAmino(message.responseEndBlock) : undefined; obj.response_commit = message.responseCommit ? ResponseCommit.toAmino(message.responseCommit) : undefined; return obj; }, @@ -356,20 +287,11 @@ export const BlockMetadata = { } }; function createBaseBlockMetadata_DeliverTx(): BlockMetadata_DeliverTx { - return { - request: undefined, - response: undefined - }; + return {}; } export const BlockMetadata_DeliverTx = { typeUrl: "/cosmos.base.store.v1beta1.DeliverTx", - encode(message: BlockMetadata_DeliverTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.request !== undefined) { - RequestDeliverTx.encode(message.request, writer.uint32(10).fork()).ldelim(); - } - if (message.response !== undefined) { - ResponseDeliverTx.encode(message.response, writer.uint32(18).fork()).ldelim(); - } + encode(_: BlockMetadata_DeliverTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): BlockMetadata_DeliverTx { @@ -379,12 +301,6 @@ export const BlockMetadata_DeliverTx = { while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.request = RequestDeliverTx.decode(reader, reader.uint32()); - break; - case 2: - message.response = ResponseDeliverTx.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -392,26 +308,16 @@ export const BlockMetadata_DeliverTx = { } return message; }, - fromPartial(object: Partial): BlockMetadata_DeliverTx { + fromPartial(_: Partial): BlockMetadata_DeliverTx { const message = createBaseBlockMetadata_DeliverTx(); - message.request = object.request !== undefined && object.request !== null ? RequestDeliverTx.fromPartial(object.request) : undefined; - message.response = object.response !== undefined && object.response !== null ? ResponseDeliverTx.fromPartial(object.response) : undefined; return message; }, - fromAmino(object: BlockMetadata_DeliverTxAmino): BlockMetadata_DeliverTx { + fromAmino(_: BlockMetadata_DeliverTxAmino): BlockMetadata_DeliverTx { const message = createBaseBlockMetadata_DeliverTx(); - if (object.request !== undefined && object.request !== null) { - message.request = RequestDeliverTx.fromAmino(object.request); - } - if (object.response !== undefined && object.response !== null) { - message.response = ResponseDeliverTx.fromAmino(object.response); - } return message; }, - toAmino(message: BlockMetadata_DeliverTx): BlockMetadata_DeliverTxAmino { + toAmino(_: BlockMetadata_DeliverTx): BlockMetadata_DeliverTxAmino { const obj: any = {}; - obj.request = message.request ? RequestDeliverTx.toAmino(message.request) : undefined; - obj.response = message.response ? ResponseDeliverTx.toAmino(message.response) : undefined; return obj; }, fromAminoMsg(object: BlockMetadata_DeliverTxAminoMsg): BlockMetadata_DeliverTx { diff --git a/src/codegen/cosmos/base/tendermint/v1beta1/query.lcd.ts b/src/codegen/cosmos/base/tendermint/v1beta1/query.lcd.ts index 1a19acb..f8fe6c6 100644 --- a/src/codegen/cosmos/base/tendermint/v1beta1/query.lcd.ts +++ b/src/codegen/cosmos/base/tendermint/v1beta1/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../../../helpers"; import { LCDClient } from "@cosmology/lcd"; -import { GetNodeInfoRequest, GetNodeInfoResponseSDKType, GetSyncingRequest, GetSyncingResponseSDKType, GetLatestBlockRequest, GetLatestBlockResponseSDKType, GetBlockByHeightRequest, GetBlockByHeightResponseSDKType, GetLatestValidatorSetRequest, GetLatestValidatorSetResponseSDKType, GetValidatorSetByHeightRequest, GetValidatorSetByHeightResponseSDKType } from "./query"; +import { GetNodeInfoRequest, GetNodeInfoResponseSDKType, GetSyncingRequest, GetSyncingResponseSDKType, GetLatestBlockRequest, GetLatestBlockResponseSDKType, GetBlockByHeightRequest, GetBlockByHeightResponseSDKType, GetLatestValidatorSetRequest, GetLatestValidatorSetResponseSDKType, GetValidatorSetByHeightRequest, GetValidatorSetByHeightResponseSDKType, ABCIQueryRequest, ABCIQueryResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -15,6 +15,7 @@ export class LCDQueryClient { this.getBlockByHeight = this.getBlockByHeight.bind(this); this.getLatestValidatorSet = this.getLatestValidatorSet.bind(this); this.getValidatorSetByHeight = this.getValidatorSetByHeight.bind(this); + this.aBCIQuery = this.aBCIQuery.bind(this); } /* GetNodeInfo queries the current node info. */ async getNodeInfo(_params: GetNodeInfoRequest = {}): Promise { @@ -60,4 +61,28 @@ export class LCDQueryClient { const endpoint = `cosmos/base/tendermint/v1beta1/validatorsets/${params.height}`; return await this.req.get(endpoint, options); } + /* ABCIQuery defines a query handler that supports ABCI queries directly to the + application, bypassing Tendermint completely. The ABCI query must contain + a valid and supported path, including app, custom, p2p, and store. + + Since: cosmos-sdk 0.46 */ + async aBCIQuery(params: ABCIQueryRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.data !== "undefined") { + options.params.data = params.data; + } + if (typeof params?.path !== "undefined") { + options.params.path = params.path; + } + if (typeof params?.height !== "undefined") { + options.params.height = params.height; + } + if (typeof params?.prove !== "undefined") { + options.params.prove = params.prove; + } + const endpoint = `cosmos/base/tendermint/v1beta1/abci_query`; + return await this.req.get(endpoint, options); + } } \ No newline at end of file diff --git a/src/codegen/cosmos/base/tendermint/v1beta1/query.rpc.Service.ts b/src/codegen/cosmos/base/tendermint/v1beta1/query.rpc.Service.ts index a19d825..13a5d27 100644 --- a/src/codegen/cosmos/base/tendermint/v1beta1/query.rpc.Service.ts +++ b/src/codegen/cosmos/base/tendermint/v1beta1/query.rpc.Service.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../../../helpers"; import { BinaryReader } from "../../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { GetNodeInfoRequest, GetNodeInfoResponse, GetSyncingRequest, GetSyncingResponse, GetLatestBlockRequest, GetLatestBlockResponse, GetBlockByHeightRequest, GetBlockByHeightResponse, GetLatestValidatorSetRequest, GetLatestValidatorSetResponse, GetValidatorSetByHeightRequest, GetValidatorSetByHeightResponse } from "./query"; +import { GetNodeInfoRequest, GetNodeInfoResponse, GetSyncingRequest, GetSyncingResponse, GetLatestBlockRequest, GetLatestBlockResponse, GetBlockByHeightRequest, GetBlockByHeightResponse, GetLatestValidatorSetRequest, GetLatestValidatorSetResponse, GetValidatorSetByHeightRequest, GetValidatorSetByHeightResponse, ABCIQueryRequest, ABCIQueryResponse } from "./query"; /** Service defines the gRPC querier service for tendermint queries. */ export interface Service { /** GetNodeInfo queries the current node info. */ @@ -16,6 +16,14 @@ export interface Service { getLatestValidatorSet(request?: GetLatestValidatorSetRequest): Promise; /** GetValidatorSetByHeight queries validator-set at a given height. */ getValidatorSetByHeight(request: GetValidatorSetByHeightRequest): Promise; + /** + * ABCIQuery defines a query handler that supports ABCI queries directly to the + * application, bypassing Tendermint completely. The ABCI query must contain + * a valid and supported path, including app, custom, p2p, and store. + * + * Since: cosmos-sdk 0.46 + */ + aBCIQuery(request: ABCIQueryRequest): Promise; } export class ServiceClientImpl implements Service { private readonly rpc: Rpc; @@ -27,6 +35,7 @@ export class ServiceClientImpl implements Service { this.getBlockByHeight = this.getBlockByHeight.bind(this); this.getLatestValidatorSet = this.getLatestValidatorSet.bind(this); this.getValidatorSetByHeight = this.getValidatorSetByHeight.bind(this); + this.aBCIQuery = this.aBCIQuery.bind(this); } getNodeInfo(request: GetNodeInfoRequest = {}): Promise { const data = GetNodeInfoRequest.encode(request).finish(); @@ -60,6 +69,11 @@ export class ServiceClientImpl implements Service { const promise = this.rpc.request("cosmos.base.tendermint.v1beta1.Service", "GetValidatorSetByHeight", data); return promise.then(data => GetValidatorSetByHeightResponse.decode(new BinaryReader(data))); } + aBCIQuery(request: ABCIQueryRequest): Promise { + const data = ABCIQueryRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.base.tendermint.v1beta1.Service", "ABCIQuery", data); + return promise.then(data => ABCIQueryResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -82,6 +96,9 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, getValidatorSetByHeight(request: GetValidatorSetByHeightRequest): Promise { return queryService.getValidatorSetByHeight(request); + }, + aBCIQuery(request: ABCIQueryRequest): Promise { + return queryService.aBCIQuery(request); } }; }; \ No newline at end of file diff --git a/src/codegen/cosmos/base/tendermint/v1beta1/query.ts b/src/codegen/cosmos/base/tendermint/v1beta1/query.ts index 255d5b9..25fc1c0 100644 --- a/src/codegen/cosmos/base/tendermint/v1beta1/query.ts +++ b/src/codegen/cosmos/base/tendermint/v1beta1/query.ts @@ -1,9 +1,15 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../query/v1beta1/pagination"; import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; import { BlockID, BlockIDAmino, BlockIDSDKType } from "../../../../tendermint/types/types"; -import { Block, BlockAmino, BlockSDKType } from "../../../../tendermint/types/block"; +import { Block as Block1 } from "../../../../tendermint/types/block"; +import { BlockAmino as Block1Amino } from "../../../../tendermint/types/block"; +import { BlockSDKType as Block1SDKType } from "../../../../tendermint/types/block"; +import { Block as Block2 } from "./types"; +import { BlockAmino as Block2Amino } from "./types"; +import { BlockSDKType as Block2SDKType } from "./types"; import { DefaultNodeInfo, DefaultNodeInfoAmino, DefaultNodeInfoSDKType } from "../../../../tendermint/p2p/types"; import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. */ export interface GetValidatorSetByHeightRequest { height: bigint; @@ -159,7 +165,10 @@ export interface GetBlockByHeightRequestSDKType { /** GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. */ export interface GetBlockByHeightResponse { blockId?: BlockID; - block?: Block; + /** Deprecated: please use `sdk_block` instead */ + block?: Block1; + /** Since: cosmos-sdk 0.47 */ + sdkBlock?: Block2; } export interface GetBlockByHeightResponseProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse"; @@ -168,7 +177,10 @@ export interface GetBlockByHeightResponseProtoMsg { /** GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. */ export interface GetBlockByHeightResponseAmino { block_id?: BlockIDAmino; - block?: BlockAmino; + /** Deprecated: please use `sdk_block` instead */ + block?: Block1Amino; + /** Since: cosmos-sdk 0.47 */ + sdk_block?: Block2Amino; } export interface GetBlockByHeightResponseAminoMsg { type: "cosmos-sdk/GetBlockByHeightResponse"; @@ -177,7 +189,8 @@ export interface GetBlockByHeightResponseAminoMsg { /** GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. */ export interface GetBlockByHeightResponseSDKType { block_id?: BlockIDSDKType; - block?: BlockSDKType; + block?: Block1SDKType; + sdk_block?: Block2SDKType; } /** GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. */ export interface GetLatestBlockRequest {} @@ -196,7 +209,10 @@ export interface GetLatestBlockRequestSDKType {} /** GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. */ export interface GetLatestBlockResponse { blockId?: BlockID; - block?: Block; + /** Deprecated: please use `sdk_block` instead */ + block?: Block1; + /** Since: cosmos-sdk 0.47 */ + sdkBlock?: Block2; } export interface GetLatestBlockResponseProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetLatestBlockResponse"; @@ -205,7 +221,10 @@ export interface GetLatestBlockResponseProtoMsg { /** GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. */ export interface GetLatestBlockResponseAmino { block_id?: BlockIDAmino; - block?: BlockAmino; + /** Deprecated: please use `sdk_block` instead */ + block?: Block1Amino; + /** Since: cosmos-sdk 0.47 */ + sdk_block?: Block2Amino; } export interface GetLatestBlockResponseAminoMsg { type: "cosmos-sdk/GetLatestBlockResponse"; @@ -214,7 +233,8 @@ export interface GetLatestBlockResponseAminoMsg { /** GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. */ export interface GetLatestBlockResponseSDKType { block_id?: BlockIDSDKType; - block?: BlockSDKType; + block?: Block1SDKType; + sdk_block?: Block2SDKType; } /** GetSyncingRequest is the request type for the Query/GetSyncing RPC method. */ export interface GetSyncingRequest {} @@ -264,7 +284,7 @@ export interface GetNodeInfoRequestAminoMsg { } /** GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. */ export interface GetNodeInfoRequestSDKType {} -/** GetNodeInfoResponse is the request type for the Query/GetNodeInfo RPC method. */ +/** GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC method. */ export interface GetNodeInfoResponse { defaultNodeInfo?: DefaultNodeInfo; applicationVersion?: VersionInfo; @@ -273,7 +293,7 @@ export interface GetNodeInfoResponseProtoMsg { typeUrl: "/cosmos.base.tendermint.v1beta1.GetNodeInfoResponse"; value: Uint8Array; } -/** GetNodeInfoResponse is the request type for the Query/GetNodeInfo RPC method. */ +/** GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC method. */ export interface GetNodeInfoResponseAmino { default_node_info?: DefaultNodeInfoAmino; application_version?: VersionInfoAmino; @@ -282,7 +302,7 @@ export interface GetNodeInfoResponseAminoMsg { type: "cosmos-sdk/GetNodeInfoResponse"; value: GetNodeInfoResponseAmino; } -/** GetNodeInfoResponse is the request type for the Query/GetNodeInfo RPC method. */ +/** GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC method. */ export interface GetNodeInfoResponseSDKType { default_node_info?: DefaultNodeInfoSDKType; application_version?: VersionInfoSDKType; @@ -362,6 +382,174 @@ export interface ModuleSDKType { version: string; sum: string; } +/** ABCIQueryRequest defines the request structure for the ABCIQuery gRPC query. */ +export interface ABCIQueryRequest { + data: Uint8Array; + path: string; + height: bigint; + prove: boolean; +} +export interface ABCIQueryRequestProtoMsg { + typeUrl: "/cosmos.base.tendermint.v1beta1.ABCIQueryRequest"; + value: Uint8Array; +} +/** ABCIQueryRequest defines the request structure for the ABCIQuery gRPC query. */ +export interface ABCIQueryRequestAmino { + data?: string; + path?: string; + height?: string; + prove?: boolean; +} +export interface ABCIQueryRequestAminoMsg { + type: "cosmos-sdk/ABCIQueryRequest"; + value: ABCIQueryRequestAmino; +} +/** ABCIQueryRequest defines the request structure for the ABCIQuery gRPC query. */ +export interface ABCIQueryRequestSDKType { + data: Uint8Array; + path: string; + height: bigint; + prove: boolean; +} +/** + * ABCIQueryResponse defines the response structure for the ABCIQuery gRPC query. + * + * Note: This type is a duplicate of the ResponseQuery proto type defined in + * Tendermint. + */ +export interface ABCIQueryResponse { + code: number; + /** nondeterministic */ + log: string; + /** nondeterministic */ + info: string; + index: bigint; + key: Uint8Array; + value: Uint8Array; + proofOps?: ProofOps; + height: bigint; + codespace: string; +} +export interface ABCIQueryResponseProtoMsg { + typeUrl: "/cosmos.base.tendermint.v1beta1.ABCIQueryResponse"; + value: Uint8Array; +} +/** + * ABCIQueryResponse defines the response structure for the ABCIQuery gRPC query. + * + * Note: This type is a duplicate of the ResponseQuery proto type defined in + * Tendermint. + */ +export interface ABCIQueryResponseAmino { + code?: number; + /** nondeterministic */ + log?: string; + /** nondeterministic */ + info?: string; + index?: string; + key?: string; + value?: string; + proof_ops?: ProofOpsAmino; + height?: string; + codespace?: string; +} +export interface ABCIQueryResponseAminoMsg { + type: "cosmos-sdk/ABCIQueryResponse"; + value: ABCIQueryResponseAmino; +} +/** + * ABCIQueryResponse defines the response structure for the ABCIQuery gRPC query. + * + * Note: This type is a duplicate of the ResponseQuery proto type defined in + * Tendermint. + */ +export interface ABCIQueryResponseSDKType { + code: number; + log: string; + info: string; + index: bigint; + key: Uint8Array; + value: Uint8Array; + proof_ops?: ProofOpsSDKType; + height: bigint; + codespace: string; +} +/** + * ProofOp defines an operation used for calculating Merkle root. The data could + * be arbitrary format, providing necessary data for example neighbouring node + * hash. + * + * Note: This type is a duplicate of the ProofOp proto type defined in Tendermint. + */ +export interface ProofOp { + type: string; + key: Uint8Array; + data: Uint8Array; +} +export interface ProofOpProtoMsg { + typeUrl: "/cosmos.base.tendermint.v1beta1.ProofOp"; + value: Uint8Array; +} +/** + * ProofOp defines an operation used for calculating Merkle root. The data could + * be arbitrary format, providing necessary data for example neighbouring node + * hash. + * + * Note: This type is a duplicate of the ProofOp proto type defined in Tendermint. + */ +export interface ProofOpAmino { + type?: string; + key?: string; + data?: string; +} +export interface ProofOpAminoMsg { + type: "cosmos-sdk/ProofOp"; + value: ProofOpAmino; +} +/** + * ProofOp defines an operation used for calculating Merkle root. The data could + * be arbitrary format, providing necessary data for example neighbouring node + * hash. + * + * Note: This type is a duplicate of the ProofOp proto type defined in Tendermint. + */ +export interface ProofOpSDKType { + type: string; + key: Uint8Array; + data: Uint8Array; +} +/** + * ProofOps is Merkle proof defined by the list of ProofOps. + * + * Note: This type is a duplicate of the ProofOps proto type defined in Tendermint. + */ +export interface ProofOps { + ops: ProofOp[]; +} +export interface ProofOpsProtoMsg { + typeUrl: "/cosmos.base.tendermint.v1beta1.ProofOps"; + value: Uint8Array; +} +/** + * ProofOps is Merkle proof defined by the list of ProofOps. + * + * Note: This type is a duplicate of the ProofOps proto type defined in Tendermint. + */ +export interface ProofOpsAmino { + ops: ProofOpAmino[]; +} +export interface ProofOpsAminoMsg { + type: "cosmos-sdk/ProofOps"; + value: ProofOpsAmino; +} +/** + * ProofOps is Merkle proof defined by the list of ProofOps. + * + * Note: This type is a duplicate of the ProofOps proto type defined in Tendermint. + */ +export interface ProofOpsSDKType { + ops: ProofOpSDKType[]; +} function createBaseGetValidatorSetByHeightRequest(): GetValidatorSetByHeightRequest { return { height: BigInt(0), @@ -879,7 +1067,8 @@ export const GetBlockByHeightRequest = { function createBaseGetBlockByHeightResponse(): GetBlockByHeightResponse { return { blockId: undefined, - block: undefined + block: undefined, + sdkBlock: undefined }; } export const GetBlockByHeightResponse = { @@ -889,7 +1078,10 @@ export const GetBlockByHeightResponse = { BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim(); } if (message.block !== undefined) { - Block.encode(message.block, writer.uint32(18).fork()).ldelim(); + Block1.encode(message.block, writer.uint32(18).fork()).ldelim(); + } + if (message.sdkBlock !== undefined) { + Block2.encode(message.sdkBlock, writer.uint32(26).fork()).ldelim(); } return writer; }, @@ -904,7 +1096,10 @@ export const GetBlockByHeightResponse = { message.blockId = BlockID.decode(reader, reader.uint32()); break; case 2: - message.block = Block.decode(reader, reader.uint32()); + message.block = Block1.decode(reader, reader.uint32()); + break; + case 3: + message.sdkBlock = Block2.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -916,7 +1111,8 @@ export const GetBlockByHeightResponse = { fromPartial(object: Partial): GetBlockByHeightResponse { const message = createBaseGetBlockByHeightResponse(); message.blockId = object.blockId !== undefined && object.blockId !== null ? BlockID.fromPartial(object.blockId) : undefined; - message.block = object.block !== undefined && object.block !== null ? Block.fromPartial(object.block) : undefined; + message.block = object.block !== undefined && object.block !== null ? Block1.fromPartial(object.block) : undefined; + message.sdkBlock = object.sdkBlock !== undefined && object.sdkBlock !== null ? Block2.fromPartial(object.sdkBlock) : undefined; return message; }, fromAmino(object: GetBlockByHeightResponseAmino): GetBlockByHeightResponse { @@ -925,14 +1121,18 @@ export const GetBlockByHeightResponse = { message.blockId = BlockID.fromAmino(object.block_id); } if (object.block !== undefined && object.block !== null) { - message.block = Block.fromAmino(object.block); + message.block = Block1.fromAmino(object.block); + } + if (object.sdk_block !== undefined && object.sdk_block !== null) { + message.sdkBlock = Block2.fromAmino(object.sdk_block); } return message; }, toAmino(message: GetBlockByHeightResponse): GetBlockByHeightResponseAmino { const obj: any = {}; obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; - obj.block = message.block ? Block.toAmino(message.block) : undefined; + obj.block = message.block ? Block1.toAmino(message.block) : undefined; + obj.sdk_block = message.sdkBlock ? Block2.toAmino(message.sdkBlock) : undefined; return obj; }, fromAminoMsg(object: GetBlockByHeightResponseAminoMsg): GetBlockByHeightResponse { @@ -1016,7 +1216,8 @@ export const GetLatestBlockRequest = { function createBaseGetLatestBlockResponse(): GetLatestBlockResponse { return { blockId: undefined, - block: undefined + block: undefined, + sdkBlock: undefined }; } export const GetLatestBlockResponse = { @@ -1026,7 +1227,10 @@ export const GetLatestBlockResponse = { BlockID.encode(message.blockId, writer.uint32(10).fork()).ldelim(); } if (message.block !== undefined) { - Block.encode(message.block, writer.uint32(18).fork()).ldelim(); + Block1.encode(message.block, writer.uint32(18).fork()).ldelim(); + } + if (message.sdkBlock !== undefined) { + Block2.encode(message.sdkBlock, writer.uint32(26).fork()).ldelim(); } return writer; }, @@ -1041,7 +1245,10 @@ export const GetLatestBlockResponse = { message.blockId = BlockID.decode(reader, reader.uint32()); break; case 2: - message.block = Block.decode(reader, reader.uint32()); + message.block = Block1.decode(reader, reader.uint32()); + break; + case 3: + message.sdkBlock = Block2.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1053,7 +1260,8 @@ export const GetLatestBlockResponse = { fromPartial(object: Partial): GetLatestBlockResponse { const message = createBaseGetLatestBlockResponse(); message.blockId = object.blockId !== undefined && object.blockId !== null ? BlockID.fromPartial(object.blockId) : undefined; - message.block = object.block !== undefined && object.block !== null ? Block.fromPartial(object.block) : undefined; + message.block = object.block !== undefined && object.block !== null ? Block1.fromPartial(object.block) : undefined; + message.sdkBlock = object.sdkBlock !== undefined && object.sdkBlock !== null ? Block2.fromPartial(object.sdkBlock) : undefined; return message; }, fromAmino(object: GetLatestBlockResponseAmino): GetLatestBlockResponse { @@ -1062,14 +1270,18 @@ export const GetLatestBlockResponse = { message.blockId = BlockID.fromAmino(object.block_id); } if (object.block !== undefined && object.block !== null) { - message.block = Block.fromAmino(object.block); + message.block = Block1.fromAmino(object.block); + } + if (object.sdk_block !== undefined && object.sdk_block !== null) { + message.sdkBlock = Block2.fromAmino(object.sdk_block); } return message; }, toAmino(message: GetLatestBlockResponse): GetLatestBlockResponseAmino { const obj: any = {}; obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; - obj.block = message.block ? Block.toAmino(message.block) : undefined; + obj.block = message.block ? Block1.toAmino(message.block) : undefined; + obj.sdk_block = message.sdkBlock ? Block2.toAmino(message.sdkBlock) : undefined; return obj; }, fromAminoMsg(object: GetLatestBlockResponseAminoMsg): GetLatestBlockResponse { @@ -1603,4 +1815,438 @@ export const Module = { value: Module.encode(message).finish() }; } +}; +function createBaseABCIQueryRequest(): ABCIQueryRequest { + return { + data: new Uint8Array(), + path: "", + height: BigInt(0), + prove: false + }; +} +export const ABCIQueryRequest = { + typeUrl: "/cosmos.base.tendermint.v1beta1.ABCIQueryRequest", + encode(message: ABCIQueryRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + if (message.path !== "") { + writer.uint32(18).string(message.path); + } + if (message.height !== BigInt(0)) { + writer.uint32(24).int64(message.height); + } + if (message.prove === true) { + writer.uint32(32).bool(message.prove); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ABCIQueryRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseABCIQueryRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + case 2: + message.path = reader.string(); + break; + case 3: + message.height = reader.int64(); + break; + case 4: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ABCIQueryRequest { + const message = createBaseABCIQueryRequest(); + message.data = object.data ?? new Uint8Array(); + message.path = object.path ?? ""; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.prove = object.prove ?? false; + return message; + }, + fromAmino(object: ABCIQueryRequestAmino): ABCIQueryRequest { + const message = createBaseABCIQueryRequest(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.prove !== undefined && object.prove !== null) { + message.prove = object.prove; + } + return message; + }, + toAmino(message: ABCIQueryRequest): ABCIQueryRequestAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + obj.path = message.path === "" ? undefined : message.path; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.prove = message.prove === false ? undefined : message.prove; + return obj; + }, + fromAminoMsg(object: ABCIQueryRequestAminoMsg): ABCIQueryRequest { + return ABCIQueryRequest.fromAmino(object.value); + }, + toAminoMsg(message: ABCIQueryRequest): ABCIQueryRequestAminoMsg { + return { + type: "cosmos-sdk/ABCIQueryRequest", + value: ABCIQueryRequest.toAmino(message) + }; + }, + fromProtoMsg(message: ABCIQueryRequestProtoMsg): ABCIQueryRequest { + return ABCIQueryRequest.decode(message.value); + }, + toProto(message: ABCIQueryRequest): Uint8Array { + return ABCIQueryRequest.encode(message).finish(); + }, + toProtoMsg(message: ABCIQueryRequest): ABCIQueryRequestProtoMsg { + return { + typeUrl: "/cosmos.base.tendermint.v1beta1.ABCIQueryRequest", + value: ABCIQueryRequest.encode(message).finish() + }; + } +}; +function createBaseABCIQueryResponse(): ABCIQueryResponse { + return { + code: 0, + log: "", + info: "", + index: BigInt(0), + key: new Uint8Array(), + value: new Uint8Array(), + proofOps: undefined, + height: BigInt(0), + codespace: "" + }; +} +export const ABCIQueryResponse = { + typeUrl: "/cosmos.base.tendermint.v1beta1.ABCIQueryResponse", + encode(message: ABCIQueryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.code !== 0) { + writer.uint32(8).uint32(message.code); + } + if (message.log !== "") { + writer.uint32(26).string(message.log); + } + if (message.info !== "") { + writer.uint32(34).string(message.info); + } + if (message.index !== BigInt(0)) { + writer.uint32(40).int64(message.index); + } + if (message.key.length !== 0) { + writer.uint32(50).bytes(message.key); + } + if (message.value.length !== 0) { + writer.uint32(58).bytes(message.value); + } + if (message.proofOps !== undefined) { + ProofOps.encode(message.proofOps, writer.uint32(66).fork()).ldelim(); + } + if (message.height !== BigInt(0)) { + writer.uint32(72).int64(message.height); + } + if (message.codespace !== "") { + writer.uint32(82).string(message.codespace); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ABCIQueryResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseABCIQueryResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.uint32(); + break; + case 3: + message.log = reader.string(); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.index = reader.int64(); + break; + case 6: + message.key = reader.bytes(); + break; + case 7: + message.value = reader.bytes(); + break; + case 8: + message.proofOps = ProofOps.decode(reader, reader.uint32()); + break; + case 9: + message.height = reader.int64(); + break; + case 10: + message.codespace = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ABCIQueryResponse { + const message = createBaseABCIQueryResponse(); + message.code = object.code ?? 0; + message.log = object.log ?? ""; + message.info = object.info ?? ""; + message.index = object.index !== undefined && object.index !== null ? BigInt(object.index.toString()) : BigInt(0); + message.key = object.key ?? new Uint8Array(); + message.value = object.value ?? new Uint8Array(); + message.proofOps = object.proofOps !== undefined && object.proofOps !== null ? ProofOps.fromPartial(object.proofOps) : undefined; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.codespace = object.codespace ?? ""; + return message; + }, + fromAmino(object: ABCIQueryResponseAmino): ABCIQueryResponse { + const message = createBaseABCIQueryResponse(); + if (object.code !== undefined && object.code !== null) { + message.code = object.code; + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } + if (object.index !== undefined && object.index !== null) { + message.index = BigInt(object.index); + } + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + if (object.proof_ops !== undefined && object.proof_ops !== null) { + message.proofOps = ProofOps.fromAmino(object.proof_ops); + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = object.codespace; + } + return message; + }, + toAmino(message: ABCIQueryResponse): ABCIQueryResponseAmino { + const obj: any = {}; + obj.code = message.code === 0 ? undefined : message.code; + obj.log = message.log === "" ? undefined : message.log; + obj.info = message.info === "" ? undefined : message.info; + obj.index = message.index !== BigInt(0) ? message.index.toString() : undefined; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; + obj.proof_ops = message.proofOps ? ProofOps.toAmino(message.proofOps) : undefined; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.codespace = message.codespace === "" ? undefined : message.codespace; + return obj; + }, + fromAminoMsg(object: ABCIQueryResponseAminoMsg): ABCIQueryResponse { + return ABCIQueryResponse.fromAmino(object.value); + }, + toAminoMsg(message: ABCIQueryResponse): ABCIQueryResponseAminoMsg { + return { + type: "cosmos-sdk/ABCIQueryResponse", + value: ABCIQueryResponse.toAmino(message) + }; + }, + fromProtoMsg(message: ABCIQueryResponseProtoMsg): ABCIQueryResponse { + return ABCIQueryResponse.decode(message.value); + }, + toProto(message: ABCIQueryResponse): Uint8Array { + return ABCIQueryResponse.encode(message).finish(); + }, + toProtoMsg(message: ABCIQueryResponse): ABCIQueryResponseProtoMsg { + return { + typeUrl: "/cosmos.base.tendermint.v1beta1.ABCIQueryResponse", + value: ABCIQueryResponse.encode(message).finish() + }; + } +}; +function createBaseProofOp(): ProofOp { + return { + type: "", + key: new Uint8Array(), + data: new Uint8Array() + }; +} +export const ProofOp = { + typeUrl: "/cosmos.base.tendermint.v1beta1.ProofOp", + encode(message: ProofOp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.type !== "") { + writer.uint32(10).string(message.type); + } + if (message.key.length !== 0) { + writer.uint32(18).bytes(message.key); + } + if (message.data.length !== 0) { + writer.uint32(26).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ProofOp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProofOp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + message.key = reader.bytes(); + break; + case 3: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ProofOp { + const message = createBaseProofOp(); + message.type = object.type ?? ""; + message.key = object.key ?? new Uint8Array(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: ProofOpAmino): ProofOp { + const message = createBaseProofOp(); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: ProofOp): ProofOpAmino { + const obj: any = {}; + obj.type = message.type === "" ? undefined : message.type; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: ProofOpAminoMsg): ProofOp { + return ProofOp.fromAmino(object.value); + }, + toAminoMsg(message: ProofOp): ProofOpAminoMsg { + return { + type: "cosmos-sdk/ProofOp", + value: ProofOp.toAmino(message) + }; + }, + fromProtoMsg(message: ProofOpProtoMsg): ProofOp { + return ProofOp.decode(message.value); + }, + toProto(message: ProofOp): Uint8Array { + return ProofOp.encode(message).finish(); + }, + toProtoMsg(message: ProofOp): ProofOpProtoMsg { + return { + typeUrl: "/cosmos.base.tendermint.v1beta1.ProofOp", + value: ProofOp.encode(message).finish() + }; + } +}; +function createBaseProofOps(): ProofOps { + return { + ops: [] + }; +} +export const ProofOps = { + typeUrl: "/cosmos.base.tendermint.v1beta1.ProofOps", + encode(message: ProofOps, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.ops) { + ProofOp.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ProofOps { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProofOps(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ops.push(ProofOp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ProofOps { + const message = createBaseProofOps(); + message.ops = object.ops?.map(e => ProofOp.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ProofOpsAmino): ProofOps { + const message = createBaseProofOps(); + message.ops = object.ops?.map(e => ProofOp.fromAmino(e)) || []; + return message; + }, + toAmino(message: ProofOps): ProofOpsAmino { + const obj: any = {}; + if (message.ops) { + obj.ops = message.ops.map(e => e ? ProofOp.toAmino(e) : undefined); + } else { + obj.ops = message.ops; + } + return obj; + }, + fromAminoMsg(object: ProofOpsAminoMsg): ProofOps { + return ProofOps.fromAmino(object.value); + }, + toAminoMsg(message: ProofOps): ProofOpsAminoMsg { + return { + type: "cosmos-sdk/ProofOps", + value: ProofOps.toAmino(message) + }; + }, + fromProtoMsg(message: ProofOpsProtoMsg): ProofOps { + return ProofOps.decode(message.value); + }, + toProto(message: ProofOps): Uint8Array { + return ProofOps.encode(message).finish(); + }, + toProtoMsg(message: ProofOps): ProofOpsProtoMsg { + return { + typeUrl: "/cosmos.base.tendermint.v1beta1.ProofOps", + value: ProofOps.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/src/codegen/cosmos/base/tendermint/v1beta1/types.ts b/src/codegen/cosmos/base/tendermint/v1beta1/types.ts new file mode 100644 index 0000000..7c960e1 --- /dev/null +++ b/src/codegen/cosmos/base/tendermint/v1beta1/types.ts @@ -0,0 +1,459 @@ +import { Data, DataAmino, DataSDKType, Commit, CommitAmino, CommitSDKType, BlockID, BlockIDAmino, BlockIDSDKType } from "../../../../tendermint/types/types"; +import { EvidenceList, EvidenceListAmino, EvidenceListSDKType } from "../../../../tendermint/types/evidence"; +import { Consensus, ConsensusAmino, ConsensusSDKType } from "../../../../tendermint/version/types"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { toTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** + * Block is tendermint type Block, with the Header proposer address + * field converted to bech32 string. + */ +export interface Block { + header: Header; + data: Data; + evidence: EvidenceList; + lastCommit?: Commit; +} +export interface BlockProtoMsg { + typeUrl: "/cosmos.base.tendermint.v1beta1.Block"; + value: Uint8Array; +} +/** + * Block is tendermint type Block, with the Header proposer address + * field converted to bech32 string. + */ +export interface BlockAmino { + header: HeaderAmino; + data: DataAmino; + evidence: EvidenceListAmino; + last_commit?: CommitAmino; +} +export interface BlockAminoMsg { + type: "cosmos-sdk/Block"; + value: BlockAmino; +} +/** + * Block is tendermint type Block, with the Header proposer address + * field converted to bech32 string. + */ +export interface BlockSDKType { + header: HeaderSDKType; + data: DataSDKType; + evidence: EvidenceListSDKType; + last_commit?: CommitSDKType; +} +/** Header defines the structure of a Tendermint block header. */ +export interface Header { + /** basic block info */ + version: Consensus; + chainId: string; + height: bigint; + time: Date; + /** prev block info */ + lastBlockId: BlockID; + /** hashes of block data */ + lastCommitHash: Uint8Array; + dataHash: Uint8Array; + /** hashes from the app output from the prev block */ + validatorsHash: Uint8Array; + /** validators for the next block */ + nextValidatorsHash: Uint8Array; + /** consensus params for current block */ + consensusHash: Uint8Array; + /** state after txs from the previous block */ + appHash: Uint8Array; + lastResultsHash: Uint8Array; + /** consensus info */ + evidenceHash: Uint8Array; + /** + * proposer_address is the original block proposer address, formatted as a Bech32 string. + * In Tendermint, this type is `bytes`, but in the SDK, we convert it to a Bech32 string + * for better UX. + */ + proposerAddress: string; +} +export interface HeaderProtoMsg { + typeUrl: "/cosmos.base.tendermint.v1beta1.Header"; + value: Uint8Array; +} +/** Header defines the structure of a Tendermint block header. */ +export interface HeaderAmino { + /** basic block info */ + version: ConsensusAmino; + chain_id?: string; + height?: string; + time: string; + /** prev block info */ + last_block_id: BlockIDAmino; + /** hashes of block data */ + last_commit_hash?: string; + data_hash?: string; + /** hashes from the app output from the prev block */ + validators_hash?: string; + /** validators for the next block */ + next_validators_hash?: string; + /** consensus params for current block */ + consensus_hash?: string; + /** state after txs from the previous block */ + app_hash?: string; + last_results_hash?: string; + /** consensus info */ + evidence_hash?: string; + /** + * proposer_address is the original block proposer address, formatted as a Bech32 string. + * In Tendermint, this type is `bytes`, but in the SDK, we convert it to a Bech32 string + * for better UX. + */ + proposer_address?: string; +} +export interface HeaderAminoMsg { + type: "cosmos-sdk/Header"; + value: HeaderAmino; +} +/** Header defines the structure of a Tendermint block header. */ +export interface HeaderSDKType { + version: ConsensusSDKType; + chain_id: string; + height: bigint; + time: Date; + last_block_id: BlockIDSDKType; + last_commit_hash: Uint8Array; + data_hash: Uint8Array; + validators_hash: Uint8Array; + next_validators_hash: Uint8Array; + consensus_hash: Uint8Array; + app_hash: Uint8Array; + last_results_hash: Uint8Array; + evidence_hash: Uint8Array; + proposer_address: string; +} +function createBaseBlock(): Block { + return { + header: Header.fromPartial({}), + data: Data.fromPartial({}), + evidence: EvidenceList.fromPartial({}), + lastCommit: undefined + }; +} +export const Block = { + typeUrl: "/cosmos.base.tendermint.v1beta1.Block", + encode(message: Block, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.header !== undefined) { + Header.encode(message.header, writer.uint32(10).fork()).ldelim(); + } + if (message.data !== undefined) { + Data.encode(message.data, writer.uint32(18).fork()).ldelim(); + } + if (message.evidence !== undefined) { + EvidenceList.encode(message.evidence, writer.uint32(26).fork()).ldelim(); + } + if (message.lastCommit !== undefined) { + Commit.encode(message.lastCommit, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Block { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBlock(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.header = Header.decode(reader, reader.uint32()); + break; + case 2: + message.data = Data.decode(reader, reader.uint32()); + break; + case 3: + message.evidence = EvidenceList.decode(reader, reader.uint32()); + break; + case 4: + message.lastCommit = Commit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Block { + const message = createBaseBlock(); + message.header = object.header !== undefined && object.header !== null ? Header.fromPartial(object.header) : undefined; + message.data = object.data !== undefined && object.data !== null ? Data.fromPartial(object.data) : undefined; + message.evidence = object.evidence !== undefined && object.evidence !== null ? EvidenceList.fromPartial(object.evidence) : undefined; + message.lastCommit = object.lastCommit !== undefined && object.lastCommit !== null ? Commit.fromPartial(object.lastCommit) : undefined; + return message; + }, + fromAmino(object: BlockAmino): Block { + const message = createBaseBlock(); + if (object.header !== undefined && object.header !== null) { + message.header = Header.fromAmino(object.header); + } + if (object.data !== undefined && object.data !== null) { + message.data = Data.fromAmino(object.data); + } + if (object.evidence !== undefined && object.evidence !== null) { + message.evidence = EvidenceList.fromAmino(object.evidence); + } + if (object.last_commit !== undefined && object.last_commit !== null) { + message.lastCommit = Commit.fromAmino(object.last_commit); + } + return message; + }, + toAmino(message: Block): BlockAmino { + const obj: any = {}; + obj.header = message.header ? Header.toAmino(message.header) : Header.toAmino(Header.fromPartial({})); + obj.data = message.data ? Data.toAmino(message.data) : Data.toAmino(Data.fromPartial({})); + obj.evidence = message.evidence ? EvidenceList.toAmino(message.evidence) : EvidenceList.toAmino(EvidenceList.fromPartial({})); + obj.last_commit = message.lastCommit ? Commit.toAmino(message.lastCommit) : undefined; + return obj; + }, + fromAminoMsg(object: BlockAminoMsg): Block { + return Block.fromAmino(object.value); + }, + toAminoMsg(message: Block): BlockAminoMsg { + return { + type: "cosmos-sdk/Block", + value: Block.toAmino(message) + }; + }, + fromProtoMsg(message: BlockProtoMsg): Block { + return Block.decode(message.value); + }, + toProto(message: Block): Uint8Array { + return Block.encode(message).finish(); + }, + toProtoMsg(message: Block): BlockProtoMsg { + return { + typeUrl: "/cosmos.base.tendermint.v1beta1.Block", + value: Block.encode(message).finish() + }; + } +}; +function createBaseHeader(): Header { + return { + version: Consensus.fromPartial({}), + chainId: "", + height: BigInt(0), + time: new Date(), + lastBlockId: BlockID.fromPartial({}), + lastCommitHash: new Uint8Array(), + dataHash: new Uint8Array(), + validatorsHash: new Uint8Array(), + nextValidatorsHash: new Uint8Array(), + consensusHash: new Uint8Array(), + appHash: new Uint8Array(), + lastResultsHash: new Uint8Array(), + evidenceHash: new Uint8Array(), + proposerAddress: "" + }; +} +export const Header = { + typeUrl: "/cosmos.base.tendermint.v1beta1.Header", + encode(message: Header, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.version !== undefined) { + Consensus.encode(message.version, writer.uint32(10).fork()).ldelim(); + } + if (message.chainId !== "") { + writer.uint32(18).string(message.chainId); + } + if (message.height !== BigInt(0)) { + writer.uint32(24).int64(message.height); + } + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(34).fork()).ldelim(); + } + if (message.lastBlockId !== undefined) { + BlockID.encode(message.lastBlockId, writer.uint32(42).fork()).ldelim(); + } + if (message.lastCommitHash.length !== 0) { + writer.uint32(50).bytes(message.lastCommitHash); + } + if (message.dataHash.length !== 0) { + writer.uint32(58).bytes(message.dataHash); + } + if (message.validatorsHash.length !== 0) { + writer.uint32(66).bytes(message.validatorsHash); + } + if (message.nextValidatorsHash.length !== 0) { + writer.uint32(74).bytes(message.nextValidatorsHash); + } + if (message.consensusHash.length !== 0) { + writer.uint32(82).bytes(message.consensusHash); + } + if (message.appHash.length !== 0) { + writer.uint32(90).bytes(message.appHash); + } + if (message.lastResultsHash.length !== 0) { + writer.uint32(98).bytes(message.lastResultsHash); + } + if (message.evidenceHash.length !== 0) { + writer.uint32(106).bytes(message.evidenceHash); + } + if (message.proposerAddress !== "") { + writer.uint32(114).string(message.proposerAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Header { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHeader(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = Consensus.decode(reader, reader.uint32()); + break; + case 2: + message.chainId = reader.string(); + break; + case 3: + message.height = reader.int64(); + break; + case 4: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 5: + message.lastBlockId = BlockID.decode(reader, reader.uint32()); + break; + case 6: + message.lastCommitHash = reader.bytes(); + break; + case 7: + message.dataHash = reader.bytes(); + break; + case 8: + message.validatorsHash = reader.bytes(); + break; + case 9: + message.nextValidatorsHash = reader.bytes(); + break; + case 10: + message.consensusHash = reader.bytes(); + break; + case 11: + message.appHash = reader.bytes(); + break; + case 12: + message.lastResultsHash = reader.bytes(); + break; + case 13: + message.evidenceHash = reader.bytes(); + break; + case 14: + message.proposerAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial
): Header { + const message = createBaseHeader(); + message.version = object.version !== undefined && object.version !== null ? Consensus.fromPartial(object.version) : undefined; + message.chainId = object.chainId ?? ""; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.time = object.time ?? undefined; + message.lastBlockId = object.lastBlockId !== undefined && object.lastBlockId !== null ? BlockID.fromPartial(object.lastBlockId) : undefined; + message.lastCommitHash = object.lastCommitHash ?? new Uint8Array(); + message.dataHash = object.dataHash ?? new Uint8Array(); + message.validatorsHash = object.validatorsHash ?? new Uint8Array(); + message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array(); + message.consensusHash = object.consensusHash ?? new Uint8Array(); + message.appHash = object.appHash ?? new Uint8Array(); + message.lastResultsHash = object.lastResultsHash ?? new Uint8Array(); + message.evidenceHash = object.evidenceHash ?? new Uint8Array(); + message.proposerAddress = object.proposerAddress ?? ""; + return message; + }, + fromAmino(object: HeaderAmino): Header { + const message = createBaseHeader(); + if (object.version !== undefined && object.version !== null) { + message.version = Consensus.fromAmino(object.version); + } + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.time !== undefined && object.time !== null) { + message.time = fromTimestamp(Timestamp.fromAmino(object.time)); + } + if (object.last_block_id !== undefined && object.last_block_id !== null) { + message.lastBlockId = BlockID.fromAmino(object.last_block_id); + } + if (object.last_commit_hash !== undefined && object.last_commit_hash !== null) { + message.lastCommitHash = bytesFromBase64(object.last_commit_hash); + } + if (object.data_hash !== undefined && object.data_hash !== null) { + message.dataHash = bytesFromBase64(object.data_hash); + } + if (object.validators_hash !== undefined && object.validators_hash !== null) { + message.validatorsHash = bytesFromBase64(object.validators_hash); + } + if (object.next_validators_hash !== undefined && object.next_validators_hash !== null) { + message.nextValidatorsHash = bytesFromBase64(object.next_validators_hash); + } + if (object.consensus_hash !== undefined && object.consensus_hash !== null) { + message.consensusHash = bytesFromBase64(object.consensus_hash); + } + if (object.app_hash !== undefined && object.app_hash !== null) { + message.appHash = bytesFromBase64(object.app_hash); + } + if (object.last_results_hash !== undefined && object.last_results_hash !== null) { + message.lastResultsHash = bytesFromBase64(object.last_results_hash); + } + if (object.evidence_hash !== undefined && object.evidence_hash !== null) { + message.evidenceHash = bytesFromBase64(object.evidence_hash); + } + if (object.proposer_address !== undefined && object.proposer_address !== null) { + message.proposerAddress = object.proposer_address; + } + return message; + }, + toAmino(message: Header): HeaderAmino { + const obj: any = {}; + obj.version = message.version ? Consensus.toAmino(message.version) : Consensus.toAmino(Consensus.fromPartial({})); + obj.chain_id = message.chainId === "" ? undefined : message.chainId; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : new Date(); + obj.last_block_id = message.lastBlockId ? BlockID.toAmino(message.lastBlockId) : BlockID.toAmino(BlockID.fromPartial({})); + obj.last_commit_hash = message.lastCommitHash ? base64FromBytes(message.lastCommitHash) : undefined; + obj.data_hash = message.dataHash ? base64FromBytes(message.dataHash) : undefined; + obj.validators_hash = message.validatorsHash ? base64FromBytes(message.validatorsHash) : undefined; + obj.next_validators_hash = message.nextValidatorsHash ? base64FromBytes(message.nextValidatorsHash) : undefined; + obj.consensus_hash = message.consensusHash ? base64FromBytes(message.consensusHash) : undefined; + obj.app_hash = message.appHash ? base64FromBytes(message.appHash) : undefined; + obj.last_results_hash = message.lastResultsHash ? base64FromBytes(message.lastResultsHash) : undefined; + obj.evidence_hash = message.evidenceHash ? base64FromBytes(message.evidenceHash) : undefined; + obj.proposer_address = message.proposerAddress === "" ? undefined : message.proposerAddress; + return obj; + }, + fromAminoMsg(object: HeaderAminoMsg): Header { + return Header.fromAmino(object.value); + }, + toAminoMsg(message: Header): HeaderAminoMsg { + return { + type: "cosmos-sdk/Header", + value: Header.toAmino(message) + }; + }, + fromProtoMsg(message: HeaderProtoMsg): Header { + return Header.decode(message.value); + }, + toProto(message: Header): Uint8Array { + return Header.encode(message).finish(); + }, + toProtoMsg(message: Header): HeaderProtoMsg { + return { + typeUrl: "/cosmos.base.tendermint.v1beta1.Header", + value: Header.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/base/v1beta1/coin.ts b/src/codegen/cosmos/base/v1beta1/coin.ts index 5831403..c87f102 100644 --- a/src/codegen/cosmos/base/v1beta1/coin.ts +++ b/src/codegen/cosmos/base/v1beta1/coin.ts @@ -1,4 +1,5 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; +import { Decimal } from "@cosmjs/math"; /** * Coin defines a token with a denomination and an amount. * @@ -21,7 +22,7 @@ export interface CoinProtoMsg { */ export interface CoinAmino { denom?: string; - amount?: string; + amount: string; } export interface CoinAminoMsg { type: "cosmos-sdk/Coin"; @@ -75,7 +76,10 @@ export interface DecCoinSDKType { denom: string; amount: string; } -/** IntProto defines a Protobuf wrapper around an Int object. */ +/** + * IntProto defines a Protobuf wrapper around an Int object. + * Deprecated: Prefer to use math.Int directly. It supports binary Marshal and Unmarshal. + */ export interface IntProto { int: string; } @@ -83,7 +87,10 @@ export interface IntProtoProtoMsg { typeUrl: "/cosmos.base.v1beta1.IntProto"; value: Uint8Array; } -/** IntProto defines a Protobuf wrapper around an Int object. */ +/** + * IntProto defines a Protobuf wrapper around an Int object. + * Deprecated: Prefer to use math.Int directly. It supports binary Marshal and Unmarshal. + */ export interface IntProtoAmino { int?: string; } @@ -91,11 +98,17 @@ export interface IntProtoAminoMsg { type: "cosmos-sdk/IntProto"; value: IntProtoAmino; } -/** IntProto defines a Protobuf wrapper around an Int object. */ +/** + * IntProto defines a Protobuf wrapper around an Int object. + * Deprecated: Prefer to use math.Int directly. It supports binary Marshal and Unmarshal. + */ export interface IntProtoSDKType { int: string; } -/** DecProto defines a Protobuf wrapper around a Dec object. */ +/** + * DecProto defines a Protobuf wrapper around a Dec object. + * Deprecated: Prefer to use math.LegacyDec directly. It supports binary Marshal and Unmarshal. + */ export interface DecProto { dec: string; } @@ -103,7 +116,10 @@ export interface DecProtoProtoMsg { typeUrl: "/cosmos.base.v1beta1.DecProto"; value: Uint8Array; } -/** DecProto defines a Protobuf wrapper around a Dec object. */ +/** + * DecProto defines a Protobuf wrapper around a Dec object. + * Deprecated: Prefer to use math.LegacyDec directly. It supports binary Marshal and Unmarshal. + */ export interface DecProtoAmino { dec?: string; } @@ -111,7 +127,10 @@ export interface DecProtoAminoMsg { type: "cosmos-sdk/DecProto"; value: DecProtoAmino; } -/** DecProto defines a Protobuf wrapper around a Dec object. */ +/** + * DecProto defines a Protobuf wrapper around a Dec object. + * Deprecated: Prefer to use math.LegacyDec directly. It supports binary Marshal and Unmarshal. + */ export interface DecProtoSDKType { dec: string; } @@ -171,7 +190,7 @@ export const Coin = { toAmino(message: Coin): CoinAmino { const obj: any = {}; obj.denom = message.denom === "" ? undefined : message.denom; - obj.amount = message.amount === "" ? undefined : message.amount; + obj.amount = message.amount ?? ""; return obj; }, fromAminoMsg(object: CoinAminoMsg): Coin { @@ -209,7 +228,7 @@ export const DecCoin = { writer.uint32(10).string(message.denom); } if (message.amount !== "") { - writer.uint32(18).string(message.amount); + writer.uint32(18).string(Decimal.fromUserInput(message.amount, 18).atomics); } return writer; }, @@ -224,7 +243,7 @@ export const DecCoin = { message.denom = reader.string(); break; case 2: - message.amount = reader.string(); + message.amount = Decimal.fromAtomics(reader.string(), 18).toString(); break; default: reader.skipType(tag & 7); @@ -355,7 +374,7 @@ export const DecProto = { typeUrl: "/cosmos.base.v1beta1.DecProto", encode(message: DecProto, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.dec !== "") { - writer.uint32(10).string(message.dec); + writer.uint32(10).string(Decimal.fromUserInput(message.dec, 18).atomics); } return writer; }, @@ -367,7 +386,7 @@ export const DecProto = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.dec = reader.string(); + message.dec = Decimal.fromAtomics(reader.string(), 18).toString(); break; default: reader.skipType(tag & 7); diff --git a/src/codegen/cosmos/bundle.ts b/src/codegen/cosmos/bundle.ts index df48c2d..2ac5202 100644 --- a/src/codegen/cosmos/bundle.ts +++ b/src/codegen/cosmos/bundle.ts @@ -1,390 +1,764 @@ -import * as _3 from "./auth/v1beta1/auth"; -import * as _4 from "./auth/v1beta1/genesis"; -import * as _5 from "./auth/v1beta1/query"; -import * as _6 from "./authz/v1beta1/authz"; -import * as _7 from "./authz/v1beta1/event"; -import * as _8 from "./authz/v1beta1/genesis"; -import * as _9 from "./authz/v1beta1/query"; -import * as _10 from "./authz/v1beta1/tx"; -import * as _11 from "./bank/v1beta1/authz"; -import * as _12 from "./bank/v1beta1/bank"; -import * as _13 from "./bank/v1beta1/genesis"; -import * as _14 from "./bank/v1beta1/query"; -import * as _15 from "./bank/v1beta1/tx"; -import * as _16 from "./base/abci/v1beta1/abci"; -import * as _17 from "./base/kv/v1beta1/kv"; -import * as _18 from "./base/node/v1beta1/query"; -import * as _19 from "./base/query/v1beta1/pagination"; -import * as _20 from "./base/reflection/v1beta1/reflection"; -import * as _21 from "./base/reflection/v2alpha1/reflection"; -import * as _22 from "./base/snapshots/v1beta1/snapshot"; -import * as _23 from "./base/store/v1beta1/commit_info"; -import * as _24 from "./base/store/v1beta1/listening"; -import * as _25 from "./base/tendermint/v1beta1/query"; -import * as _26 from "./base/v1beta1/coin"; -import * as _27 from "./capability/v1beta1/capability"; -import * as _28 from "./capability/v1beta1/genesis"; -import * as _29 from "./crisis/v1beta1/genesis"; -import * as _30 from "./crisis/v1beta1/tx"; -import * as _31 from "./crypto/ed25519/keys"; -import * as _32 from "./crypto/multisig/keys"; -import * as _33 from "./crypto/secp256k1/keys"; -import * as _34 from "./crypto/secp256r1/keys"; -import * as _35 from "./distribution/v1beta1/distribution"; -import * as _36 from "./distribution/v1beta1/genesis"; -import * as _37 from "./distribution/v1beta1/query"; -import * as _38 from "./distribution/v1beta1/tx"; -import * as _39 from "./evidence/v1beta1/evidence"; -import * as _40 from "./evidence/v1beta1/genesis"; -import * as _41 from "./evidence/v1beta1/query"; -import * as _42 from "./evidence/v1beta1/tx"; -import * as _43 from "./feegrant/v1beta1/feegrant"; -import * as _44 from "./feegrant/v1beta1/genesis"; -import * as _45 from "./feegrant/v1beta1/query"; -import * as _46 from "./feegrant/v1beta1/tx"; -import * as _47 from "./genutil/v1beta1/genesis"; -import * as _48 from "./gov/v1beta1/genesis"; -import * as _49 from "./gov/v1beta1/gov"; -import * as _50 from "./gov/v1beta1/query"; -import * as _51 from "./gov/v1beta1/tx"; -import * as _52 from "./mint/v1beta1/genesis"; -import * as _53 from "./mint/v1beta1/mint"; -import * as _54 from "./mint/v1beta1/query"; -import * as _55 from "./params/v1beta1/params"; -import * as _56 from "./params/v1beta1/query"; -import * as _57 from "./slashing/v1beta1/genesis"; -import * as _58 from "./slashing/v1beta1/query"; -import * as _59 from "./slashing/v1beta1/slashing"; -import * as _60 from "./slashing/v1beta1/tx"; -import * as _61 from "./staking/v1beta1/authz"; -import * as _62 from "./staking/v1beta1/genesis"; -import * as _63 from "./staking/v1beta1/query"; -import * as _64 from "./staking/v1beta1/staking"; -import * as _65 from "./staking/v1beta1/tx"; -import * as _66 from "./tx/signing/v1beta1/signing"; -import * as _67 from "./tx/v1beta1/service"; -import * as _68 from "./tx/v1beta1/tx"; -import * as _69 from "./upgrade/v1beta1/query"; -import * as _70 from "./upgrade/v1beta1/upgrade"; -import * as _71 from "./vesting/v1beta1/tx"; -import * as _72 from "./vesting/v1beta1/vesting"; -import * as _137 from "./authz/v1beta1/tx.amino"; -import * as _138 from "./bank/v1beta1/tx.amino"; -import * as _139 from "./crisis/v1beta1/tx.amino"; -import * as _140 from "./distribution/v1beta1/tx.amino"; -import * as _141 from "./evidence/v1beta1/tx.amino"; -import * as _142 from "./feegrant/v1beta1/tx.amino"; -import * as _143 from "./gov/v1beta1/tx.amino"; -import * as _144 from "./slashing/v1beta1/tx.amino"; -import * as _145 from "./staking/v1beta1/tx.amino"; -import * as _146 from "./vesting/v1beta1/tx.amino"; -import * as _147 from "./authz/v1beta1/tx.registry"; -import * as _148 from "./bank/v1beta1/tx.registry"; -import * as _149 from "./crisis/v1beta1/tx.registry"; -import * as _150 from "./distribution/v1beta1/tx.registry"; -import * as _151 from "./evidence/v1beta1/tx.registry"; -import * as _152 from "./feegrant/v1beta1/tx.registry"; -import * as _153 from "./gov/v1beta1/tx.registry"; -import * as _154 from "./slashing/v1beta1/tx.registry"; -import * as _155 from "./staking/v1beta1/tx.registry"; -import * as _156 from "./vesting/v1beta1/tx.registry"; -import * as _157 from "./auth/v1beta1/query.lcd"; -import * as _158 from "./authz/v1beta1/query.lcd"; -import * as _159 from "./bank/v1beta1/query.lcd"; -import * as _160 from "./base/node/v1beta1/query.lcd"; -import * as _161 from "./base/tendermint/v1beta1/query.lcd"; -import * as _162 from "./distribution/v1beta1/query.lcd"; -import * as _163 from "./evidence/v1beta1/query.lcd"; -import * as _164 from "./feegrant/v1beta1/query.lcd"; -import * as _165 from "./gov/v1beta1/query.lcd"; -import * as _166 from "./mint/v1beta1/query.lcd"; -import * as _167 from "./params/v1beta1/query.lcd"; -import * as _168 from "./slashing/v1beta1/query.lcd"; -import * as _169 from "./staking/v1beta1/query.lcd"; -import * as _170 from "./tx/v1beta1/service.lcd"; -import * as _171 from "./upgrade/v1beta1/query.lcd"; -import * as _172 from "./auth/v1beta1/query.rpc.Query"; -import * as _173 from "./authz/v1beta1/query.rpc.Query"; -import * as _174 from "./bank/v1beta1/query.rpc.Query"; -import * as _175 from "./base/node/v1beta1/query.rpc.Service"; -import * as _176 from "./base/tendermint/v1beta1/query.rpc.Service"; -import * as _177 from "./distribution/v1beta1/query.rpc.Query"; -import * as _178 from "./evidence/v1beta1/query.rpc.Query"; -import * as _179 from "./feegrant/v1beta1/query.rpc.Query"; -import * as _180 from "./gov/v1beta1/query.rpc.Query"; -import * as _181 from "./mint/v1beta1/query.rpc.Query"; -import * as _182 from "./params/v1beta1/query.rpc.Query"; -import * as _183 from "./slashing/v1beta1/query.rpc.Query"; -import * as _184 from "./staking/v1beta1/query.rpc.Query"; -import * as _185 from "./tx/v1beta1/service.rpc.Service"; -import * as _186 from "./upgrade/v1beta1/query.rpc.Query"; -import * as _187 from "./authz/v1beta1/tx.rpc.msg"; -import * as _188 from "./bank/v1beta1/tx.rpc.msg"; -import * as _189 from "./crisis/v1beta1/tx.rpc.msg"; -import * as _190 from "./distribution/v1beta1/tx.rpc.msg"; -import * as _191 from "./evidence/v1beta1/tx.rpc.msg"; -import * as _192 from "./feegrant/v1beta1/tx.rpc.msg"; -import * as _193 from "./gov/v1beta1/tx.rpc.msg"; -import * as _194 from "./slashing/v1beta1/tx.rpc.msg"; -import * as _195 from "./staking/v1beta1/tx.rpc.msg"; -import * as _196 from "./vesting/v1beta1/tx.rpc.msg"; -import * as _231 from "./lcd"; -import * as _232 from "./rpc.query"; -import * as _233 from "./rpc.tx"; +import * as _4 from "./app/runtime/v1alpha1/module"; +import * as _5 from "./app/v1alpha1/config"; +import * as _6 from "./app/v1alpha1/module"; +import * as _7 from "./app/v1alpha1/query"; +import * as _8 from "./auth/module/v1/module"; +import * as _9 from "./auth/v1beta1/auth"; +import * as _10 from "./auth/v1beta1/genesis"; +import * as _11 from "./auth/v1beta1/query"; +import * as _12 from "./auth/v1beta1/tx"; +import * as _13 from "./authz/module/v1/module"; +import * as _14 from "./authz/v1beta1/authz"; +import * as _15 from "./authz/v1beta1/event"; +import * as _16 from "./authz/v1beta1/genesis"; +import * as _17 from "./authz/v1beta1/query"; +import * as _18 from "./authz/v1beta1/tx"; +import * as _19 from "./autocli/v1/options"; +import * as _20 from "./autocli/v1/query"; +import * as _21 from "./bank/module/v1/module"; +import * as _22 from "./bank/v1beta1/authz"; +import * as _23 from "./bank/v1beta1/bank"; +import * as _24 from "./bank/v1beta1/genesis"; +import * as _25 from "./bank/v1beta1/query"; +import * as _26 from "./bank/v1beta1/tx"; +import * as _27 from "./base/abci/v1beta1/abci"; +import * as _28 from "./base/kv/v1beta1/kv"; +import * as _29 from "./base/node/v1beta1/query"; +import * as _30 from "./base/query/v1beta1/pagination"; +import * as _31 from "./base/reflection/v1beta1/reflection"; +import * as _32 from "./base/reflection/v2alpha1/reflection"; +import * as _33 from "./base/snapshots/v1beta1/snapshot"; +import * as _34 from "./base/store/v1beta1/commit_info"; +import * as _35 from "./base/store/v1beta1/listening"; +import * as _36 from "./base/tendermint/v1beta1/query"; +import * as _37 from "./base/tendermint/v1beta1/types"; +import * as _38 from "./base/v1beta1/coin"; +import * as _39 from "./capability/v1beta1/capability"; +import * as _40 from "./capability/v1beta1/genesis"; +import * as _41 from "./circuit/module/v1/module"; +import * as _42 from "./circuit/v1/query"; +import * as _43 from "./circuit/v1/tx"; +import * as _44 from "./circuit/v1/types"; +import * as _45 from "./consensus/module/v1/module"; +import * as _46 from "./consensus/v1/query"; +import * as _47 from "./consensus/v1/tx"; +import * as _48 from "./crisis/module/v1/module"; +import * as _49 from "./crisis/v1beta1/genesis"; +import * as _50 from "./crisis/v1beta1/tx"; +import * as _51 from "./crypto/ed25519/keys"; +import * as _52 from "./crypto/hd/v1/hd"; +import * as _53 from "./crypto/keyring/v1/record"; +import * as _54 from "./crypto/multisig/keys"; +import * as _55 from "./crypto/secp256k1/keys"; +import * as _56 from "./crypto/secp256r1/keys"; +import * as _57 from "./distribution/module/v1/module"; +import * as _58 from "./distribution/v1beta1/distribution"; +import * as _59 from "./distribution/v1beta1/genesis"; +import * as _60 from "./distribution/v1beta1/query"; +import * as _61 from "./distribution/v1beta1/tx"; +import * as _62 from "./evidence/module/v1/module"; +import * as _63 from "./evidence/v1beta1/evidence"; +import * as _64 from "./evidence/v1beta1/genesis"; +import * as _65 from "./evidence/v1beta1/query"; +import * as _66 from "./evidence/v1beta1/tx"; +import * as _67 from "./feegrant/module/v1/module"; +import * as _68 from "./feegrant/v1beta1/feegrant"; +import * as _69 from "./feegrant/v1beta1/genesis"; +import * as _70 from "./feegrant/v1beta1/query"; +import * as _71 from "./feegrant/v1beta1/tx"; +import * as _72 from "./genutil/module/v1/module"; +import * as _73 from "./genutil/v1beta1/genesis"; +import * as _74 from "./gov/module/v1/module"; +import * as _75 from "./gov/v1/genesis"; +import * as _76 from "./gov/v1/gov"; +import * as _77 from "./gov/v1/query"; +import * as _78 from "./gov/v1/tx"; +import * as _79 from "./gov/v1beta1/genesis"; +import * as _80 from "./gov/v1beta1/gov"; +import * as _81 from "./gov/v1beta1/query"; +import * as _82 from "./gov/v1beta1/tx"; +import * as _83 from "./group/module/v1/module"; +import * as _84 from "./group/v1/events"; +import * as _85 from "./group/v1/genesis"; +import * as _86 from "./group/v1/query"; +import * as _87 from "./group/v1/tx"; +import * as _88 from "./group/v1/types"; +import * as _89 from "./ics23/v1/proofs"; +import * as _90 from "./mint/module/v1/module"; +import * as _91 from "./mint/v1beta1/genesis"; +import * as _92 from "./mint/v1beta1/mint"; +import * as _93 from "./mint/v1beta1/query"; +import * as _94 from "./mint/v1beta1/tx"; +import * as _95 from "./msg/textual/v1/textual"; +import * as _96 from "./msg/v1/msg"; +import * as _97 from "./nft/module/v1/module"; +import * as _98 from "./nft/v1beta1/event"; +import * as _99 from "./nft/v1beta1/genesis"; +import * as _100 from "./nft/v1beta1/nft"; +import * as _101 from "./nft/v1beta1/query"; +import * as _102 from "./nft/v1beta1/tx"; +import * as _103 from "./orm/module/v1alpha1/module"; +import * as _104 from "./orm/query/v1alpha1/query"; +import * as _105 from "./orm/v1/orm"; +import * as _106 from "./orm/v1alpha1/schema"; +import * as _107 from "./params/module/v1/module"; +import * as _108 from "./params/v1beta1/params"; +import * as _109 from "./params/v1beta1/query"; +import * as _110 from "./query/v1/query"; +import * as _111 from "./reflection/v1/reflection"; +import * as _112 from "./slashing/module/v1/module"; +import * as _113 from "./slashing/v1beta1/genesis"; +import * as _114 from "./slashing/v1beta1/query"; +import * as _115 from "./slashing/v1beta1/slashing"; +import * as _116 from "./slashing/v1beta1/tx"; +import * as _117 from "./staking/module/v1/module"; +import * as _118 from "./staking/v1beta1/authz"; +import * as _119 from "./staking/v1beta1/genesis"; +import * as _120 from "./staking/v1beta1/query"; +import * as _121 from "./staking/v1beta1/staking"; +import * as _122 from "./staking/v1beta1/tx"; +import * as _123 from "./store/internal/kv/v1beta1/kv"; +import * as _124 from "./store/snapshots/v1/snapshot"; +import * as _125 from "./store/streaming/abci/grpc"; +import * as _126 from "./store/v1beta1/commit_info"; +import * as _127 from "./store/v1beta1/listening"; +import * as _128 from "./tx/config/v1/config"; +import * as _129 from "./tx/signing/v1beta1/signing"; +import * as _130 from "./tx/v1beta1/service"; +import * as _131 from "./tx/v1beta1/tx"; +import * as _132 from "./upgrade/module/v1/module"; +import * as _133 from "./upgrade/v1beta1/query"; +import * as _134 from "./upgrade/v1beta1/tx"; +import * as _135 from "./upgrade/v1beta1/upgrade"; +import * as _136 from "./vesting/module/v1/module"; +import * as _137 from "./vesting/v1beta1/tx"; +import * as _138 from "./vesting/v1beta1/vesting"; +import * as _220 from "./auth/v1beta1/tx.amino"; +import * as _221 from "./authz/v1beta1/tx.amino"; +import * as _222 from "./bank/v1beta1/tx.amino"; +import * as _223 from "./circuit/v1/tx.amino"; +import * as _224 from "./consensus/v1/tx.amino"; +import * as _225 from "./crisis/v1beta1/tx.amino"; +import * as _226 from "./distribution/v1beta1/tx.amino"; +import * as _227 from "./evidence/v1beta1/tx.amino"; +import * as _228 from "./feegrant/v1beta1/tx.amino"; +import * as _229 from "./gov/v1/tx.amino"; +import * as _230 from "./gov/v1beta1/tx.amino"; +import * as _231 from "./group/v1/tx.amino"; +import * as _232 from "./mint/v1beta1/tx.amino"; +import * as _233 from "./nft/v1beta1/tx.amino"; +import * as _234 from "./slashing/v1beta1/tx.amino"; +import * as _235 from "./staking/v1beta1/tx.amino"; +import * as _236 from "./upgrade/v1beta1/tx.amino"; +import * as _237 from "./vesting/v1beta1/tx.amino"; +import * as _238 from "./auth/v1beta1/tx.registry"; +import * as _239 from "./authz/v1beta1/tx.registry"; +import * as _240 from "./bank/v1beta1/tx.registry"; +import * as _241 from "./circuit/v1/tx.registry"; +import * as _242 from "./consensus/v1/tx.registry"; +import * as _243 from "./crisis/v1beta1/tx.registry"; +import * as _244 from "./distribution/v1beta1/tx.registry"; +import * as _245 from "./evidence/v1beta1/tx.registry"; +import * as _246 from "./feegrant/v1beta1/tx.registry"; +import * as _247 from "./gov/v1/tx.registry"; +import * as _248 from "./gov/v1beta1/tx.registry"; +import * as _249 from "./group/v1/tx.registry"; +import * as _250 from "./mint/v1beta1/tx.registry"; +import * as _251 from "./nft/v1beta1/tx.registry"; +import * as _252 from "./slashing/v1beta1/tx.registry"; +import * as _253 from "./staking/v1beta1/tx.registry"; +import * as _254 from "./upgrade/v1beta1/tx.registry"; +import * as _255 from "./vesting/v1beta1/tx.registry"; +import * as _256 from "./auth/v1beta1/query.lcd"; +import * as _257 from "./authz/v1beta1/query.lcd"; +import * as _258 from "./bank/v1beta1/query.lcd"; +import * as _259 from "./base/node/v1beta1/query.lcd"; +import * as _260 from "./base/tendermint/v1beta1/query.lcd"; +import * as _261 from "./circuit/v1/query.lcd"; +import * as _262 from "./consensus/v1/query.lcd"; +import * as _263 from "./distribution/v1beta1/query.lcd"; +import * as _264 from "./evidence/v1beta1/query.lcd"; +import * as _265 from "./feegrant/v1beta1/query.lcd"; +import * as _266 from "./gov/v1/query.lcd"; +import * as _267 from "./gov/v1beta1/query.lcd"; +import * as _268 from "./group/v1/query.lcd"; +import * as _269 from "./mint/v1beta1/query.lcd"; +import * as _270 from "./nft/v1beta1/query.lcd"; +import * as _271 from "./params/v1beta1/query.lcd"; +import * as _272 from "./slashing/v1beta1/query.lcd"; +import * as _273 from "./staking/v1beta1/query.lcd"; +import * as _274 from "./tx/v1beta1/service.lcd"; +import * as _275 from "./upgrade/v1beta1/query.lcd"; +import * as _276 from "./app/v1alpha1/query.rpc.Query"; +import * as _277 from "./auth/v1beta1/query.rpc.Query"; +import * as _278 from "./authz/v1beta1/query.rpc.Query"; +import * as _279 from "./autocli/v1/query.rpc.Query"; +import * as _280 from "./bank/v1beta1/query.rpc.Query"; +import * as _281 from "./base/node/v1beta1/query.rpc.Service"; +import * as _282 from "./base/tendermint/v1beta1/query.rpc.Service"; +import * as _283 from "./circuit/v1/query.rpc.Query"; +import * as _284 from "./consensus/v1/query.rpc.Query"; +import * as _285 from "./distribution/v1beta1/query.rpc.Query"; +import * as _286 from "./evidence/v1beta1/query.rpc.Query"; +import * as _287 from "./feegrant/v1beta1/query.rpc.Query"; +import * as _288 from "./gov/v1/query.rpc.Query"; +import * as _289 from "./gov/v1beta1/query.rpc.Query"; +import * as _290 from "./group/v1/query.rpc.Query"; +import * as _291 from "./mint/v1beta1/query.rpc.Query"; +import * as _292 from "./nft/v1beta1/query.rpc.Query"; +import * as _293 from "./orm/query/v1alpha1/query.rpc.Query"; +import * as _294 from "./params/v1beta1/query.rpc.Query"; +import * as _295 from "./slashing/v1beta1/query.rpc.Query"; +import * as _296 from "./staking/v1beta1/query.rpc.Query"; +import * as _297 from "./tx/v1beta1/service.rpc.Service"; +import * as _298 from "./upgrade/v1beta1/query.rpc.Query"; +import * as _299 from "./auth/v1beta1/tx.rpc.msg"; +import * as _300 from "./authz/v1beta1/tx.rpc.msg"; +import * as _301 from "./bank/v1beta1/tx.rpc.msg"; +import * as _302 from "./circuit/v1/tx.rpc.msg"; +import * as _303 from "./consensus/v1/tx.rpc.msg"; +import * as _304 from "./crisis/v1beta1/tx.rpc.msg"; +import * as _305 from "./distribution/v1beta1/tx.rpc.msg"; +import * as _306 from "./evidence/v1beta1/tx.rpc.msg"; +import * as _307 from "./feegrant/v1beta1/tx.rpc.msg"; +import * as _308 from "./gov/v1/tx.rpc.msg"; +import * as _309 from "./gov/v1beta1/tx.rpc.msg"; +import * as _310 from "./group/v1/tx.rpc.msg"; +import * as _311 from "./mint/v1beta1/tx.rpc.msg"; +import * as _312 from "./nft/v1beta1/tx.rpc.msg"; +import * as _313 from "./slashing/v1beta1/tx.rpc.msg"; +import * as _314 from "./staking/v1beta1/tx.rpc.msg"; +import * as _315 from "./upgrade/v1beta1/tx.rpc.msg"; +import * as _316 from "./vesting/v1beta1/tx.rpc.msg"; +import * as _367 from "./lcd"; +import * as _368 from "./rpc.query"; +import * as _369 from "./rpc.tx"; export namespace cosmos { - export namespace auth { - export const v1beta1 = { - ..._3, - ..._4, + export namespace app { + export namespace runtime { + export const v1alpha1 = { + ..._4 + }; + } + export const v1alpha1 = { ..._5, - ..._157, - ..._172 + ..._6, + ..._7, + ..._276 }; } - export namespace authz { + export namespace auth { + export namespace module { + export const v1 = { + ..._8 + }; + } export const v1beta1 = { - ..._6, - ..._7, - ..._8, ..._9, ..._10, - ..._137, - ..._147, - ..._158, - ..._173, - ..._187 + ..._11, + ..._12, + ..._220, + ..._238, + ..._256, + ..._277, + ..._299 }; } - export namespace bank { + export namespace authz { + export namespace module { + export const v1 = { + ..._13 + }; + } export const v1beta1 = { - ..._11, - ..._12, - ..._13, ..._14, ..._15, - ..._138, - ..._148, - ..._159, - ..._174, - ..._188 + ..._16, + ..._17, + ..._18, + ..._221, + ..._239, + ..._257, + ..._278, + ..._300 + }; + } + export namespace autocli { + export const v1 = { + ..._19, + ..._20, + ..._279 + }; + } + export namespace bank { + export namespace module { + export const v1 = { + ..._21 + }; + } + export const v1beta1 = { + ..._22, + ..._23, + ..._24, + ..._25, + ..._26, + ..._222, + ..._240, + ..._258, + ..._280, + ..._301 }; } export namespace base { export namespace abci { export const v1beta1 = { - ..._16 + ..._27 }; } export namespace kv { export const v1beta1 = { - ..._17 + ..._28 }; } export namespace node { export const v1beta1 = { - ..._18, - ..._160, - ..._175 + ..._29, + ..._259, + ..._281 }; } export namespace query { export const v1beta1 = { - ..._19 + ..._30 }; } export namespace reflection { export const v1beta1 = { - ..._20 + ..._31 }; export const v2alpha1 = { - ..._21 + ..._32 }; } export namespace snapshots { export const v1beta1 = { - ..._22 + ..._33 }; } export namespace store { export const v1beta1 = { - ..._23, - ..._24 + ..._34, + ..._35 }; } export namespace tendermint { export const v1beta1 = { - ..._25, - ..._161, - ..._176 + ..._36, + ..._37, + ..._260, + ..._282 }; } export const v1beta1 = { - ..._26 + ..._38 }; } export namespace capability { export const v1beta1 = { - ..._27, - ..._28 + ..._39, + ..._40 + }; + } + export namespace circuit { + export namespace module { + export const v1 = { + ..._41 + }; + } + export const v1 = { + ..._42, + ..._43, + ..._44, + ..._223, + ..._241, + ..._261, + ..._283, + ..._302 + }; + } + export namespace consensus { + export namespace module { + export const v1 = { + ..._45 + }; + } + export const v1 = { + ..._46, + ..._47, + ..._224, + ..._242, + ..._262, + ..._284, + ..._303 }; } export namespace crisis { + export namespace module { + export const v1 = { + ..._48 + }; + } export const v1beta1 = { - ..._29, - ..._30, - ..._139, - ..._149, - ..._189 + ..._49, + ..._50, + ..._225, + ..._243, + ..._304 }; } export namespace crypto { export const ed25519 = { - ..._31 + ..._51 }; + export namespace hd { + export const v1 = { + ..._52 + }; + } + export namespace keyring { + export const v1 = { + ..._53 + }; + } export const multisig = { - ..._32 + ..._54 }; export const secp256k1 = { - ..._33 + ..._55 }; export const secp256r1 = { - ..._34 + ..._56 }; } export namespace distribution { + export namespace module { + export const v1 = { + ..._57 + }; + } export const v1beta1 = { - ..._35, - ..._36, - ..._37, - ..._38, - ..._140, - ..._150, - ..._162, - ..._177, - ..._190 + ..._58, + ..._59, + ..._60, + ..._61, + ..._226, + ..._244, + ..._263, + ..._285, + ..._305 }; } export namespace evidence { + export namespace module { + export const v1 = { + ..._62 + }; + } export const v1beta1 = { - ..._39, - ..._40, - ..._41, - ..._42, - ..._141, - ..._151, - ..._163, - ..._178, - ..._191 + ..._63, + ..._64, + ..._65, + ..._66, + ..._227, + ..._245, + ..._264, + ..._286, + ..._306 }; } export namespace feegrant { + export namespace module { + export const v1 = { + ..._67 + }; + } export const v1beta1 = { - ..._43, - ..._44, - ..._45, - ..._46, - ..._142, - ..._152, - ..._164, - ..._179, - ..._192 + ..._68, + ..._69, + ..._70, + ..._71, + ..._228, + ..._246, + ..._265, + ..._287, + ..._307 }; } export namespace genutil { + export namespace module { + export const v1 = { + ..._72 + }; + } export const v1beta1 = { - ..._47 + ..._73 }; } export namespace gov { + export namespace module { + export const v1 = { + ..._74 + }; + } + export const v1 = { + ..._75, + ..._76, + ..._77, + ..._78, + ..._229, + ..._247, + ..._266, + ..._288, + ..._308 + }; export const v1beta1 = { - ..._48, - ..._49, - ..._50, - ..._51, - ..._143, - ..._153, - ..._165, - ..._180, - ..._193 + ..._79, + ..._80, + ..._81, + ..._82, + ..._230, + ..._248, + ..._267, + ..._289, + ..._309 + }; + } + export namespace group { + export namespace module { + export const v1 = { + ..._83 + }; + } + export const v1 = { + ..._84, + ..._85, + ..._86, + ..._87, + ..._88, + ..._231, + ..._249, + ..._268, + ..._290, + ..._310 + }; + } + export namespace ics23 { + export const v1 = { + ..._89 }; } export namespace mint { + export namespace module { + export const v1 = { + ..._90 + }; + } + export const v1beta1 = { + ..._91, + ..._92, + ..._93, + ..._94, + ..._232, + ..._250, + ..._269, + ..._291, + ..._311 + }; + } + export namespace msg { + export namespace textual { + export const v1 = { + ..._95 + }; + } + export const v1 = { + ..._96 + }; + } + export namespace nft { + export namespace module { + export const v1 = { + ..._97 + }; + } export const v1beta1 = { - ..._52, - ..._53, - ..._54, - ..._166, - ..._181 + ..._98, + ..._99, + ..._100, + ..._101, + ..._102, + ..._233, + ..._251, + ..._270, + ..._292, + ..._312 + }; + } + export namespace orm { + export namespace module { + export const v1alpha1 = { + ..._103 + }; + } + export namespace query { + export const v1alpha1 = { + ..._104, + ..._293 + }; + } + export const v1 = { + ..._105 + }; + export const v1alpha1 = { + ..._106 }; } export namespace params { + export namespace module { + export const v1 = { + ..._107 + }; + } export const v1beta1 = { - ..._55, - ..._56, - ..._167, - ..._182 + ..._108, + ..._109, + ..._271, + ..._294 + }; + } + export namespace query { + export const v1 = { + ..._110 + }; + } + export namespace reflection { + export const v1 = { + ..._111 }; } export namespace slashing { + export namespace module { + export const v1 = { + ..._112 + }; + } export const v1beta1 = { - ..._57, - ..._58, - ..._59, - ..._60, - ..._144, - ..._154, - ..._168, - ..._183, - ..._194 + ..._113, + ..._114, + ..._115, + ..._116, + ..._234, + ..._252, + ..._272, + ..._295, + ..._313 }; } export namespace staking { + export namespace module { + export const v1 = { + ..._117 + }; + } export const v1beta1 = { - ..._61, - ..._62, - ..._63, - ..._64, - ..._65, - ..._145, - ..._155, - ..._169, - ..._184, - ..._195 + ..._118, + ..._119, + ..._120, + ..._121, + ..._122, + ..._235, + ..._253, + ..._273, + ..._296, + ..._314 + }; + } + export namespace store { + export namespace internal { + export namespace kv { + export const v1beta1 = { + ..._123 + }; + } + } + export namespace snapshots { + export const v1 = { + ..._124 + }; + } + export namespace streaming { + export const abci = { + ..._125 + }; + } + export const v1beta1 = { + ..._126, + ..._127 }; } export namespace tx { + export namespace config { + export const v1 = { + ..._128 + }; + } export namespace signing { export const v1beta1 = { - ..._66 + ..._129 }; } export const v1beta1 = { - ..._67, - ..._68, - ..._170, - ..._185 + ..._130, + ..._131, + ..._274, + ..._297 }; } export namespace upgrade { + export namespace module { + export const v1 = { + ..._132 + }; + } export const v1beta1 = { - ..._69, - ..._70, - ..._171, - ..._186 + ..._133, + ..._134, + ..._135, + ..._236, + ..._254, + ..._275, + ..._298, + ..._315 }; } export namespace vesting { + export namespace module { + export const v1 = { + ..._136 + }; + } export const v1beta1 = { - ..._71, - ..._72, - ..._146, - ..._156, - ..._196 + ..._137, + ..._138, + ..._237, + ..._255, + ..._316 }; } export const ClientFactory = { - ..._231, - ..._232, - ..._233 + ..._367, + ..._368, + ..._369 }; } \ No newline at end of file diff --git a/src/codegen/cosmos/circuit/v1/query.lcd.ts b/src/codegen/cosmos/circuit/v1/query.lcd.ts new file mode 100644 index 0000000..894cbe0 --- /dev/null +++ b/src/codegen/cosmos/circuit/v1/query.lcd.ts @@ -0,0 +1,39 @@ +import { setPaginationParams } from "../../../helpers"; +import { LCDClient } from "@cosmology/lcd"; +import { QueryAccountRequest, AccountResponseSDKType, QueryAccountsRequest, AccountsResponseSDKType, QueryDisabledListRequest, DisabledListResponseSDKType } from "./query"; +export class LCDQueryClient { + req: LCDClient; + constructor({ + requestClient + }: { + requestClient: LCDClient; + }) { + this.req = requestClient; + this.account = this.account.bind(this); + this.accounts = this.accounts.bind(this); + this.disabledList = this.disabledList.bind(this); + } + /* Account returns account permissions. */ + async account(params: QueryAccountRequest): Promise { + const endpoint = `cosmos/circuit/v1/accounts/${params.address}`; + return await this.req.get(endpoint); + } + /* Account returns account permissions. */ + async accounts(params: QueryAccountsRequest = { + pagination: undefined + }): Promise { + const options: any = { + params: {} + }; + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + const endpoint = `cosmos/circuit/v1/accounts`; + return await this.req.get(endpoint, options); + } + /* DisabledList returns a list of disabled message urls */ + async disabledList(_params: QueryDisabledListRequest = {}): Promise { + const endpoint = `cosmos/circuit/v1/disable_list`; + return await this.req.get(endpoint); + } +} \ No newline at end of file diff --git a/src/codegen/cosmos/circuit/v1/query.rpc.Query.ts b/src/codegen/cosmos/circuit/v1/query.rpc.Query.ts new file mode 100644 index 0000000..0024903 --- /dev/null +++ b/src/codegen/cosmos/circuit/v1/query.rpc.Query.ts @@ -0,0 +1,54 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryAccountRequest, AccountResponse, QueryAccountsRequest, AccountsResponse, QueryDisabledListRequest, DisabledListResponse } from "./query"; +/** Query defines the circuit gRPC querier service. */ +export interface Query { + /** Account returns account permissions. */ + account(request: QueryAccountRequest): Promise; + /** Account returns account permissions. */ + accounts(request?: QueryAccountsRequest): Promise; + /** DisabledList returns a list of disabled message urls */ + disabledList(request?: QueryDisabledListRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.account = this.account.bind(this); + this.accounts = this.accounts.bind(this); + this.disabledList = this.disabledList.bind(this); + } + account(request: QueryAccountRequest): Promise { + const data = QueryAccountRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.circuit.v1.Query", "Account", data); + return promise.then(data => AccountResponse.decode(new BinaryReader(data))); + } + accounts(request: QueryAccountsRequest = { + pagination: undefined + }): Promise { + const data = QueryAccountsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.circuit.v1.Query", "Accounts", data); + return promise.then(data => AccountsResponse.decode(new BinaryReader(data))); + } + disabledList(request: QueryDisabledListRequest = {}): Promise { + const data = QueryDisabledListRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.circuit.v1.Query", "DisabledList", data); + return promise.then(data => DisabledListResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + account(request: QueryAccountRequest): Promise { + return queryService.account(request); + }, + accounts(request?: QueryAccountsRequest): Promise { + return queryService.accounts(request); + }, + disabledList(request?: QueryDisabledListRequest): Promise { + return queryService.disabledList(request); + } + }; +}; \ No newline at end of file diff --git a/src/codegen/cosmos/circuit/v1/query.ts b/src/codegen/cosmos/circuit/v1/query.ts new file mode 100644 index 0000000..5e20984 --- /dev/null +++ b/src/codegen/cosmos/circuit/v1/query.ts @@ -0,0 +1,541 @@ +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; +import { Permissions, PermissionsAmino, PermissionsSDKType, GenesisAccountPermissions, GenesisAccountPermissionsAmino, GenesisAccountPermissionsSDKType } from "./types"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** QueryAccountRequest is the request type for the Query/Account RPC method. */ +export interface QueryAccountRequest { + address: string; +} +export interface QueryAccountRequestProtoMsg { + typeUrl: "/cosmos.circuit.v1.QueryAccountRequest"; + value: Uint8Array; +} +/** QueryAccountRequest is the request type for the Query/Account RPC method. */ +export interface QueryAccountRequestAmino { + address?: string; +} +export interface QueryAccountRequestAminoMsg { + type: "cosmos-sdk/QueryAccountRequest"; + value: QueryAccountRequestAmino; +} +/** QueryAccountRequest is the request type for the Query/Account RPC method. */ +export interface QueryAccountRequestSDKType { + address: string; +} +/** AccountResponse is the response type for the Query/Account RPC method. */ +export interface AccountResponse { + permission?: Permissions; +} +export interface AccountResponseProtoMsg { + typeUrl: "/cosmos.circuit.v1.AccountResponse"; + value: Uint8Array; +} +/** AccountResponse is the response type for the Query/Account RPC method. */ +export interface AccountResponseAmino { + permission?: PermissionsAmino; +} +export interface AccountResponseAminoMsg { + type: "cosmos-sdk/AccountResponse"; + value: AccountResponseAmino; +} +/** AccountResponse is the response type for the Query/Account RPC method. */ +export interface AccountResponseSDKType { + permission?: PermissionsSDKType; +} +/** QueryAccountsRequest is the request type for the Query/Accounts RPC method. */ +export interface QueryAccountsRequest { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryAccountsRequestProtoMsg { + typeUrl: "/cosmos.circuit.v1.QueryAccountsRequest"; + value: Uint8Array; +} +/** QueryAccountsRequest is the request type for the Query/Accounts RPC method. */ +export interface QueryAccountsRequestAmino { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryAccountsRequestAminoMsg { + type: "cosmos-sdk/QueryAccountsRequest"; + value: QueryAccountsRequestAmino; +} +/** QueryAccountsRequest is the request type for the Query/Accounts RPC method. */ +export interface QueryAccountsRequestSDKType { + pagination?: PageRequestSDKType; +} +/** AccountsResponse is the response type for the Query/Accounts RPC method. */ +export interface AccountsResponse { + accounts: GenesisAccountPermissions[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface AccountsResponseProtoMsg { + typeUrl: "/cosmos.circuit.v1.AccountsResponse"; + value: Uint8Array; +} +/** AccountsResponse is the response type for the Query/Accounts RPC method. */ +export interface AccountsResponseAmino { + accounts?: GenesisAccountPermissionsAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface AccountsResponseAminoMsg { + type: "cosmos-sdk/AccountsResponse"; + value: AccountsResponseAmino; +} +/** AccountsResponse is the response type for the Query/Accounts RPC method. */ +export interface AccountsResponseSDKType { + accounts: GenesisAccountPermissionsSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryDisableListRequest is the request type for the Query/DisabledList RPC method. */ +export interface QueryDisabledListRequest {} +export interface QueryDisabledListRequestProtoMsg { + typeUrl: "/cosmos.circuit.v1.QueryDisabledListRequest"; + value: Uint8Array; +} +/** QueryDisableListRequest is the request type for the Query/DisabledList RPC method. */ +export interface QueryDisabledListRequestAmino {} +export interface QueryDisabledListRequestAminoMsg { + type: "cosmos-sdk/QueryDisabledListRequest"; + value: QueryDisabledListRequestAmino; +} +/** QueryDisableListRequest is the request type for the Query/DisabledList RPC method. */ +export interface QueryDisabledListRequestSDKType {} +/** DisabledListResponse is the response type for the Query/DisabledList RPC method. */ +export interface DisabledListResponse { + disabledList: string[]; +} +export interface DisabledListResponseProtoMsg { + typeUrl: "/cosmos.circuit.v1.DisabledListResponse"; + value: Uint8Array; +} +/** DisabledListResponse is the response type for the Query/DisabledList RPC method. */ +export interface DisabledListResponseAmino { + disabled_list?: string[]; +} +export interface DisabledListResponseAminoMsg { + type: "cosmos-sdk/DisabledListResponse"; + value: DisabledListResponseAmino; +} +/** DisabledListResponse is the response type for the Query/DisabledList RPC method. */ +export interface DisabledListResponseSDKType { + disabled_list: string[]; +} +function createBaseQueryAccountRequest(): QueryAccountRequest { + return { + address: "" + }; +} +export const QueryAccountRequest = { + typeUrl: "/cosmos.circuit.v1.QueryAccountRequest", + encode(message: QueryAccountRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAccountRequest { + const message = createBaseQueryAccountRequest(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryAccountRequestAmino): QueryAccountRequest { + const message = createBaseQueryAccountRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryAccountRequest): QueryAccountRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: QueryAccountRequestAminoMsg): QueryAccountRequest { + return QueryAccountRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAccountRequest): QueryAccountRequestAminoMsg { + return { + type: "cosmos-sdk/QueryAccountRequest", + value: QueryAccountRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAccountRequestProtoMsg): QueryAccountRequest { + return QueryAccountRequest.decode(message.value); + }, + toProto(message: QueryAccountRequest): Uint8Array { + return QueryAccountRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountRequest): QueryAccountRequestProtoMsg { + return { + typeUrl: "/cosmos.circuit.v1.QueryAccountRequest", + value: QueryAccountRequest.encode(message).finish() + }; + } +}; +function createBaseAccountResponse(): AccountResponse { + return { + permission: undefined + }; +} +export const AccountResponse = { + typeUrl: "/cosmos.circuit.v1.AccountResponse", + encode(message: AccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.permission !== undefined) { + Permissions.encode(message.permission, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AccountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.permission = Permissions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AccountResponse { + const message = createBaseAccountResponse(); + message.permission = object.permission !== undefined && object.permission !== null ? Permissions.fromPartial(object.permission) : undefined; + return message; + }, + fromAmino(object: AccountResponseAmino): AccountResponse { + const message = createBaseAccountResponse(); + if (object.permission !== undefined && object.permission !== null) { + message.permission = Permissions.fromAmino(object.permission); + } + return message; + }, + toAmino(message: AccountResponse): AccountResponseAmino { + const obj: any = {}; + obj.permission = message.permission ? Permissions.toAmino(message.permission) : undefined; + return obj; + }, + fromAminoMsg(object: AccountResponseAminoMsg): AccountResponse { + return AccountResponse.fromAmino(object.value); + }, + toAminoMsg(message: AccountResponse): AccountResponseAminoMsg { + return { + type: "cosmos-sdk/AccountResponse", + value: AccountResponse.toAmino(message) + }; + }, + fromProtoMsg(message: AccountResponseProtoMsg): AccountResponse { + return AccountResponse.decode(message.value); + }, + toProto(message: AccountResponse): Uint8Array { + return AccountResponse.encode(message).finish(); + }, + toProtoMsg(message: AccountResponse): AccountResponseProtoMsg { + return { + typeUrl: "/cosmos.circuit.v1.AccountResponse", + value: AccountResponse.encode(message).finish() + }; + } +}; +function createBaseQueryAccountsRequest(): QueryAccountsRequest { + return { + pagination: undefined + }; +} +export const QueryAccountsRequest = { + typeUrl: "/cosmos.circuit.v1.QueryAccountsRequest", + encode(message: QueryAccountsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAccountsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAccountsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAccountsRequest { + const message = createBaseQueryAccountsRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryAccountsRequestAmino): QueryAccountsRequest { + const message = createBaseQueryAccountsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryAccountsRequest): QueryAccountsRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAccountsRequestAminoMsg): QueryAccountsRequest { + return QueryAccountsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAccountsRequest): QueryAccountsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryAccountsRequest", + value: QueryAccountsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAccountsRequestProtoMsg): QueryAccountsRequest { + return QueryAccountsRequest.decode(message.value); + }, + toProto(message: QueryAccountsRequest): Uint8Array { + return QueryAccountsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAccountsRequest): QueryAccountsRequestProtoMsg { + return { + typeUrl: "/cosmos.circuit.v1.QueryAccountsRequest", + value: QueryAccountsRequest.encode(message).finish() + }; + } +}; +function createBaseAccountsResponse(): AccountsResponse { + return { + accounts: [], + pagination: undefined + }; +} +export const AccountsResponse = { + typeUrl: "/cosmos.circuit.v1.AccountsResponse", + encode(message: AccountsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.accounts) { + GenesisAccountPermissions.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AccountsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accounts.push(GenesisAccountPermissions.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AccountsResponse { + const message = createBaseAccountsResponse(); + message.accounts = object.accounts?.map(e => GenesisAccountPermissions.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: AccountsResponseAmino): AccountsResponse { + const message = createBaseAccountsResponse(); + message.accounts = object.accounts?.map(e => GenesisAccountPermissions.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: AccountsResponse): AccountsResponseAmino { + const obj: any = {}; + if (message.accounts) { + obj.accounts = message.accounts.map(e => e ? GenesisAccountPermissions.toAmino(e) : undefined); + } else { + obj.accounts = message.accounts; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: AccountsResponseAminoMsg): AccountsResponse { + return AccountsResponse.fromAmino(object.value); + }, + toAminoMsg(message: AccountsResponse): AccountsResponseAminoMsg { + return { + type: "cosmos-sdk/AccountsResponse", + value: AccountsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: AccountsResponseProtoMsg): AccountsResponse { + return AccountsResponse.decode(message.value); + }, + toProto(message: AccountsResponse): Uint8Array { + return AccountsResponse.encode(message).finish(); + }, + toProtoMsg(message: AccountsResponse): AccountsResponseProtoMsg { + return { + typeUrl: "/cosmos.circuit.v1.AccountsResponse", + value: AccountsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryDisabledListRequest(): QueryDisabledListRequest { + return {}; +} +export const QueryDisabledListRequest = { + typeUrl: "/cosmos.circuit.v1.QueryDisabledListRequest", + encode(_: QueryDisabledListRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDisabledListRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDisabledListRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryDisabledListRequest { + const message = createBaseQueryDisabledListRequest(); + return message; + }, + fromAmino(_: QueryDisabledListRequestAmino): QueryDisabledListRequest { + const message = createBaseQueryDisabledListRequest(); + return message; + }, + toAmino(_: QueryDisabledListRequest): QueryDisabledListRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryDisabledListRequestAminoMsg): QueryDisabledListRequest { + return QueryDisabledListRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDisabledListRequest): QueryDisabledListRequestAminoMsg { + return { + type: "cosmos-sdk/QueryDisabledListRequest", + value: QueryDisabledListRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDisabledListRequestProtoMsg): QueryDisabledListRequest { + return QueryDisabledListRequest.decode(message.value); + }, + toProto(message: QueryDisabledListRequest): Uint8Array { + return QueryDisabledListRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDisabledListRequest): QueryDisabledListRequestProtoMsg { + return { + typeUrl: "/cosmos.circuit.v1.QueryDisabledListRequest", + value: QueryDisabledListRequest.encode(message).finish() + }; + } +}; +function createBaseDisabledListResponse(): DisabledListResponse { + return { + disabledList: [] + }; +} +export const DisabledListResponse = { + typeUrl: "/cosmos.circuit.v1.DisabledListResponse", + encode(message: DisabledListResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.disabledList) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DisabledListResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDisabledListResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.disabledList.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DisabledListResponse { + const message = createBaseDisabledListResponse(); + message.disabledList = object.disabledList?.map(e => e) || []; + return message; + }, + fromAmino(object: DisabledListResponseAmino): DisabledListResponse { + const message = createBaseDisabledListResponse(); + message.disabledList = object.disabled_list?.map(e => e) || []; + return message; + }, + toAmino(message: DisabledListResponse): DisabledListResponseAmino { + const obj: any = {}; + if (message.disabledList) { + obj.disabled_list = message.disabledList.map(e => e); + } else { + obj.disabled_list = message.disabledList; + } + return obj; + }, + fromAminoMsg(object: DisabledListResponseAminoMsg): DisabledListResponse { + return DisabledListResponse.fromAmino(object.value); + }, + toAminoMsg(message: DisabledListResponse): DisabledListResponseAminoMsg { + return { + type: "cosmos-sdk/DisabledListResponse", + value: DisabledListResponse.toAmino(message) + }; + }, + fromProtoMsg(message: DisabledListResponseProtoMsg): DisabledListResponse { + return DisabledListResponse.decode(message.value); + }, + toProto(message: DisabledListResponse): Uint8Array { + return DisabledListResponse.encode(message).finish(); + }, + toProtoMsg(message: DisabledListResponse): DisabledListResponseProtoMsg { + return { + typeUrl: "/cosmos.circuit.v1.DisabledListResponse", + value: DisabledListResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/circuit/v1/tx.amino.ts b/src/codegen/cosmos/circuit/v1/tx.amino.ts new file mode 100644 index 0000000..9204d44 --- /dev/null +++ b/src/codegen/cosmos/circuit/v1/tx.amino.ts @@ -0,0 +1,18 @@ +import { MsgAuthorizeCircuitBreaker, MsgTripCircuitBreaker, MsgResetCircuitBreaker } from "./tx"; +export const AminoConverter = { + "/cosmos.circuit.v1.MsgAuthorizeCircuitBreaker": { + aminoType: "cosmos-sdk/MsgAuthorizeCircuitBreaker", + toAmino: MsgAuthorizeCircuitBreaker.toAmino, + fromAmino: MsgAuthorizeCircuitBreaker.fromAmino + }, + "/cosmos.circuit.v1.MsgTripCircuitBreaker": { + aminoType: "cosmos-sdk/MsgTripCircuitBreaker", + toAmino: MsgTripCircuitBreaker.toAmino, + fromAmino: MsgTripCircuitBreaker.fromAmino + }, + "/cosmos.circuit.v1.MsgResetCircuitBreaker": { + aminoType: "cosmos-sdk/MsgResetCircuitBreaker", + toAmino: MsgResetCircuitBreaker.toAmino, + fromAmino: MsgResetCircuitBreaker.fromAmino + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/circuit/v1/tx.registry.ts b/src/codegen/cosmos/circuit/v1/tx.registry.ts new file mode 100644 index 0000000..402f292 --- /dev/null +++ b/src/codegen/cosmos/circuit/v1/tx.registry.ts @@ -0,0 +1,70 @@ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgAuthorizeCircuitBreaker, MsgTripCircuitBreaker, MsgResetCircuitBreaker } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.circuit.v1.MsgAuthorizeCircuitBreaker", MsgAuthorizeCircuitBreaker], ["/cosmos.circuit.v1.MsgTripCircuitBreaker", MsgTripCircuitBreaker], ["/cosmos.circuit.v1.MsgResetCircuitBreaker", MsgResetCircuitBreaker]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + authorizeCircuitBreaker(value: MsgAuthorizeCircuitBreaker) { + return { + typeUrl: "/cosmos.circuit.v1.MsgAuthorizeCircuitBreaker", + value: MsgAuthorizeCircuitBreaker.encode(value).finish() + }; + }, + tripCircuitBreaker(value: MsgTripCircuitBreaker) { + return { + typeUrl: "/cosmos.circuit.v1.MsgTripCircuitBreaker", + value: MsgTripCircuitBreaker.encode(value).finish() + }; + }, + resetCircuitBreaker(value: MsgResetCircuitBreaker) { + return { + typeUrl: "/cosmos.circuit.v1.MsgResetCircuitBreaker", + value: MsgResetCircuitBreaker.encode(value).finish() + }; + } + }, + withTypeUrl: { + authorizeCircuitBreaker(value: MsgAuthorizeCircuitBreaker) { + return { + typeUrl: "/cosmos.circuit.v1.MsgAuthorizeCircuitBreaker", + value + }; + }, + tripCircuitBreaker(value: MsgTripCircuitBreaker) { + return { + typeUrl: "/cosmos.circuit.v1.MsgTripCircuitBreaker", + value + }; + }, + resetCircuitBreaker(value: MsgResetCircuitBreaker) { + return { + typeUrl: "/cosmos.circuit.v1.MsgResetCircuitBreaker", + value + }; + } + }, + fromPartial: { + authorizeCircuitBreaker(value: MsgAuthorizeCircuitBreaker) { + return { + typeUrl: "/cosmos.circuit.v1.MsgAuthorizeCircuitBreaker", + value: MsgAuthorizeCircuitBreaker.fromPartial(value) + }; + }, + tripCircuitBreaker(value: MsgTripCircuitBreaker) { + return { + typeUrl: "/cosmos.circuit.v1.MsgTripCircuitBreaker", + value: MsgTripCircuitBreaker.fromPartial(value) + }; + }, + resetCircuitBreaker(value: MsgResetCircuitBreaker) { + return { + typeUrl: "/cosmos.circuit.v1.MsgResetCircuitBreaker", + value: MsgResetCircuitBreaker.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/circuit/v1/tx.rpc.msg.ts b/src/codegen/cosmos/circuit/v1/tx.rpc.msg.ts new file mode 100644 index 0000000..dc980c1 --- /dev/null +++ b/src/codegen/cosmos/circuit/v1/tx.rpc.msg.ts @@ -0,0 +1,42 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgAuthorizeCircuitBreaker, MsgAuthorizeCircuitBreakerResponse, MsgTripCircuitBreaker, MsgTripCircuitBreakerResponse, MsgResetCircuitBreaker, MsgResetCircuitBreakerResponse } from "./tx"; +/** Msg defines the circuit Msg service. */ +export interface Msg { + /** + * AuthorizeCircuitBreaker allows a super-admin to grant (or revoke) another + * account's circuit breaker permissions. + */ + authorizeCircuitBreaker(request: MsgAuthorizeCircuitBreaker): Promise; + /** TripCircuitBreaker pauses processing of Msg's in the state machine. */ + tripCircuitBreaker(request: MsgTripCircuitBreaker): Promise; + /** + * ResetCircuitBreaker resumes processing of Msg's in the state machine that + * have been been paused using TripCircuitBreaker. + */ + resetCircuitBreaker(request: MsgResetCircuitBreaker): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.authorizeCircuitBreaker = this.authorizeCircuitBreaker.bind(this); + this.tripCircuitBreaker = this.tripCircuitBreaker.bind(this); + this.resetCircuitBreaker = this.resetCircuitBreaker.bind(this); + } + authorizeCircuitBreaker(request: MsgAuthorizeCircuitBreaker): Promise { + const data = MsgAuthorizeCircuitBreaker.encode(request).finish(); + const promise = this.rpc.request("cosmos.circuit.v1.Msg", "AuthorizeCircuitBreaker", data); + return promise.then(data => MsgAuthorizeCircuitBreakerResponse.decode(new BinaryReader(data))); + } + tripCircuitBreaker(request: MsgTripCircuitBreaker): Promise { + const data = MsgTripCircuitBreaker.encode(request).finish(); + const promise = this.rpc.request("cosmos.circuit.v1.Msg", "TripCircuitBreaker", data); + return promise.then(data => MsgTripCircuitBreakerResponse.decode(new BinaryReader(data))); + } + resetCircuitBreaker(request: MsgResetCircuitBreaker): Promise { + const data = MsgResetCircuitBreaker.encode(request).finish(); + const promise = this.rpc.request("cosmos.circuit.v1.Msg", "ResetCircuitBreaker", data); + return promise.then(data => MsgResetCircuitBreakerResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/src/codegen/cosmos/circuit/v1/tx.ts b/src/codegen/cosmos/circuit/v1/tx.ts new file mode 100644 index 0000000..ffc9ad1 --- /dev/null +++ b/src/codegen/cosmos/circuit/v1/tx.ts @@ -0,0 +1,648 @@ +import { Permissions, PermissionsAmino, PermissionsSDKType } from "./types"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** MsgAuthorizeCircuitBreaker defines the Msg/AuthorizeCircuitBreaker request type. */ +export interface MsgAuthorizeCircuitBreaker { + /** + * granter is the granter of the circuit breaker permissions and must have + * LEVEL_SUPER_ADMIN. + */ + granter: string; + /** grantee is the account authorized with the provided permissions. */ + grantee: string; + /** + * permissions are the circuit breaker permissions that the grantee receives. + * These will overwrite any existing permissions. LEVEL_NONE_UNSPECIFIED can + * be specified to revoke all permissions. + */ + permissions?: Permissions; +} +export interface MsgAuthorizeCircuitBreakerProtoMsg { + typeUrl: "/cosmos.circuit.v1.MsgAuthorizeCircuitBreaker"; + value: Uint8Array; +} +/** MsgAuthorizeCircuitBreaker defines the Msg/AuthorizeCircuitBreaker request type. */ +export interface MsgAuthorizeCircuitBreakerAmino { + /** + * granter is the granter of the circuit breaker permissions and must have + * LEVEL_SUPER_ADMIN. + */ + granter?: string; + /** grantee is the account authorized with the provided permissions. */ + grantee?: string; + /** + * permissions are the circuit breaker permissions that the grantee receives. + * These will overwrite any existing permissions. LEVEL_NONE_UNSPECIFIED can + * be specified to revoke all permissions. + */ + permissions?: PermissionsAmino; +} +export interface MsgAuthorizeCircuitBreakerAminoMsg { + type: "cosmos-sdk/MsgAuthorizeCircuitBreaker"; + value: MsgAuthorizeCircuitBreakerAmino; +} +/** MsgAuthorizeCircuitBreaker defines the Msg/AuthorizeCircuitBreaker request type. */ +export interface MsgAuthorizeCircuitBreakerSDKType { + granter: string; + grantee: string; + permissions?: PermissionsSDKType; +} +/** MsgAuthorizeCircuitBreakerResponse defines the Msg/AuthorizeCircuitBreaker response type. */ +export interface MsgAuthorizeCircuitBreakerResponse { + success: boolean; +} +export interface MsgAuthorizeCircuitBreakerResponseProtoMsg { + typeUrl: "/cosmos.circuit.v1.MsgAuthorizeCircuitBreakerResponse"; + value: Uint8Array; +} +/** MsgAuthorizeCircuitBreakerResponse defines the Msg/AuthorizeCircuitBreaker response type. */ +export interface MsgAuthorizeCircuitBreakerResponseAmino { + success?: boolean; +} +export interface MsgAuthorizeCircuitBreakerResponseAminoMsg { + type: "cosmos-sdk/MsgAuthorizeCircuitBreakerResponse"; + value: MsgAuthorizeCircuitBreakerResponseAmino; +} +/** MsgAuthorizeCircuitBreakerResponse defines the Msg/AuthorizeCircuitBreaker response type. */ +export interface MsgAuthorizeCircuitBreakerResponseSDKType { + success: boolean; +} +/** MsgTripCircuitBreaker defines the Msg/TripCircuitBreaker request type. */ +export interface MsgTripCircuitBreaker { + /** authority is the account authorized to trip the circuit breaker. */ + authority: string; + /** + * msg_type_urls specifies a list of type URLs to immediately stop processing. + * IF IT IS LEFT EMPTY, ALL MSG PROCESSING WILL STOP IMMEDIATELY. + * This value is validated against the authority's permissions and if the + * authority does not have permissions to trip the specified msg type URLs + * (or all URLs), the operation will fail. + */ + msgTypeUrls: string[]; +} +export interface MsgTripCircuitBreakerProtoMsg { + typeUrl: "/cosmos.circuit.v1.MsgTripCircuitBreaker"; + value: Uint8Array; +} +/** MsgTripCircuitBreaker defines the Msg/TripCircuitBreaker request type. */ +export interface MsgTripCircuitBreakerAmino { + /** authority is the account authorized to trip the circuit breaker. */ + authority?: string; + /** + * msg_type_urls specifies a list of type URLs to immediately stop processing. + * IF IT IS LEFT EMPTY, ALL MSG PROCESSING WILL STOP IMMEDIATELY. + * This value is validated against the authority's permissions and if the + * authority does not have permissions to trip the specified msg type URLs + * (or all URLs), the operation will fail. + */ + msg_type_urls?: string[]; +} +export interface MsgTripCircuitBreakerAminoMsg { + type: "cosmos-sdk/MsgTripCircuitBreaker"; + value: MsgTripCircuitBreakerAmino; +} +/** MsgTripCircuitBreaker defines the Msg/TripCircuitBreaker request type. */ +export interface MsgTripCircuitBreakerSDKType { + authority: string; + msg_type_urls: string[]; +} +/** MsgTripCircuitBreakerResponse defines the Msg/TripCircuitBreaker response type. */ +export interface MsgTripCircuitBreakerResponse { + success: boolean; +} +export interface MsgTripCircuitBreakerResponseProtoMsg { + typeUrl: "/cosmos.circuit.v1.MsgTripCircuitBreakerResponse"; + value: Uint8Array; +} +/** MsgTripCircuitBreakerResponse defines the Msg/TripCircuitBreaker response type. */ +export interface MsgTripCircuitBreakerResponseAmino { + success?: boolean; +} +export interface MsgTripCircuitBreakerResponseAminoMsg { + type: "cosmos-sdk/MsgTripCircuitBreakerResponse"; + value: MsgTripCircuitBreakerResponseAmino; +} +/** MsgTripCircuitBreakerResponse defines the Msg/TripCircuitBreaker response type. */ +export interface MsgTripCircuitBreakerResponseSDKType { + success: boolean; +} +/** MsgResetCircuitBreaker defines the Msg/ResetCircuitBreaker request type. */ +export interface MsgResetCircuitBreaker { + /** authority is the account authorized to trip or reset the circuit breaker. */ + authority: string; + /** + * msg_type_urls specifies a list of Msg type URLs to resume processing. If + * it is left empty all Msg processing for type URLs that the account is + * authorized to trip will resume. + */ + msgTypeUrls: string[]; +} +export interface MsgResetCircuitBreakerProtoMsg { + typeUrl: "/cosmos.circuit.v1.MsgResetCircuitBreaker"; + value: Uint8Array; +} +/** MsgResetCircuitBreaker defines the Msg/ResetCircuitBreaker request type. */ +export interface MsgResetCircuitBreakerAmino { + /** authority is the account authorized to trip or reset the circuit breaker. */ + authority?: string; + /** + * msg_type_urls specifies a list of Msg type URLs to resume processing. If + * it is left empty all Msg processing for type URLs that the account is + * authorized to trip will resume. + */ + msg_type_urls?: string[]; +} +export interface MsgResetCircuitBreakerAminoMsg { + type: "cosmos-sdk/MsgResetCircuitBreaker"; + value: MsgResetCircuitBreakerAmino; +} +/** MsgResetCircuitBreaker defines the Msg/ResetCircuitBreaker request type. */ +export interface MsgResetCircuitBreakerSDKType { + authority: string; + msg_type_urls: string[]; +} +/** MsgResetCircuitBreakerResponse defines the Msg/ResetCircuitBreaker response type. */ +export interface MsgResetCircuitBreakerResponse { + success: boolean; +} +export interface MsgResetCircuitBreakerResponseProtoMsg { + typeUrl: "/cosmos.circuit.v1.MsgResetCircuitBreakerResponse"; + value: Uint8Array; +} +/** MsgResetCircuitBreakerResponse defines the Msg/ResetCircuitBreaker response type. */ +export interface MsgResetCircuitBreakerResponseAmino { + success?: boolean; +} +export interface MsgResetCircuitBreakerResponseAminoMsg { + type: "cosmos-sdk/MsgResetCircuitBreakerResponse"; + value: MsgResetCircuitBreakerResponseAmino; +} +/** MsgResetCircuitBreakerResponse defines the Msg/ResetCircuitBreaker response type. */ +export interface MsgResetCircuitBreakerResponseSDKType { + success: boolean; +} +function createBaseMsgAuthorizeCircuitBreaker(): MsgAuthorizeCircuitBreaker { + return { + granter: "", + grantee: "", + permissions: undefined + }; +} +export const MsgAuthorizeCircuitBreaker = { + typeUrl: "/cosmos.circuit.v1.MsgAuthorizeCircuitBreaker", + encode(message: MsgAuthorizeCircuitBreaker, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.granter !== "") { + writer.uint32(10).string(message.granter); + } + if (message.grantee !== "") { + writer.uint32(18).string(message.grantee); + } + if (message.permissions !== undefined) { + Permissions.encode(message.permissions, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAuthorizeCircuitBreaker { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAuthorizeCircuitBreaker(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.granter = reader.string(); + break; + case 2: + message.grantee = reader.string(); + break; + case 3: + message.permissions = Permissions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgAuthorizeCircuitBreaker { + const message = createBaseMsgAuthorizeCircuitBreaker(); + message.granter = object.granter ?? ""; + message.grantee = object.grantee ?? ""; + message.permissions = object.permissions !== undefined && object.permissions !== null ? Permissions.fromPartial(object.permissions) : undefined; + return message; + }, + fromAmino(object: MsgAuthorizeCircuitBreakerAmino): MsgAuthorizeCircuitBreaker { + const message = createBaseMsgAuthorizeCircuitBreaker(); + if (object.granter !== undefined && object.granter !== null) { + message.granter = object.granter; + } + if (object.grantee !== undefined && object.grantee !== null) { + message.grantee = object.grantee; + } + if (object.permissions !== undefined && object.permissions !== null) { + message.permissions = Permissions.fromAmino(object.permissions); + } + return message; + }, + toAmino(message: MsgAuthorizeCircuitBreaker): MsgAuthorizeCircuitBreakerAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + obj.permissions = message.permissions ? Permissions.toAmino(message.permissions) : undefined; + return obj; + }, + fromAminoMsg(object: MsgAuthorizeCircuitBreakerAminoMsg): MsgAuthorizeCircuitBreaker { + return MsgAuthorizeCircuitBreaker.fromAmino(object.value); + }, + toAminoMsg(message: MsgAuthorizeCircuitBreaker): MsgAuthorizeCircuitBreakerAminoMsg { + return { + type: "cosmos-sdk/MsgAuthorizeCircuitBreaker", + value: MsgAuthorizeCircuitBreaker.toAmino(message) + }; + }, + fromProtoMsg(message: MsgAuthorizeCircuitBreakerProtoMsg): MsgAuthorizeCircuitBreaker { + return MsgAuthorizeCircuitBreaker.decode(message.value); + }, + toProto(message: MsgAuthorizeCircuitBreaker): Uint8Array { + return MsgAuthorizeCircuitBreaker.encode(message).finish(); + }, + toProtoMsg(message: MsgAuthorizeCircuitBreaker): MsgAuthorizeCircuitBreakerProtoMsg { + return { + typeUrl: "/cosmos.circuit.v1.MsgAuthorizeCircuitBreaker", + value: MsgAuthorizeCircuitBreaker.encode(message).finish() + }; + } +}; +function createBaseMsgAuthorizeCircuitBreakerResponse(): MsgAuthorizeCircuitBreakerResponse { + return { + success: false + }; +} +export const MsgAuthorizeCircuitBreakerResponse = { + typeUrl: "/cosmos.circuit.v1.MsgAuthorizeCircuitBreakerResponse", + encode(message: MsgAuthorizeCircuitBreakerResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.success === true) { + writer.uint32(8).bool(message.success); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgAuthorizeCircuitBreakerResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgAuthorizeCircuitBreakerResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.success = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgAuthorizeCircuitBreakerResponse { + const message = createBaseMsgAuthorizeCircuitBreakerResponse(); + message.success = object.success ?? false; + return message; + }, + fromAmino(object: MsgAuthorizeCircuitBreakerResponseAmino): MsgAuthorizeCircuitBreakerResponse { + const message = createBaseMsgAuthorizeCircuitBreakerResponse(); + if (object.success !== undefined && object.success !== null) { + message.success = object.success; + } + return message; + }, + toAmino(message: MsgAuthorizeCircuitBreakerResponse): MsgAuthorizeCircuitBreakerResponseAmino { + const obj: any = {}; + obj.success = message.success === false ? undefined : message.success; + return obj; + }, + fromAminoMsg(object: MsgAuthorizeCircuitBreakerResponseAminoMsg): MsgAuthorizeCircuitBreakerResponse { + return MsgAuthorizeCircuitBreakerResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgAuthorizeCircuitBreakerResponse): MsgAuthorizeCircuitBreakerResponseAminoMsg { + return { + type: "cosmos-sdk/MsgAuthorizeCircuitBreakerResponse", + value: MsgAuthorizeCircuitBreakerResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgAuthorizeCircuitBreakerResponseProtoMsg): MsgAuthorizeCircuitBreakerResponse { + return MsgAuthorizeCircuitBreakerResponse.decode(message.value); + }, + toProto(message: MsgAuthorizeCircuitBreakerResponse): Uint8Array { + return MsgAuthorizeCircuitBreakerResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgAuthorizeCircuitBreakerResponse): MsgAuthorizeCircuitBreakerResponseProtoMsg { + return { + typeUrl: "/cosmos.circuit.v1.MsgAuthorizeCircuitBreakerResponse", + value: MsgAuthorizeCircuitBreakerResponse.encode(message).finish() + }; + } +}; +function createBaseMsgTripCircuitBreaker(): MsgTripCircuitBreaker { + return { + authority: "", + msgTypeUrls: [] + }; +} +export const MsgTripCircuitBreaker = { + typeUrl: "/cosmos.circuit.v1.MsgTripCircuitBreaker", + encode(message: MsgTripCircuitBreaker, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + for (const v of message.msgTypeUrls) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgTripCircuitBreaker { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTripCircuitBreaker(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.msgTypeUrls.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgTripCircuitBreaker { + const message = createBaseMsgTripCircuitBreaker(); + message.authority = object.authority ?? ""; + message.msgTypeUrls = object.msgTypeUrls?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgTripCircuitBreakerAmino): MsgTripCircuitBreaker { + const message = createBaseMsgTripCircuitBreaker(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + message.msgTypeUrls = object.msg_type_urls?.map(e => e) || []; + return message; + }, + toAmino(message: MsgTripCircuitBreaker): MsgTripCircuitBreakerAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + if (message.msgTypeUrls) { + obj.msg_type_urls = message.msgTypeUrls.map(e => e); + } else { + obj.msg_type_urls = message.msgTypeUrls; + } + return obj; + }, + fromAminoMsg(object: MsgTripCircuitBreakerAminoMsg): MsgTripCircuitBreaker { + return MsgTripCircuitBreaker.fromAmino(object.value); + }, + toAminoMsg(message: MsgTripCircuitBreaker): MsgTripCircuitBreakerAminoMsg { + return { + type: "cosmos-sdk/MsgTripCircuitBreaker", + value: MsgTripCircuitBreaker.toAmino(message) + }; + }, + fromProtoMsg(message: MsgTripCircuitBreakerProtoMsg): MsgTripCircuitBreaker { + return MsgTripCircuitBreaker.decode(message.value); + }, + toProto(message: MsgTripCircuitBreaker): Uint8Array { + return MsgTripCircuitBreaker.encode(message).finish(); + }, + toProtoMsg(message: MsgTripCircuitBreaker): MsgTripCircuitBreakerProtoMsg { + return { + typeUrl: "/cosmos.circuit.v1.MsgTripCircuitBreaker", + value: MsgTripCircuitBreaker.encode(message).finish() + }; + } +}; +function createBaseMsgTripCircuitBreakerResponse(): MsgTripCircuitBreakerResponse { + return { + success: false + }; +} +export const MsgTripCircuitBreakerResponse = { + typeUrl: "/cosmos.circuit.v1.MsgTripCircuitBreakerResponse", + encode(message: MsgTripCircuitBreakerResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.success === true) { + writer.uint32(8).bool(message.success); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgTripCircuitBreakerResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgTripCircuitBreakerResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.success = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgTripCircuitBreakerResponse { + const message = createBaseMsgTripCircuitBreakerResponse(); + message.success = object.success ?? false; + return message; + }, + fromAmino(object: MsgTripCircuitBreakerResponseAmino): MsgTripCircuitBreakerResponse { + const message = createBaseMsgTripCircuitBreakerResponse(); + if (object.success !== undefined && object.success !== null) { + message.success = object.success; + } + return message; + }, + toAmino(message: MsgTripCircuitBreakerResponse): MsgTripCircuitBreakerResponseAmino { + const obj: any = {}; + obj.success = message.success === false ? undefined : message.success; + return obj; + }, + fromAminoMsg(object: MsgTripCircuitBreakerResponseAminoMsg): MsgTripCircuitBreakerResponse { + return MsgTripCircuitBreakerResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgTripCircuitBreakerResponse): MsgTripCircuitBreakerResponseAminoMsg { + return { + type: "cosmos-sdk/MsgTripCircuitBreakerResponse", + value: MsgTripCircuitBreakerResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgTripCircuitBreakerResponseProtoMsg): MsgTripCircuitBreakerResponse { + return MsgTripCircuitBreakerResponse.decode(message.value); + }, + toProto(message: MsgTripCircuitBreakerResponse): Uint8Array { + return MsgTripCircuitBreakerResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgTripCircuitBreakerResponse): MsgTripCircuitBreakerResponseProtoMsg { + return { + typeUrl: "/cosmos.circuit.v1.MsgTripCircuitBreakerResponse", + value: MsgTripCircuitBreakerResponse.encode(message).finish() + }; + } +}; +function createBaseMsgResetCircuitBreaker(): MsgResetCircuitBreaker { + return { + authority: "", + msgTypeUrls: [] + }; +} +export const MsgResetCircuitBreaker = { + typeUrl: "/cosmos.circuit.v1.MsgResetCircuitBreaker", + encode(message: MsgResetCircuitBreaker, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + for (const v of message.msgTypeUrls) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgResetCircuitBreaker { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgResetCircuitBreaker(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 3: + message.msgTypeUrls.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgResetCircuitBreaker { + const message = createBaseMsgResetCircuitBreaker(); + message.authority = object.authority ?? ""; + message.msgTypeUrls = object.msgTypeUrls?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgResetCircuitBreakerAmino): MsgResetCircuitBreaker { + const message = createBaseMsgResetCircuitBreaker(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + message.msgTypeUrls = object.msg_type_urls?.map(e => e) || []; + return message; + }, + toAmino(message: MsgResetCircuitBreaker): MsgResetCircuitBreakerAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + if (message.msgTypeUrls) { + obj.msg_type_urls = message.msgTypeUrls.map(e => e); + } else { + obj.msg_type_urls = message.msgTypeUrls; + } + return obj; + }, + fromAminoMsg(object: MsgResetCircuitBreakerAminoMsg): MsgResetCircuitBreaker { + return MsgResetCircuitBreaker.fromAmino(object.value); + }, + toAminoMsg(message: MsgResetCircuitBreaker): MsgResetCircuitBreakerAminoMsg { + return { + type: "cosmos-sdk/MsgResetCircuitBreaker", + value: MsgResetCircuitBreaker.toAmino(message) + }; + }, + fromProtoMsg(message: MsgResetCircuitBreakerProtoMsg): MsgResetCircuitBreaker { + return MsgResetCircuitBreaker.decode(message.value); + }, + toProto(message: MsgResetCircuitBreaker): Uint8Array { + return MsgResetCircuitBreaker.encode(message).finish(); + }, + toProtoMsg(message: MsgResetCircuitBreaker): MsgResetCircuitBreakerProtoMsg { + return { + typeUrl: "/cosmos.circuit.v1.MsgResetCircuitBreaker", + value: MsgResetCircuitBreaker.encode(message).finish() + }; + } +}; +function createBaseMsgResetCircuitBreakerResponse(): MsgResetCircuitBreakerResponse { + return { + success: false + }; +} +export const MsgResetCircuitBreakerResponse = { + typeUrl: "/cosmos.circuit.v1.MsgResetCircuitBreakerResponse", + encode(message: MsgResetCircuitBreakerResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.success === true) { + writer.uint32(8).bool(message.success); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgResetCircuitBreakerResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgResetCircuitBreakerResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.success = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgResetCircuitBreakerResponse { + const message = createBaseMsgResetCircuitBreakerResponse(); + message.success = object.success ?? false; + return message; + }, + fromAmino(object: MsgResetCircuitBreakerResponseAmino): MsgResetCircuitBreakerResponse { + const message = createBaseMsgResetCircuitBreakerResponse(); + if (object.success !== undefined && object.success !== null) { + message.success = object.success; + } + return message; + }, + toAmino(message: MsgResetCircuitBreakerResponse): MsgResetCircuitBreakerResponseAmino { + const obj: any = {}; + obj.success = message.success === false ? undefined : message.success; + return obj; + }, + fromAminoMsg(object: MsgResetCircuitBreakerResponseAminoMsg): MsgResetCircuitBreakerResponse { + return MsgResetCircuitBreakerResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgResetCircuitBreakerResponse): MsgResetCircuitBreakerResponseAminoMsg { + return { + type: "cosmos-sdk/MsgResetCircuitBreakerResponse", + value: MsgResetCircuitBreakerResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgResetCircuitBreakerResponseProtoMsg): MsgResetCircuitBreakerResponse { + return MsgResetCircuitBreakerResponse.decode(message.value); + }, + toProto(message: MsgResetCircuitBreakerResponse): Uint8Array { + return MsgResetCircuitBreakerResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgResetCircuitBreakerResponse): MsgResetCircuitBreakerResponseProtoMsg { + return { + typeUrl: "/cosmos.circuit.v1.MsgResetCircuitBreakerResponse", + value: MsgResetCircuitBreakerResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/circuit/v1/types.ts b/src/codegen/cosmos/circuit/v1/types.ts new file mode 100644 index 0000000..3a37321 --- /dev/null +++ b/src/codegen/cosmos/circuit/v1/types.ts @@ -0,0 +1,403 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** Level is the permission level. */ +export enum Permissions_Level { + /** + * LEVEL_NONE_UNSPECIFIED - LEVEL_NONE_UNSPECIFIED indicates that the account will have no circuit + * breaker permissions. + */ + LEVEL_NONE_UNSPECIFIED = 0, + /** + * LEVEL_SOME_MSGS - LEVEL_SOME_MSGS indicates that the account will have permission to + * trip or reset the circuit breaker for some Msg type URLs. If this level + * is chosen, a non-empty list of Msg type URLs must be provided in + * limit_type_urls. + */ + LEVEL_SOME_MSGS = 1, + /** + * LEVEL_ALL_MSGS - LEVEL_ALL_MSGS indicates that the account can trip or reset the circuit + * breaker for Msg's of all type URLs. + */ + LEVEL_ALL_MSGS = 2, + /** + * LEVEL_SUPER_ADMIN - LEVEL_SUPER_ADMIN indicates that the account can take all circuit breaker + * actions and can grant permissions to other accounts. + */ + LEVEL_SUPER_ADMIN = 3, + UNRECOGNIZED = -1, +} +export const Permissions_LevelSDKType = Permissions_Level; +export const Permissions_LevelAmino = Permissions_Level; +export function permissions_LevelFromJSON(object: any): Permissions_Level { + switch (object) { + case 0: + case "LEVEL_NONE_UNSPECIFIED": + return Permissions_Level.LEVEL_NONE_UNSPECIFIED; + case 1: + case "LEVEL_SOME_MSGS": + return Permissions_Level.LEVEL_SOME_MSGS; + case 2: + case "LEVEL_ALL_MSGS": + return Permissions_Level.LEVEL_ALL_MSGS; + case 3: + case "LEVEL_SUPER_ADMIN": + return Permissions_Level.LEVEL_SUPER_ADMIN; + case -1: + case "UNRECOGNIZED": + default: + return Permissions_Level.UNRECOGNIZED; + } +} +export function permissions_LevelToJSON(object: Permissions_Level): string { + switch (object) { + case Permissions_Level.LEVEL_NONE_UNSPECIFIED: + return "LEVEL_NONE_UNSPECIFIED"; + case Permissions_Level.LEVEL_SOME_MSGS: + return "LEVEL_SOME_MSGS"; + case Permissions_Level.LEVEL_ALL_MSGS: + return "LEVEL_ALL_MSGS"; + case Permissions_Level.LEVEL_SUPER_ADMIN: + return "LEVEL_SUPER_ADMIN"; + case Permissions_Level.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * Permissions are the permissions that an account has to trip + * or reset the circuit breaker. + */ +export interface Permissions { + /** level is the level of permissions granted to this account. */ + level: Permissions_Level; + /** + * limit_type_urls is used with LEVEL_SOME_MSGS to limit the lists of Msg type + * URLs that the account can trip. It is an error to use limit_type_urls with + * a level other than LEVEL_SOME_MSGS. + */ + limitTypeUrls: string[]; +} +export interface PermissionsProtoMsg { + typeUrl: "/cosmos.circuit.v1.Permissions"; + value: Uint8Array; +} +/** + * Permissions are the permissions that an account has to trip + * or reset the circuit breaker. + */ +export interface PermissionsAmino { + /** level is the level of permissions granted to this account. */ + level?: Permissions_Level; + /** + * limit_type_urls is used with LEVEL_SOME_MSGS to limit the lists of Msg type + * URLs that the account can trip. It is an error to use limit_type_urls with + * a level other than LEVEL_SOME_MSGS. + */ + limit_type_urls?: string[]; +} +export interface PermissionsAminoMsg { + type: "cosmos-sdk/Permissions"; + value: PermissionsAmino; +} +/** + * Permissions are the permissions that an account has to trip + * or reset the circuit breaker. + */ +export interface PermissionsSDKType { + level: Permissions_Level; + limit_type_urls: string[]; +} +/** GenesisAccountPermissions is the account permissions for the circuit breaker in genesis */ +export interface GenesisAccountPermissions { + address: string; + permissions?: Permissions; +} +export interface GenesisAccountPermissionsProtoMsg { + typeUrl: "/cosmos.circuit.v1.GenesisAccountPermissions"; + value: Uint8Array; +} +/** GenesisAccountPermissions is the account permissions for the circuit breaker in genesis */ +export interface GenesisAccountPermissionsAmino { + address?: string; + permissions?: PermissionsAmino; +} +export interface GenesisAccountPermissionsAminoMsg { + type: "cosmos-sdk/GenesisAccountPermissions"; + value: GenesisAccountPermissionsAmino; +} +/** GenesisAccountPermissions is the account permissions for the circuit breaker in genesis */ +export interface GenesisAccountPermissionsSDKType { + address: string; + permissions?: PermissionsSDKType; +} +/** GenesisState is the state that must be provided at genesis. */ +export interface GenesisState { + accountPermissions: GenesisAccountPermissions[]; + disabledTypeUrls: string[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmos.circuit.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState is the state that must be provided at genesis. */ +export interface GenesisStateAmino { + account_permissions?: GenesisAccountPermissionsAmino[]; + disabled_type_urls?: string[]; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState is the state that must be provided at genesis. */ +export interface GenesisStateSDKType { + account_permissions: GenesisAccountPermissionsSDKType[]; + disabled_type_urls: string[]; +} +function createBasePermissions(): Permissions { + return { + level: 0, + limitTypeUrls: [] + }; +} +export const Permissions = { + typeUrl: "/cosmos.circuit.v1.Permissions", + encode(message: Permissions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.level !== 0) { + writer.uint32(8).int32(message.level); + } + for (const v of message.limitTypeUrls) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Permissions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePermissions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.level = (reader.int32() as any); + break; + case 2: + message.limitTypeUrls.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Permissions { + const message = createBasePermissions(); + message.level = object.level ?? 0; + message.limitTypeUrls = object.limitTypeUrls?.map(e => e) || []; + return message; + }, + fromAmino(object: PermissionsAmino): Permissions { + const message = createBasePermissions(); + if (object.level !== undefined && object.level !== null) { + message.level = object.level; + } + message.limitTypeUrls = object.limit_type_urls?.map(e => e) || []; + return message; + }, + toAmino(message: Permissions): PermissionsAmino { + const obj: any = {}; + obj.level = message.level === 0 ? undefined : message.level; + if (message.limitTypeUrls) { + obj.limit_type_urls = message.limitTypeUrls.map(e => e); + } else { + obj.limit_type_urls = message.limitTypeUrls; + } + return obj; + }, + fromAminoMsg(object: PermissionsAminoMsg): Permissions { + return Permissions.fromAmino(object.value); + }, + toAminoMsg(message: Permissions): PermissionsAminoMsg { + return { + type: "cosmos-sdk/Permissions", + value: Permissions.toAmino(message) + }; + }, + fromProtoMsg(message: PermissionsProtoMsg): Permissions { + return Permissions.decode(message.value); + }, + toProto(message: Permissions): Uint8Array { + return Permissions.encode(message).finish(); + }, + toProtoMsg(message: Permissions): PermissionsProtoMsg { + return { + typeUrl: "/cosmos.circuit.v1.Permissions", + value: Permissions.encode(message).finish() + }; + } +}; +function createBaseGenesisAccountPermissions(): GenesisAccountPermissions { + return { + address: "", + permissions: undefined + }; +} +export const GenesisAccountPermissions = { + typeUrl: "/cosmos.circuit.v1.GenesisAccountPermissions", + encode(message: GenesisAccountPermissions, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.permissions !== undefined) { + Permissions.encode(message.permissions, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisAccountPermissions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisAccountPermissions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.permissions = Permissions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisAccountPermissions { + const message = createBaseGenesisAccountPermissions(); + message.address = object.address ?? ""; + message.permissions = object.permissions !== undefined && object.permissions !== null ? Permissions.fromPartial(object.permissions) : undefined; + return message; + }, + fromAmino(object: GenesisAccountPermissionsAmino): GenesisAccountPermissions { + const message = createBaseGenesisAccountPermissions(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.permissions !== undefined && object.permissions !== null) { + message.permissions = Permissions.fromAmino(object.permissions); + } + return message; + }, + toAmino(message: GenesisAccountPermissions): GenesisAccountPermissionsAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.permissions = message.permissions ? Permissions.toAmino(message.permissions) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisAccountPermissionsAminoMsg): GenesisAccountPermissions { + return GenesisAccountPermissions.fromAmino(object.value); + }, + toAminoMsg(message: GenesisAccountPermissions): GenesisAccountPermissionsAminoMsg { + return { + type: "cosmos-sdk/GenesisAccountPermissions", + value: GenesisAccountPermissions.toAmino(message) + }; + }, + fromProtoMsg(message: GenesisAccountPermissionsProtoMsg): GenesisAccountPermissions { + return GenesisAccountPermissions.decode(message.value); + }, + toProto(message: GenesisAccountPermissions): Uint8Array { + return GenesisAccountPermissions.encode(message).finish(); + }, + toProtoMsg(message: GenesisAccountPermissions): GenesisAccountPermissionsProtoMsg { + return { + typeUrl: "/cosmos.circuit.v1.GenesisAccountPermissions", + value: GenesisAccountPermissions.encode(message).finish() + }; + } +}; +function createBaseGenesisState(): GenesisState { + return { + accountPermissions: [], + disabledTypeUrls: [] + }; +} +export const GenesisState = { + typeUrl: "/cosmos.circuit.v1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.accountPermissions) { + GenesisAccountPermissions.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.disabledTypeUrls) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accountPermissions.push(GenesisAccountPermissions.decode(reader, reader.uint32())); + break; + case 2: + message.disabledTypeUrls.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.accountPermissions = object.accountPermissions?.map(e => GenesisAccountPermissions.fromPartial(e)) || []; + message.disabledTypeUrls = object.disabledTypeUrls?.map(e => e) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + message.accountPermissions = object.account_permissions?.map(e => GenesisAccountPermissions.fromAmino(e)) || []; + message.disabledTypeUrls = object.disabled_type_urls?.map(e => e) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + if (message.accountPermissions) { + obj.account_permissions = message.accountPermissions.map(e => e ? GenesisAccountPermissions.toAmino(e) : undefined); + } else { + obj.account_permissions = message.accountPermissions; + } + if (message.disabledTypeUrls) { + obj.disabled_type_urls = message.disabledTypeUrls.map(e => e); + } else { + obj.disabled_type_urls = message.disabledTypeUrls; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: "cosmos-sdk/GenesisState", + value: GenesisState.toAmino(message) + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/cosmos.circuit.v1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/client.ts b/src/codegen/cosmos/client.ts index 1bcf2a0..c65f44c 100644 --- a/src/codegen/cosmos/client.ts +++ b/src/codegen/cosmos/client.ts @@ -1,39 +1,63 @@ import { GeneratedType, Registry, OfflineSigner } from "@cosmjs/proto-signing"; import { AminoTypes, SigningStargateClient } from "@cosmjs/stargate"; import { HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import * as cosmosAuthV1beta1TxRegistry from "./auth/v1beta1/tx.registry"; import * as cosmosAuthzV1beta1TxRegistry from "./authz/v1beta1/tx.registry"; import * as cosmosBankV1beta1TxRegistry from "./bank/v1beta1/tx.registry"; +import * as cosmosCircuitV1TxRegistry from "./circuit/v1/tx.registry"; +import * as cosmosConsensusV1TxRegistry from "./consensus/v1/tx.registry"; import * as cosmosCrisisV1beta1TxRegistry from "./crisis/v1beta1/tx.registry"; import * as cosmosDistributionV1beta1TxRegistry from "./distribution/v1beta1/tx.registry"; import * as cosmosEvidenceV1beta1TxRegistry from "./evidence/v1beta1/tx.registry"; import * as cosmosFeegrantV1beta1TxRegistry from "./feegrant/v1beta1/tx.registry"; +import * as cosmosGovV1TxRegistry from "./gov/v1/tx.registry"; import * as cosmosGovV1beta1TxRegistry from "./gov/v1beta1/tx.registry"; +import * as cosmosGroupV1TxRegistry from "./group/v1/tx.registry"; +import * as cosmosMintV1beta1TxRegistry from "./mint/v1beta1/tx.registry"; +import * as cosmosNftV1beta1TxRegistry from "./nft/v1beta1/tx.registry"; import * as cosmosSlashingV1beta1TxRegistry from "./slashing/v1beta1/tx.registry"; import * as cosmosStakingV1beta1TxRegistry from "./staking/v1beta1/tx.registry"; +import * as cosmosUpgradeV1beta1TxRegistry from "./upgrade/v1beta1/tx.registry"; import * as cosmosVestingV1beta1TxRegistry from "./vesting/v1beta1/tx.registry"; +import * as cosmosAuthV1beta1TxAmino from "./auth/v1beta1/tx.amino"; import * as cosmosAuthzV1beta1TxAmino from "./authz/v1beta1/tx.amino"; import * as cosmosBankV1beta1TxAmino from "./bank/v1beta1/tx.amino"; +import * as cosmosCircuitV1TxAmino from "./circuit/v1/tx.amino"; +import * as cosmosConsensusV1TxAmino from "./consensus/v1/tx.amino"; import * as cosmosCrisisV1beta1TxAmino from "./crisis/v1beta1/tx.amino"; import * as cosmosDistributionV1beta1TxAmino from "./distribution/v1beta1/tx.amino"; import * as cosmosEvidenceV1beta1TxAmino from "./evidence/v1beta1/tx.amino"; import * as cosmosFeegrantV1beta1TxAmino from "./feegrant/v1beta1/tx.amino"; +import * as cosmosGovV1TxAmino from "./gov/v1/tx.amino"; import * as cosmosGovV1beta1TxAmino from "./gov/v1beta1/tx.amino"; +import * as cosmosGroupV1TxAmino from "./group/v1/tx.amino"; +import * as cosmosMintV1beta1TxAmino from "./mint/v1beta1/tx.amino"; +import * as cosmosNftV1beta1TxAmino from "./nft/v1beta1/tx.amino"; import * as cosmosSlashingV1beta1TxAmino from "./slashing/v1beta1/tx.amino"; import * as cosmosStakingV1beta1TxAmino from "./staking/v1beta1/tx.amino"; +import * as cosmosUpgradeV1beta1TxAmino from "./upgrade/v1beta1/tx.amino"; import * as cosmosVestingV1beta1TxAmino from "./vesting/v1beta1/tx.amino"; export const cosmosAminoConverters = { + ...cosmosAuthV1beta1TxAmino.AminoConverter, ...cosmosAuthzV1beta1TxAmino.AminoConverter, ...cosmosBankV1beta1TxAmino.AminoConverter, + ...cosmosCircuitV1TxAmino.AminoConverter, + ...cosmosConsensusV1TxAmino.AminoConverter, ...cosmosCrisisV1beta1TxAmino.AminoConverter, ...cosmosDistributionV1beta1TxAmino.AminoConverter, ...cosmosEvidenceV1beta1TxAmino.AminoConverter, ...cosmosFeegrantV1beta1TxAmino.AminoConverter, + ...cosmosGovV1TxAmino.AminoConverter, ...cosmosGovV1beta1TxAmino.AminoConverter, + ...cosmosGroupV1TxAmino.AminoConverter, + ...cosmosMintV1beta1TxAmino.AminoConverter, + ...cosmosNftV1beta1TxAmino.AminoConverter, ...cosmosSlashingV1beta1TxAmino.AminoConverter, ...cosmosStakingV1beta1TxAmino.AminoConverter, + ...cosmosUpgradeV1beta1TxAmino.AminoConverter, ...cosmosVestingV1beta1TxAmino.AminoConverter }; -export const cosmosProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...cosmosAuthzV1beta1TxRegistry.registry, ...cosmosBankV1beta1TxRegistry.registry, ...cosmosCrisisV1beta1TxRegistry.registry, ...cosmosDistributionV1beta1TxRegistry.registry, ...cosmosEvidenceV1beta1TxRegistry.registry, ...cosmosFeegrantV1beta1TxRegistry.registry, ...cosmosGovV1beta1TxRegistry.registry, ...cosmosSlashingV1beta1TxRegistry.registry, ...cosmosStakingV1beta1TxRegistry.registry, ...cosmosVestingV1beta1TxRegistry.registry]; +export const cosmosProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...cosmosAuthV1beta1TxRegistry.registry, ...cosmosAuthzV1beta1TxRegistry.registry, ...cosmosBankV1beta1TxRegistry.registry, ...cosmosCircuitV1TxRegistry.registry, ...cosmosConsensusV1TxRegistry.registry, ...cosmosCrisisV1beta1TxRegistry.registry, ...cosmosDistributionV1beta1TxRegistry.registry, ...cosmosEvidenceV1beta1TxRegistry.registry, ...cosmosFeegrantV1beta1TxRegistry.registry, ...cosmosGovV1TxRegistry.registry, ...cosmosGovV1beta1TxRegistry.registry, ...cosmosGroupV1TxRegistry.registry, ...cosmosMintV1beta1TxRegistry.registry, ...cosmosNftV1beta1TxRegistry.registry, ...cosmosSlashingV1beta1TxRegistry.registry, ...cosmosStakingV1beta1TxRegistry.registry, ...cosmosUpgradeV1beta1TxRegistry.registry, ...cosmosVestingV1beta1TxRegistry.registry]; export const getSigningCosmosClientOptions = (): { registry: Registry; aminoTypes: AminoTypes; diff --git a/src/codegen/cosmos/consensus/v1/query.lcd.ts b/src/codegen/cosmos/consensus/v1/query.lcd.ts new file mode 100644 index 0000000..d3949a5 --- /dev/null +++ b/src/codegen/cosmos/consensus/v1/query.lcd.ts @@ -0,0 +1,18 @@ +import { LCDClient } from "@cosmology/lcd"; +import { QueryParamsRequest, QueryParamsResponseSDKType } from "./query"; +export class LCDQueryClient { + req: LCDClient; + constructor({ + requestClient + }: { + requestClient: LCDClient; + }) { + this.req = requestClient; + this.params = this.params.bind(this); + } + /* Params queries the parameters of x/consensus module. */ + async params(_params: QueryParamsRequest = {}): Promise { + const endpoint = `cosmos/consensus/v1/params`; + return await this.req.get(endpoint); + } +} \ No newline at end of file diff --git a/src/codegen/cosmos/consensus/v1/query.rpc.Query.ts b/src/codegen/cosmos/consensus/v1/query.rpc.Query.ts new file mode 100644 index 0000000..b5fe24e --- /dev/null +++ b/src/codegen/cosmos/consensus/v1/query.rpc.Query.ts @@ -0,0 +1,30 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryParamsRequest, QueryParamsResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Params queries the parameters of x/consensus module. */ + params(request?: QueryParamsRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.params = this.params.bind(this); + } + params(request: QueryParamsRequest = {}): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.consensus.v1.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + params(request?: QueryParamsRequest): Promise { + return queryService.params(request); + } + }; +}; \ No newline at end of file diff --git a/src/codegen/cosmos/consensus/v1/query.ts b/src/codegen/cosmos/consensus/v1/query.ts new file mode 100644 index 0000000..ade123c --- /dev/null +++ b/src/codegen/cosmos/consensus/v1/query.ts @@ -0,0 +1,171 @@ +import { ConsensusParams, ConsensusParamsAmino, ConsensusParamsSDKType } from "../../../tendermint/types/params"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** QueryParamsRequest defines the request type for querying x/consensus parameters. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/cosmos.consensus.v1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest defines the request type for querying x/consensus parameters. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "cosmos-sdk/QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsRequest defines the request type for querying x/consensus parameters. */ +export interface QueryParamsRequestSDKType {} +/** QueryParamsResponse defines the response type for querying x/consensus parameters. */ +export interface QueryParamsResponse { + /** + * params are the tendermint consensus params stored in the consensus module. + * Please note that `params.version` is not populated in this response, it is + * tracked separately in the x/upgrade module. + */ + params?: ConsensusParams; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/cosmos.consensus.v1.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse defines the response type for querying x/consensus parameters. */ +export interface QueryParamsResponseAmino { + /** + * params are the tendermint consensus params stored in the consensus module. + * Please note that `params.version` is not populated in this response, it is + * tracked separately in the x/upgrade module. + */ + params?: ConsensusParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "cosmos-sdk/QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse defines the response type for querying x/consensus parameters. */ +export interface QueryParamsResponseSDKType { + params?: ConsensusParamsSDKType; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/cosmos.consensus.v1.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsRequest): QueryParamsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryParamsRequest", + value: QueryParamsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/cosmos.consensus.v1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: undefined + }; +} +export const QueryParamsResponse = { + typeUrl: "/cosmos.consensus.v1.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + ConsensusParams.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = ConsensusParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? ConsensusParams.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = ConsensusParams.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? ConsensusParams.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsResponse): QueryParamsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryParamsResponse", + value: QueryParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/cosmos.consensus.v1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/consensus/v1/tx.amino.ts b/src/codegen/cosmos/consensus/v1/tx.amino.ts new file mode 100644 index 0000000..127a138 --- /dev/null +++ b/src/codegen/cosmos/consensus/v1/tx.amino.ts @@ -0,0 +1,8 @@ +import { MsgUpdateParams } from "./tx"; +export const AminoConverter = { + "/cosmos.consensus.v1.MsgUpdateParams": { + aminoType: "cosmos-sdk/x/consensus/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/consensus/v1/tx.registry.ts b/src/codegen/cosmos/consensus/v1/tx.registry.ts new file mode 100644 index 0000000..47848a5 --- /dev/null +++ b/src/codegen/cosmos/consensus/v1/tx.registry.ts @@ -0,0 +1,34 @@ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.consensus.v1.MsgUpdateParams", MsgUpdateParams]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + } + }, + withTypeUrl: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParams", + value + }; + } + }, + fromPartial: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/consensus/v1/tx.rpc.msg.ts b/src/codegen/cosmos/consensus/v1/tx.rpc.msg.ts new file mode 100644 index 0000000..5c2d4c9 --- /dev/null +++ b/src/codegen/cosmos/consensus/v1/tx.rpc.msg.ts @@ -0,0 +1,25 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; +/** Msg defines the consensus Msg service. */ +export interface Msg { + /** + * UpdateParams defines a governance operation for updating the x/consensus module parameters. + * The authority is defined in the keeper. + * + * Since: cosmos-sdk 0.47 + */ + updateParams(request: MsgUpdateParams): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.updateParams = this.updateParams.bind(this); + } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("cosmos.consensus.v1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/src/codegen/cosmos/consensus/v1/tx.ts b/src/codegen/cosmos/consensus/v1/tx.ts new file mode 100644 index 0000000..2b3d44f --- /dev/null +++ b/src/codegen/cosmos/consensus/v1/tx.ts @@ -0,0 +1,248 @@ +import { BlockParams, BlockParamsAmino, BlockParamsSDKType, EvidenceParams, EvidenceParamsAmino, EvidenceParamsSDKType, ValidatorParams, ValidatorParamsAmino, ValidatorParamsSDKType, ABCIParams, ABCIParamsAmino, ABCIParamsSDKType } from "../../../tendermint/types/params"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** + * params defines the x/consensus parameters to update. + * VersionsParams is not included in this Msg because it is tracked + * separarately in x/upgrade. + * + * NOTE: All parameters must be supplied. + */ + block?: BlockParams; + evidence?: EvidenceParams; + validator?: ValidatorParams; + /** Since: cosmos-sdk 0.50 */ + abci?: ABCIParams; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParamsAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; + /** + * params defines the x/consensus parameters to update. + * VersionsParams is not included in this Msg because it is tracked + * separarately in x/upgrade. + * + * NOTE: All parameters must be supplied. + */ + block?: BlockParamsAmino; + evidence?: EvidenceParamsAmino; + validator?: ValidatorParamsAmino; + /** Since: cosmos-sdk 0.50 */ + abci?: ABCIParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/x/consensus/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParamsSDKType { + authority: string; + block?: BlockParamsSDKType; + evidence?: EvidenceParamsSDKType; + validator?: ValidatorParamsSDKType; + abci?: ABCIParamsSDKType; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + */ +export interface MsgUpdateParamsResponseSDKType {} +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + block: undefined, + evidence: undefined, + validator: undefined, + abci: undefined + }; +} +export const MsgUpdateParams = { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.block !== undefined) { + BlockParams.encode(message.block, writer.uint32(18).fork()).ldelim(); + } + if (message.evidence !== undefined) { + EvidenceParams.encode(message.evidence, writer.uint32(26).fork()).ldelim(); + } + if (message.validator !== undefined) { + ValidatorParams.encode(message.validator, writer.uint32(34).fork()).ldelim(); + } + if (message.abci !== undefined) { + ABCIParams.encode(message.abci, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.block = BlockParams.decode(reader, reader.uint32()); + break; + case 3: + message.evidence = EvidenceParams.decode(reader, reader.uint32()); + break; + case 4: + message.validator = ValidatorParams.decode(reader, reader.uint32()); + break; + case 5: + message.abci = ABCIParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.block = object.block !== undefined && object.block !== null ? BlockParams.fromPartial(object.block) : undefined; + message.evidence = object.evidence !== undefined && object.evidence !== null ? EvidenceParams.fromPartial(object.evidence) : undefined; + message.validator = object.validator !== undefined && object.validator !== null ? ValidatorParams.fromPartial(object.validator) : undefined; + message.abci = object.abci !== undefined && object.abci !== null ? ABCIParams.fromPartial(object.abci) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.block !== undefined && object.block !== null) { + message.block = BlockParams.fromAmino(object.block); + } + if (object.evidence !== undefined && object.evidence !== null) { + message.evidence = EvidenceParams.fromAmino(object.evidence); + } + if (object.validator !== undefined && object.validator !== null) { + message.validator = ValidatorParams.fromAmino(object.validator); + } + if (object.abci !== undefined && object.abci !== null) { + message.abci = ABCIParams.fromAmino(object.abci); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.block = message.block ? BlockParams.toAmino(message.block) : undefined; + obj.evidence = message.evidence ? EvidenceParams.toAmino(message.evidence) : undefined; + obj.validator = message.validator ? ValidatorParams.toAmino(message.validator) : undefined; + obj.abci = message.abci ? ABCIParams.toAmino(message.abci) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/x/consensus/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/cosmos.consensus.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/crisis/v1beta1/genesis.ts b/src/codegen/cosmos/crisis/v1beta1/genesis.ts index 4b3c0a1..c806c21 100644 --- a/src/codegen/cosmos/crisis/v1beta1/genesis.ts +++ b/src/codegen/cosmos/crisis/v1beta1/genesis.ts @@ -18,7 +18,7 @@ export interface GenesisStateAmino { * constant_fee is the fee used to verify the invariant in the crisis * module. */ - constant_fee?: CoinAmino; + constant_fee: CoinAmino; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -72,7 +72,7 @@ export const GenesisState = { }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; - obj.constant_fee = message.constantFee ? Coin.toAmino(message.constantFee) : undefined; + obj.constant_fee = message.constantFee ? Coin.toAmino(message.constantFee) : Coin.toAmino(Coin.fromPartial({})); return obj; }, fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { diff --git a/src/codegen/cosmos/crisis/v1beta1/tx.amino.ts b/src/codegen/cosmos/crisis/v1beta1/tx.amino.ts index 5269268..569a9f8 100644 --- a/src/codegen/cosmos/crisis/v1beta1/tx.amino.ts +++ b/src/codegen/cosmos/crisis/v1beta1/tx.amino.ts @@ -1,8 +1,13 @@ -import { MsgVerifyInvariant } from "./tx"; +import { MsgVerifyInvariant, MsgUpdateParams } from "./tx"; export const AminoConverter = { "/cosmos.crisis.v1beta1.MsgVerifyInvariant": { aminoType: "cosmos-sdk/MsgVerifyInvariant", toAmino: MsgVerifyInvariant.toAmino, fromAmino: MsgVerifyInvariant.fromAmino + }, + "/cosmos.crisis.v1beta1.MsgUpdateParams": { + aminoType: "cosmos-sdk/x/crisis/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino } }; \ No newline at end of file diff --git a/src/codegen/cosmos/crisis/v1beta1/tx.registry.ts b/src/codegen/cosmos/crisis/v1beta1/tx.registry.ts index 8a14b48..99b833d 100644 --- a/src/codegen/cosmos/crisis/v1beta1/tx.registry.ts +++ b/src/codegen/cosmos/crisis/v1beta1/tx.registry.ts @@ -1,6 +1,6 @@ import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgVerifyInvariant } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.crisis.v1beta1.MsgVerifyInvariant", MsgVerifyInvariant]]; +import { MsgVerifyInvariant, MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.crisis.v1beta1.MsgVerifyInvariant", MsgVerifyInvariant], ["/cosmos.crisis.v1beta1.MsgUpdateParams", MsgUpdateParams]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -13,6 +13,12 @@ export const MessageComposer = { typeUrl: "/cosmos.crisis.v1beta1.MsgVerifyInvariant", value: MsgVerifyInvariant.encode(value).finish() }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.crisis.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; } }, withTypeUrl: { @@ -21,6 +27,12 @@ export const MessageComposer = { typeUrl: "/cosmos.crisis.v1beta1.MsgVerifyInvariant", value }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.crisis.v1beta1.MsgUpdateParams", + value + }; } }, fromPartial: { @@ -29,6 +41,12 @@ export const MessageComposer = { typeUrl: "/cosmos.crisis.v1beta1.MsgVerifyInvariant", value: MsgVerifyInvariant.fromPartial(value) }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.crisis.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/src/codegen/cosmos/crisis/v1beta1/tx.rpc.msg.ts b/src/codegen/cosmos/crisis/v1beta1/tx.rpc.msg.ts index b0b9ea1..1734cd7 100644 --- a/src/codegen/cosmos/crisis/v1beta1/tx.rpc.msg.ts +++ b/src/codegen/cosmos/crisis/v1beta1/tx.rpc.msg.ts @@ -1,20 +1,33 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; -import { MsgVerifyInvariant, MsgVerifyInvariantResponse } from "./tx"; +import { MsgVerifyInvariant, MsgVerifyInvariantResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; /** Msg defines the bank Msg service. */ export interface Msg { - /** VerifyInvariant defines a method to verify a particular invariance. */ + /** VerifyInvariant defines a method to verify a particular invariant. */ verifyInvariant(request: MsgVerifyInvariant): Promise; + /** + * UpdateParams defines a governance operation for updating the x/crisis module + * parameters. The authority is defined in the keeper. + * + * Since: cosmos-sdk 0.47 + */ + updateParams(request: MsgUpdateParams): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; this.verifyInvariant = this.verifyInvariant.bind(this); + this.updateParams = this.updateParams.bind(this); } verifyInvariant(request: MsgVerifyInvariant): Promise { const data = MsgVerifyInvariant.encode(request).finish(); const promise = this.rpc.request("cosmos.crisis.v1beta1.Msg", "VerifyInvariant", data); return promise.then(data => MsgVerifyInvariantResponse.decode(new BinaryReader(data))); } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("cosmos.crisis.v1beta1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } } \ No newline at end of file diff --git a/src/codegen/cosmos/crisis/v1beta1/tx.ts b/src/codegen/cosmos/crisis/v1beta1/tx.ts index 3eb4e4d..60bce3e 100644 --- a/src/codegen/cosmos/crisis/v1beta1/tx.ts +++ b/src/codegen/cosmos/crisis/v1beta1/tx.ts @@ -1,8 +1,12 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; /** MsgVerifyInvariant represents a message to verify a particular invariance. */ export interface MsgVerifyInvariant { + /** sender is the account address of private key to send coins to fee collector account. */ sender: string; + /** name of the invariant module. */ invariantModuleName: string; + /** invariant_route is the msg's invariant route. */ invariantRoute: string; } export interface MsgVerifyInvariantProtoMsg { @@ -11,8 +15,11 @@ export interface MsgVerifyInvariantProtoMsg { } /** MsgVerifyInvariant represents a message to verify a particular invariance. */ export interface MsgVerifyInvariantAmino { + /** sender is the account address of private key to send coins to fee collector account. */ sender?: string; + /** name of the invariant module. */ invariant_module_name?: string; + /** invariant_route is the msg's invariant route. */ invariant_route?: string; } export interface MsgVerifyInvariantAminoMsg { @@ -39,6 +46,74 @@ export interface MsgVerifyInvariantResponseAminoMsg { } /** MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. */ export interface MsgVerifyInvariantResponseSDKType {} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** constant_fee defines the x/crisis parameter. */ + constantFee: Coin; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/cosmos.crisis.v1beta1.MsgUpdateParams"; + value: Uint8Array; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; + /** constant_fee defines the x/crisis parameter. */ + constant_fee: CoinAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/x/crisis/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsSDKType { + authority: string; + constant_fee: CoinSDKType; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/cosmos.crisis.v1beta1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseSDKType {} function createBaseMsgVerifyInvariant(): MsgVerifyInvariant { return { sender: "", @@ -187,4 +262,141 @@ export const MsgVerifyInvariantResponse = { value: MsgVerifyInvariantResponse.encode(message).finish() }; } +}; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + constantFee: Coin.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/cosmos.crisis.v1beta1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.constantFee !== undefined) { + Coin.encode(message.constantFee, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.constantFee = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.constantFee = object.constantFee !== undefined && object.constantFee !== null ? Coin.fromPartial(object.constantFee) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.constant_fee !== undefined && object.constant_fee !== null) { + message.constantFee = Coin.fromAmino(object.constant_fee); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.constant_fee = message.constantFee ? Coin.toAmino(message.constantFee) : Coin.toAmino(Coin.fromPartial({})); + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/x/crisis/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/cosmos.crisis.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/cosmos.crisis.v1beta1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/cosmos.crisis.v1beta1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/src/codegen/cosmos/crypto/ed25519/keys.ts b/src/codegen/cosmos/crypto/ed25519/keys.ts index 39040bb..b1a1080 100644 --- a/src/codegen/cosmos/crypto/ed25519/keys.ts +++ b/src/codegen/cosmos/crypto/ed25519/keys.ts @@ -25,7 +25,7 @@ export interface PubKeyAmino { key?: string; } export interface PubKeyAminoMsg { - type: "cosmos-sdk/PubKey"; + type: "tendermint/PubKeyEd25519"; value: PubKeyAmino; } /** @@ -39,7 +39,7 @@ export interface PubKeySDKType { key: Uint8Array; } /** - * Deprecated: PrivKey defines a ed25519 private key. + * PrivKey defines a ed25519 private key. * NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context. */ export interface PrivKey { @@ -50,18 +50,18 @@ export interface PrivKeyProtoMsg { value: Uint8Array; } /** - * Deprecated: PrivKey defines a ed25519 private key. + * PrivKey defines a ed25519 private key. * NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context. */ export interface PrivKeyAmino { key?: string; } export interface PrivKeyAminoMsg { - type: "cosmos-sdk/PrivKey"; + type: "tendermint/PrivKeyEd25519"; value: PrivKeyAmino; } /** - * Deprecated: PrivKey defines a ed25519 private key. + * PrivKey defines a ed25519 private key. * NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context. */ export interface PrivKeySDKType { @@ -119,7 +119,7 @@ export const PubKey = { }, toAminoMsg(message: PubKey): PubKeyAminoMsg { return { - type: "cosmos-sdk/PubKey", + type: "tendermint/PubKeyEd25519", value: PubKey.toAmino(message) }; }, @@ -188,7 +188,7 @@ export const PrivKey = { }, toAminoMsg(message: PrivKey): PrivKeyAminoMsg { return { - type: "cosmos-sdk/PrivKey", + type: "tendermint/PrivKeyEd25519", value: PrivKey.toAmino(message) }; }, diff --git a/src/codegen/cosmos/crypto/hd/v1/hd.ts b/src/codegen/cosmos/crypto/hd/v1/hd.ts new file mode 100644 index 0000000..a2a3dda --- /dev/null +++ b/src/codegen/cosmos/crypto/hd/v1/hd.ts @@ -0,0 +1,166 @@ +import { BinaryReader, BinaryWriter } from "../../../../binary"; +/** BIP44Params is used as path field in ledger item in Record. */ +export interface BIP44Params { + /** purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation */ + purpose: number; + /** coin_type is a constant that improves privacy */ + coinType: number; + /** account splits the key space into independent user identities */ + account: number; + /** + * change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal + * chain. + */ + change: boolean; + /** address_index is used as child index in BIP32 derivation */ + addressIndex: number; +} +export interface BIP44ParamsProtoMsg { + typeUrl: "/cosmos.crypto.hd.v1.BIP44Params"; + value: Uint8Array; +} +/** BIP44Params is used as path field in ledger item in Record. */ +export interface BIP44ParamsAmino { + /** purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation */ + purpose?: number; + /** coin_type is a constant that improves privacy */ + coin_type?: number; + /** account splits the key space into independent user identities */ + account?: number; + /** + * change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal + * chain. + */ + change?: boolean; + /** address_index is used as child index in BIP32 derivation */ + address_index?: number; +} +export interface BIP44ParamsAminoMsg { + type: "crypto/keys/hd/BIP44Params"; + value: BIP44ParamsAmino; +} +/** BIP44Params is used as path field in ledger item in Record. */ +export interface BIP44ParamsSDKType { + purpose: number; + coin_type: number; + account: number; + change: boolean; + address_index: number; +} +function createBaseBIP44Params(): BIP44Params { + return { + purpose: 0, + coinType: 0, + account: 0, + change: false, + addressIndex: 0 + }; +} +export const BIP44Params = { + typeUrl: "/cosmos.crypto.hd.v1.BIP44Params", + encode(message: BIP44Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.purpose !== 0) { + writer.uint32(8).uint32(message.purpose); + } + if (message.coinType !== 0) { + writer.uint32(16).uint32(message.coinType); + } + if (message.account !== 0) { + writer.uint32(24).uint32(message.account); + } + if (message.change === true) { + writer.uint32(32).bool(message.change); + } + if (message.addressIndex !== 0) { + writer.uint32(40).uint32(message.addressIndex); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BIP44Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBIP44Params(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.purpose = reader.uint32(); + break; + case 2: + message.coinType = reader.uint32(); + break; + case 3: + message.account = reader.uint32(); + break; + case 4: + message.change = reader.bool(); + break; + case 5: + message.addressIndex = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BIP44Params { + const message = createBaseBIP44Params(); + message.purpose = object.purpose ?? 0; + message.coinType = object.coinType ?? 0; + message.account = object.account ?? 0; + message.change = object.change ?? false; + message.addressIndex = object.addressIndex ?? 0; + return message; + }, + fromAmino(object: BIP44ParamsAmino): BIP44Params { + const message = createBaseBIP44Params(); + if (object.purpose !== undefined && object.purpose !== null) { + message.purpose = object.purpose; + } + if (object.coin_type !== undefined && object.coin_type !== null) { + message.coinType = object.coin_type; + } + if (object.account !== undefined && object.account !== null) { + message.account = object.account; + } + if (object.change !== undefined && object.change !== null) { + message.change = object.change; + } + if (object.address_index !== undefined && object.address_index !== null) { + message.addressIndex = object.address_index; + } + return message; + }, + toAmino(message: BIP44Params): BIP44ParamsAmino { + const obj: any = {}; + obj.purpose = message.purpose === 0 ? undefined : message.purpose; + obj.coin_type = message.coinType === 0 ? undefined : message.coinType; + obj.account = message.account === 0 ? undefined : message.account; + obj.change = message.change === false ? undefined : message.change; + obj.address_index = message.addressIndex === 0 ? undefined : message.addressIndex; + return obj; + }, + fromAminoMsg(object: BIP44ParamsAminoMsg): BIP44Params { + return BIP44Params.fromAmino(object.value); + }, + toAminoMsg(message: BIP44Params): BIP44ParamsAminoMsg { + return { + type: "crypto/keys/hd/BIP44Params", + value: BIP44Params.toAmino(message) + }; + }, + fromProtoMsg(message: BIP44ParamsProtoMsg): BIP44Params { + return BIP44Params.decode(message.value); + }, + toProto(message: BIP44Params): Uint8Array { + return BIP44Params.encode(message).finish(); + }, + toProtoMsg(message: BIP44Params): BIP44ParamsProtoMsg { + return { + typeUrl: "/cosmos.crypto.hd.v1.BIP44Params", + value: BIP44Params.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/crypto/keyring/v1/record.ts b/src/codegen/cosmos/crypto/keyring/v1/record.ts new file mode 100644 index 0000000..64913d1 --- /dev/null +++ b/src/codegen/cosmos/crypto/keyring/v1/record.ts @@ -0,0 +1,506 @@ +import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { BIP44Params, BIP44ParamsAmino, BIP44ParamsSDKType } from "../../hd/v1/hd"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +/** Record is used for representing a key in the keyring. */ +export interface Record { + /** name represents a name of Record */ + name: string; + /** pub_key represents a public key in any format */ + pubKey?: Any; + /** local stores the private key locally. */ + local?: Record_Local; + /** ledger stores the information about a Ledger key. */ + ledger?: Record_Ledger; + /** Multi does not store any other information. */ + multi?: Record_Multi; + /** Offline does not store any other information. */ + offline?: Record_Offline; +} +export interface RecordProtoMsg { + typeUrl: "/cosmos.crypto.keyring.v1.Record"; + value: Uint8Array; +} +/** Record is used for representing a key in the keyring. */ +export interface RecordAmino { + /** name represents a name of Record */ + name?: string; + /** pub_key represents a public key in any format */ + pub_key?: AnyAmino; + /** local stores the private key locally. */ + local?: Record_LocalAmino; + /** ledger stores the information about a Ledger key. */ + ledger?: Record_LedgerAmino; + /** Multi does not store any other information. */ + multi?: Record_MultiAmino; + /** Offline does not store any other information. */ + offline?: Record_OfflineAmino; +} +export interface RecordAminoMsg { + type: "cosmos-sdk/Record"; + value: RecordAmino; +} +/** Record is used for representing a key in the keyring. */ +export interface RecordSDKType { + name: string; + pub_key?: AnySDKType; + local?: Record_LocalSDKType; + ledger?: Record_LedgerSDKType; + multi?: Record_MultiSDKType; + offline?: Record_OfflineSDKType; +} +/** + * Item is a keyring item stored in a keyring backend. + * Local item + */ +export interface Record_Local { + privKey?: Any; +} +export interface Record_LocalProtoMsg { + typeUrl: "/cosmos.crypto.keyring.v1.Local"; + value: Uint8Array; +} +/** + * Item is a keyring item stored in a keyring backend. + * Local item + */ +export interface Record_LocalAmino { + priv_key?: AnyAmino; +} +export interface Record_LocalAminoMsg { + type: "cosmos-sdk/Local"; + value: Record_LocalAmino; +} +/** + * Item is a keyring item stored in a keyring backend. + * Local item + */ +export interface Record_LocalSDKType { + priv_key?: AnySDKType; +} +/** Ledger item */ +export interface Record_Ledger { + path?: BIP44Params; +} +export interface Record_LedgerProtoMsg { + typeUrl: "/cosmos.crypto.keyring.v1.Ledger"; + value: Uint8Array; +} +/** Ledger item */ +export interface Record_LedgerAmino { + path?: BIP44ParamsAmino; +} +export interface Record_LedgerAminoMsg { + type: "cosmos-sdk/Ledger"; + value: Record_LedgerAmino; +} +/** Ledger item */ +export interface Record_LedgerSDKType { + path?: BIP44ParamsSDKType; +} +/** Multi item */ +export interface Record_Multi {} +export interface Record_MultiProtoMsg { + typeUrl: "/cosmos.crypto.keyring.v1.Multi"; + value: Uint8Array; +} +/** Multi item */ +export interface Record_MultiAmino {} +export interface Record_MultiAminoMsg { + type: "cosmos-sdk/Multi"; + value: Record_MultiAmino; +} +/** Multi item */ +export interface Record_MultiSDKType {} +/** Offline item */ +export interface Record_Offline {} +export interface Record_OfflineProtoMsg { + typeUrl: "/cosmos.crypto.keyring.v1.Offline"; + value: Uint8Array; +} +/** Offline item */ +export interface Record_OfflineAmino {} +export interface Record_OfflineAminoMsg { + type: "cosmos-sdk/Offline"; + value: Record_OfflineAmino; +} +/** Offline item */ +export interface Record_OfflineSDKType {} +function createBaseRecord(): Record { + return { + name: "", + pubKey: undefined, + local: undefined, + ledger: undefined, + multi: undefined, + offline: undefined + }; +} +export const Record = { + typeUrl: "/cosmos.crypto.keyring.v1.Record", + encode(message: Record, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.pubKey !== undefined) { + Any.encode(message.pubKey, writer.uint32(18).fork()).ldelim(); + } + if (message.local !== undefined) { + Record_Local.encode(message.local, writer.uint32(26).fork()).ldelim(); + } + if (message.ledger !== undefined) { + Record_Ledger.encode(message.ledger, writer.uint32(34).fork()).ldelim(); + } + if (message.multi !== undefined) { + Record_Multi.encode(message.multi, writer.uint32(42).fork()).ldelim(); + } + if (message.offline !== undefined) { + Record_Offline.encode(message.offline, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Record { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRecord(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.pubKey = Any.decode(reader, reader.uint32()); + break; + case 3: + message.local = Record_Local.decode(reader, reader.uint32()); + break; + case 4: + message.ledger = Record_Ledger.decode(reader, reader.uint32()); + break; + case 5: + message.multi = Record_Multi.decode(reader, reader.uint32()); + break; + case 6: + message.offline = Record_Offline.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Record { + const message = createBaseRecord(); + message.name = object.name ?? ""; + message.pubKey = object.pubKey !== undefined && object.pubKey !== null ? Any.fromPartial(object.pubKey) : undefined; + message.local = object.local !== undefined && object.local !== null ? Record_Local.fromPartial(object.local) : undefined; + message.ledger = object.ledger !== undefined && object.ledger !== null ? Record_Ledger.fromPartial(object.ledger) : undefined; + message.multi = object.multi !== undefined && object.multi !== null ? Record_Multi.fromPartial(object.multi) : undefined; + message.offline = object.offline !== undefined && object.offline !== null ? Record_Offline.fromPartial(object.offline) : undefined; + return message; + }, + fromAmino(object: RecordAmino): Record { + const message = createBaseRecord(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.pub_key !== undefined && object.pub_key !== null) { + message.pubKey = Any.fromAmino(object.pub_key); + } + if (object.local !== undefined && object.local !== null) { + message.local = Record_Local.fromAmino(object.local); + } + if (object.ledger !== undefined && object.ledger !== null) { + message.ledger = Record_Ledger.fromAmino(object.ledger); + } + if (object.multi !== undefined && object.multi !== null) { + message.multi = Record_Multi.fromAmino(object.multi); + } + if (object.offline !== undefined && object.offline !== null) { + message.offline = Record_Offline.fromAmino(object.offline); + } + return message; + }, + toAmino(message: Record): RecordAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.pub_key = message.pubKey ? Any.toAmino(message.pubKey) : undefined; + obj.local = message.local ? Record_Local.toAmino(message.local) : undefined; + obj.ledger = message.ledger ? Record_Ledger.toAmino(message.ledger) : undefined; + obj.multi = message.multi ? Record_Multi.toAmino(message.multi) : undefined; + obj.offline = message.offline ? Record_Offline.toAmino(message.offline) : undefined; + return obj; + }, + fromAminoMsg(object: RecordAminoMsg): Record { + return Record.fromAmino(object.value); + }, + toAminoMsg(message: Record): RecordAminoMsg { + return { + type: "cosmos-sdk/Record", + value: Record.toAmino(message) + }; + }, + fromProtoMsg(message: RecordProtoMsg): Record { + return Record.decode(message.value); + }, + toProto(message: Record): Uint8Array { + return Record.encode(message).finish(); + }, + toProtoMsg(message: Record): RecordProtoMsg { + return { + typeUrl: "/cosmos.crypto.keyring.v1.Record", + value: Record.encode(message).finish() + }; + } +}; +function createBaseRecord_Local(): Record_Local { + return { + privKey: undefined + }; +} +export const Record_Local = { + typeUrl: "/cosmos.crypto.keyring.v1.Local", + encode(message: Record_Local, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.privKey !== undefined) { + Any.encode(message.privKey, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Record_Local { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRecord_Local(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.privKey = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Record_Local { + const message = createBaseRecord_Local(); + message.privKey = object.privKey !== undefined && object.privKey !== null ? Any.fromPartial(object.privKey) : undefined; + return message; + }, + fromAmino(object: Record_LocalAmino): Record_Local { + const message = createBaseRecord_Local(); + if (object.priv_key !== undefined && object.priv_key !== null) { + message.privKey = Any.fromAmino(object.priv_key); + } + return message; + }, + toAmino(message: Record_Local): Record_LocalAmino { + const obj: any = {}; + obj.priv_key = message.privKey ? Any.toAmino(message.privKey) : undefined; + return obj; + }, + fromAminoMsg(object: Record_LocalAminoMsg): Record_Local { + return Record_Local.fromAmino(object.value); + }, + toAminoMsg(message: Record_Local): Record_LocalAminoMsg { + return { + type: "cosmos-sdk/Local", + value: Record_Local.toAmino(message) + }; + }, + fromProtoMsg(message: Record_LocalProtoMsg): Record_Local { + return Record_Local.decode(message.value); + }, + toProto(message: Record_Local): Uint8Array { + return Record_Local.encode(message).finish(); + }, + toProtoMsg(message: Record_Local): Record_LocalProtoMsg { + return { + typeUrl: "/cosmos.crypto.keyring.v1.Local", + value: Record_Local.encode(message).finish() + }; + } +}; +function createBaseRecord_Ledger(): Record_Ledger { + return { + path: undefined + }; +} +export const Record_Ledger = { + typeUrl: "/cosmos.crypto.keyring.v1.Ledger", + encode(message: Record_Ledger, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.path !== undefined) { + BIP44Params.encode(message.path, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Record_Ledger { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRecord_Ledger(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = BIP44Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Record_Ledger { + const message = createBaseRecord_Ledger(); + message.path = object.path !== undefined && object.path !== null ? BIP44Params.fromPartial(object.path) : undefined; + return message; + }, + fromAmino(object: Record_LedgerAmino): Record_Ledger { + const message = createBaseRecord_Ledger(); + if (object.path !== undefined && object.path !== null) { + message.path = BIP44Params.fromAmino(object.path); + } + return message; + }, + toAmino(message: Record_Ledger): Record_LedgerAmino { + const obj: any = {}; + obj.path = message.path ? BIP44Params.toAmino(message.path) : undefined; + return obj; + }, + fromAminoMsg(object: Record_LedgerAminoMsg): Record_Ledger { + return Record_Ledger.fromAmino(object.value); + }, + toAminoMsg(message: Record_Ledger): Record_LedgerAminoMsg { + return { + type: "cosmos-sdk/Ledger", + value: Record_Ledger.toAmino(message) + }; + }, + fromProtoMsg(message: Record_LedgerProtoMsg): Record_Ledger { + return Record_Ledger.decode(message.value); + }, + toProto(message: Record_Ledger): Uint8Array { + return Record_Ledger.encode(message).finish(); + }, + toProtoMsg(message: Record_Ledger): Record_LedgerProtoMsg { + return { + typeUrl: "/cosmos.crypto.keyring.v1.Ledger", + value: Record_Ledger.encode(message).finish() + }; + } +}; +function createBaseRecord_Multi(): Record_Multi { + return {}; +} +export const Record_Multi = { + typeUrl: "/cosmos.crypto.keyring.v1.Multi", + encode(_: Record_Multi, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Record_Multi { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRecord_Multi(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): Record_Multi { + const message = createBaseRecord_Multi(); + return message; + }, + fromAmino(_: Record_MultiAmino): Record_Multi { + const message = createBaseRecord_Multi(); + return message; + }, + toAmino(_: Record_Multi): Record_MultiAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: Record_MultiAminoMsg): Record_Multi { + return Record_Multi.fromAmino(object.value); + }, + toAminoMsg(message: Record_Multi): Record_MultiAminoMsg { + return { + type: "cosmos-sdk/Multi", + value: Record_Multi.toAmino(message) + }; + }, + fromProtoMsg(message: Record_MultiProtoMsg): Record_Multi { + return Record_Multi.decode(message.value); + }, + toProto(message: Record_Multi): Uint8Array { + return Record_Multi.encode(message).finish(); + }, + toProtoMsg(message: Record_Multi): Record_MultiProtoMsg { + return { + typeUrl: "/cosmos.crypto.keyring.v1.Multi", + value: Record_Multi.encode(message).finish() + }; + } +}; +function createBaseRecord_Offline(): Record_Offline { + return {}; +} +export const Record_Offline = { + typeUrl: "/cosmos.crypto.keyring.v1.Offline", + encode(_: Record_Offline, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Record_Offline { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRecord_Offline(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): Record_Offline { + const message = createBaseRecord_Offline(); + return message; + }, + fromAmino(_: Record_OfflineAmino): Record_Offline { + const message = createBaseRecord_Offline(); + return message; + }, + toAmino(_: Record_Offline): Record_OfflineAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: Record_OfflineAminoMsg): Record_Offline { + return Record_Offline.fromAmino(object.value); + }, + toAminoMsg(message: Record_Offline): Record_OfflineAminoMsg { + return { + type: "cosmos-sdk/Offline", + value: Record_Offline.toAmino(message) + }; + }, + fromProtoMsg(message: Record_OfflineProtoMsg): Record_Offline { + return Record_Offline.decode(message.value); + }, + toProto(message: Record_Offline): Uint8Array { + return Record_Offline.encode(message).finish(); + }, + toProtoMsg(message: Record_Offline): Record_OfflineProtoMsg { + return { + typeUrl: "/cosmos.crypto.keyring.v1.Offline", + value: Record_Offline.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/crypto/multisig/keys.ts b/src/codegen/cosmos/crypto/multisig/keys.ts index 6c3cce7..4350423 100644 --- a/src/codegen/cosmos/crypto/multisig/keys.ts +++ b/src/codegen/cosmos/crypto/multisig/keys.ts @@ -23,7 +23,7 @@ export interface LegacyAminoPubKeyAmino { public_keys?: AnyAmino[]; } export interface LegacyAminoPubKeyAminoMsg { - type: "cosmos-sdk/LegacyAminoPubKey"; + type: "tendermint/PubKeyMultisigThreshold"; value: LegacyAminoPubKeyAmino; } /** @@ -101,7 +101,7 @@ export const LegacyAminoPubKey = { }, toAminoMsg(message: LegacyAminoPubKey): LegacyAminoPubKeyAminoMsg { return { - type: "cosmos-sdk/LegacyAminoPubKey", + type: "tendermint/PubKeyMultisigThreshold", value: LegacyAminoPubKey.toAmino(message) }; }, diff --git a/src/codegen/cosmos/crypto/secp256k1/keys.ts b/src/codegen/cosmos/crypto/secp256k1/keys.ts index 1451cc8..24433ee 100644 --- a/src/codegen/cosmos/crypto/secp256k1/keys.ts +++ b/src/codegen/cosmos/crypto/secp256k1/keys.ts @@ -25,7 +25,7 @@ export interface PubKeyAmino { key?: string; } export interface PubKeyAminoMsg { - type: "cosmos-sdk/PubKey"; + type: "tendermint/PubKeySecp256k1"; value: PubKeyAmino; } /** @@ -51,7 +51,7 @@ export interface PrivKeyAmino { key?: string; } export interface PrivKeyAminoMsg { - type: "cosmos-sdk/PrivKey"; + type: "tendermint/PrivKeySecp256k1"; value: PrivKeyAmino; } /** PrivKey defines a secp256k1 private key. */ @@ -110,7 +110,7 @@ export const PubKey = { }, toAminoMsg(message: PubKey): PubKeyAminoMsg { return { - type: "cosmos-sdk/PubKey", + type: "tendermint/PubKeySecp256k1", value: PubKey.toAmino(message) }; }, @@ -179,7 +179,7 @@ export const PrivKey = { }, toAminoMsg(message: PrivKey): PrivKeyAminoMsg { return { - type: "cosmos-sdk/PrivKey", + type: "tendermint/PrivKeySecp256k1", value: PrivKey.toAmino(message) }; }, diff --git a/src/codegen/cosmos/distribution/v1beta1/distribution.ts b/src/codegen/cosmos/distribution/v1beta1/distribution.ts index 2b1c575..d95e059 100644 --- a/src/codegen/cosmos/distribution/v1beta1/distribution.ts +++ b/src/codegen/cosmos/distribution/v1beta1/distribution.ts @@ -4,7 +4,17 @@ import { Decimal } from "@cosmjs/math"; /** Params defines the set of params for the distribution module. */ export interface Params { communityTax: string; + /** + * Deprecated: The base_proposer_reward field is deprecated and is no longer used + * in the x/distribution module's reward mechanism. + */ + /** @deprecated */ baseProposerReward: string; + /** + * Deprecated: The bonus_proposer_reward field is deprecated and is no longer used + * in the x/distribution module's reward mechanism. + */ + /** @deprecated */ bonusProposerReward: string; withdrawAddrEnabled: boolean; } @@ -14,19 +24,31 @@ export interface ParamsProtoMsg { } /** Params defines the set of params for the distribution module. */ export interface ParamsAmino { - community_tax?: string; - base_proposer_reward?: string; - bonus_proposer_reward?: string; + community_tax: string; + /** + * Deprecated: The base_proposer_reward field is deprecated and is no longer used + * in the x/distribution module's reward mechanism. + */ + /** @deprecated */ + base_proposer_reward: string; + /** + * Deprecated: The bonus_proposer_reward field is deprecated and is no longer used + * in the x/distribution module's reward mechanism. + */ + /** @deprecated */ + bonus_proposer_reward: string; withdraw_addr_enabled?: boolean; } export interface ParamsAminoMsg { - type: "cosmos-sdk/Params"; + type: "cosmos-sdk/x/distribution/Params"; value: ParamsAmino; } /** Params defines the set of params for the distribution module. */ export interface ParamsSDKType { community_tax: string; + /** @deprecated */ base_proposer_reward: string; + /** @deprecated */ bonus_proposer_reward: string; withdraw_addr_enabled: boolean; } @@ -67,7 +89,7 @@ export interface ValidatorHistoricalRewardsProtoMsg { * + one per validator for the zeroeth period, set on initialization */ export interface ValidatorHistoricalRewardsAmino { - cumulative_reward_ratio?: DecCoinAmino[]; + cumulative_reward_ratio: DecCoinAmino[]; reference_count?: number; } export interface ValidatorHistoricalRewardsAminoMsg { @@ -111,7 +133,7 @@ export interface ValidatorCurrentRewardsProtoMsg { * each block as long as the validator's tokens remain constant. */ export interface ValidatorCurrentRewardsAmino { - rewards?: DecCoinAmino[]; + rewards: DecCoinAmino[]; period?: string; } export interface ValidatorCurrentRewardsAminoMsg { @@ -143,7 +165,7 @@ export interface ValidatorAccumulatedCommissionProtoMsg { * for a validator kept as a running counter, can be withdrawn at any time. */ export interface ValidatorAccumulatedCommissionAmino { - commission?: DecCoinAmino[]; + commission: DecCoinAmino[]; } export interface ValidatorAccumulatedCommissionAminoMsg { type: "cosmos-sdk/ValidatorAccumulatedCommission"; @@ -172,7 +194,7 @@ export interface ValidatorOutstandingRewardsProtoMsg { * for a validator inexpensive to track, allows simple sanity checks. */ export interface ValidatorOutstandingRewardsAmino { - rewards?: DecCoinAmino[]; + rewards: DecCoinAmino[]; } export interface ValidatorOutstandingRewardsAminoMsg { type: "cosmos-sdk/ValidatorOutstandingRewards"; @@ -233,7 +255,7 @@ export interface ValidatorSlashEventsProtoMsg { } /** ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. */ export interface ValidatorSlashEventsAmino { - validator_slash_events?: ValidatorSlashEventAmino[]; + validator_slash_events: ValidatorSlashEventAmino[]; } export interface ValidatorSlashEventsAminoMsg { type: "cosmos-sdk/ValidatorSlashEvents"; @@ -253,7 +275,7 @@ export interface FeePoolProtoMsg { } /** FeePool is the global fee pool for distribution. */ export interface FeePoolAmino { - community_pool?: DecCoinAmino[]; + community_pool: DecCoinAmino[]; } export interface FeePoolAminoMsg { type: "cosmos-sdk/FeePool"; @@ -267,7 +289,13 @@ export interface FeePoolSDKType { * CommunityPoolSpendProposal details a proposal for use of community funds, * together with how many coins are proposed to be spent, and to which * recipient account. + * + * Deprecated: Do not use. As of the Cosmos SDK release v0.47.x, there is no + * longer a need for an explicit CommunityPoolSpendProposal. To spend community + * pool funds, a simple MsgCommunityPoolSpend can be invoked from the x/gov + * module via a v1 governance proposal. */ +/** @deprecated */ export interface CommunityPoolSpendProposal { title: string; description: string; @@ -282,12 +310,18 @@ export interface CommunityPoolSpendProposalProtoMsg { * CommunityPoolSpendProposal details a proposal for use of community funds, * together with how many coins are proposed to be spent, and to which * recipient account. + * + * Deprecated: Do not use. As of the Cosmos SDK release v0.47.x, there is no + * longer a need for an explicit CommunityPoolSpendProposal. To spend community + * pool funds, a simple MsgCommunityPoolSpend can be invoked from the x/gov + * module via a v1 governance proposal. */ +/** @deprecated */ export interface CommunityPoolSpendProposalAmino { title?: string; description?: string; recipient?: string; - amount?: CoinAmino[]; + amount: CoinAmino[]; } export interface CommunityPoolSpendProposalAminoMsg { type: "cosmos-sdk/CommunityPoolSpendProposal"; @@ -297,7 +331,13 @@ export interface CommunityPoolSpendProposalAminoMsg { * CommunityPoolSpendProposal details a proposal for use of community funds, * together with how many coins are proposed to be spent, and to which * recipient account. + * + * Deprecated: Do not use. As of the Cosmos SDK release v0.47.x, there is no + * longer a need for an explicit CommunityPoolSpendProposal. To spend community + * pool funds, a simple MsgCommunityPoolSpend can be invoked from the x/gov + * module via a v1 governance proposal. */ +/** @deprecated */ export interface CommunityPoolSpendProposalSDKType { title: string; description: string; @@ -331,7 +371,7 @@ export interface DelegatorStartingInfoProtoMsg { */ export interface DelegatorStartingInfoAmino { previous_period?: string; - stake?: string; + stake: string; height: string; } export interface DelegatorStartingInfoAminoMsg { @@ -369,7 +409,7 @@ export interface DelegationDelegatorRewardProtoMsg { */ export interface DelegationDelegatorRewardAmino { validator_address?: string; - reward?: DecCoinAmino[]; + reward: DecCoinAmino[]; } export interface DelegationDelegatorRewardAminoMsg { type: "cosmos-sdk/DelegationDelegatorReward"; @@ -501,9 +541,9 @@ export const Params = { }, toAmino(message: Params): ParamsAmino { const obj: any = {}; - obj.community_tax = message.communityTax === "" ? undefined : message.communityTax; - obj.base_proposer_reward = message.baseProposerReward === "" ? undefined : message.baseProposerReward; - obj.bonus_proposer_reward = message.bonusProposerReward === "" ? undefined : message.bonusProposerReward; + obj.community_tax = message.communityTax ?? ""; + obj.base_proposer_reward = message.baseProposerReward ?? ""; + obj.bonus_proposer_reward = message.bonusProposerReward ?? ""; obj.withdraw_addr_enabled = message.withdrawAddrEnabled === false ? undefined : message.withdrawAddrEnabled; return obj; }, @@ -512,7 +552,7 @@ export const Params = { }, toAminoMsg(message: Params): ParamsAminoMsg { return { - type: "cosmos-sdk/Params", + type: "cosmos-sdk/x/distribution/Params", value: Params.toAmino(message) }; }, @@ -1234,7 +1274,7 @@ export const DelegatorStartingInfo = { toAmino(message: DelegatorStartingInfo): DelegatorStartingInfoAmino { const obj: any = {}; obj.previous_period = message.previousPeriod !== BigInt(0) ? message.previousPeriod.toString() : undefined; - obj.stake = message.stake === "" ? undefined : message.stake; + obj.stake = message.stake ?? ""; obj.height = message.height ? message.height.toString() : "0"; return obj; }, diff --git a/src/codegen/cosmos/distribution/v1beta1/genesis.ts b/src/codegen/cosmos/distribution/v1beta1/genesis.ts index ca53865..2174d36 100644 --- a/src/codegen/cosmos/distribution/v1beta1/genesis.ts +++ b/src/codegen/cosmos/distribution/v1beta1/genesis.ts @@ -44,7 +44,7 @@ export interface DelegatorWithdrawInfoSDKType { export interface ValidatorOutstandingRewardsRecord { /** validator_address is the address of the validator. */ validatorAddress: string; - /** outstanding_rewards represents the oustanding rewards of a validator. */ + /** outstanding_rewards represents the outstanding rewards of a validator. */ outstandingRewards: DecCoin[]; } export interface ValidatorOutstandingRewardsRecordProtoMsg { @@ -55,8 +55,8 @@ export interface ValidatorOutstandingRewardsRecordProtoMsg { export interface ValidatorOutstandingRewardsRecordAmino { /** validator_address is the address of the validator. */ validator_address?: string; - /** outstanding_rewards represents the oustanding rewards of a validator. */ - outstanding_rewards?: DecCoinAmino[]; + /** outstanding_rewards represents the outstanding rewards of a validator. */ + outstanding_rewards: DecCoinAmino[]; } export interface ValidatorOutstandingRewardsRecordAminoMsg { type: "cosmos-sdk/ValidatorOutstandingRewardsRecord"; @@ -89,7 +89,7 @@ export interface ValidatorAccumulatedCommissionRecordAmino { /** validator_address is the address of the validator. */ validator_address?: string; /** accumulated is the accumulated commission of a validator. */ - accumulated?: ValidatorAccumulatedCommissionAmino; + accumulated: ValidatorAccumulatedCommissionAmino; } export interface ValidatorAccumulatedCommissionRecordAminoMsg { type: "cosmos-sdk/ValidatorAccumulatedCommissionRecord"; @@ -129,7 +129,7 @@ export interface ValidatorHistoricalRewardsRecordAmino { /** period defines the period the historical rewards apply to. */ period?: string; /** rewards defines the historical rewards of a validator. */ - rewards?: ValidatorHistoricalRewardsAmino; + rewards: ValidatorHistoricalRewardsAmino; } export interface ValidatorHistoricalRewardsRecordAminoMsg { type: "cosmos-sdk/ValidatorHistoricalRewardsRecord"; @@ -160,7 +160,7 @@ export interface ValidatorCurrentRewardsRecordAmino { /** validator_address is the address of the validator. */ validator_address?: string; /** rewards defines the current rewards of a validator. */ - rewards?: ValidatorCurrentRewardsAmino; + rewards: ValidatorCurrentRewardsAmino; } export interface ValidatorCurrentRewardsRecordAminoMsg { type: "cosmos-sdk/ValidatorCurrentRewardsRecord"; @@ -191,7 +191,7 @@ export interface DelegatorStartingInfoRecordAmino { /** validator_address is the address of the validator. */ validator_address?: string; /** starting_info defines the starting info of a delegator. */ - starting_info?: DelegatorStartingInfoAmino; + starting_info: DelegatorStartingInfoAmino; } export interface DelegatorStartingInfoRecordAminoMsg { type: "cosmos-sdk/DelegatorStartingInfoRecord"; @@ -207,7 +207,7 @@ export interface DelegatorStartingInfoRecordSDKType { export interface ValidatorSlashEventRecord { /** validator_address is the address of the validator. */ validatorAddress: string; - /** height defines the block height at which the slash event occured. */ + /** height defines the block height at which the slash event occurred. */ height: bigint; /** period is the period of the slash event. */ period: bigint; @@ -222,12 +222,12 @@ export interface ValidatorSlashEventRecordProtoMsg { export interface ValidatorSlashEventRecordAmino { /** validator_address is the address of the validator. */ validator_address?: string; - /** height defines the block height at which the slash event occured. */ + /** height defines the block height at which the slash event occurred. */ height?: string; /** period is the period of the slash event. */ period?: string; /** validator_slash_event describes the slash event. */ - validator_slash_event?: ValidatorSlashEventAmino; + validator_slash_event: ValidatorSlashEventAmino; } export interface ValidatorSlashEventRecordAminoMsg { type: "cosmos-sdk/ValidatorSlashEventRecord"; @@ -242,7 +242,7 @@ export interface ValidatorSlashEventRecordSDKType { } /** GenesisState defines the distribution module's genesis state. */ export interface GenesisState { - /** params defines all the paramaters of the module. */ + /** params defines all the parameters of the module. */ params: Params; /** fee_pool defines the fee pool at genesis. */ feePool: FeePool; @@ -252,7 +252,7 @@ export interface GenesisState { previousProposer: string; /** fee_pool defines the outstanding rewards of all validators at genesis. */ outstandingRewards: ValidatorOutstandingRewardsRecord[]; - /** fee_pool defines the accumulated commisions of all validators at genesis. */ + /** fee_pool defines the accumulated commissions of all validators at genesis. */ validatorAccumulatedCommissions: ValidatorAccumulatedCommissionRecord[]; /** fee_pool defines the historical rewards of all validators at genesis. */ validatorHistoricalRewards: ValidatorHistoricalRewardsRecord[]; @@ -269,26 +269,26 @@ export interface GenesisStateProtoMsg { } /** GenesisState defines the distribution module's genesis state. */ export interface GenesisStateAmino { - /** params defines all the paramaters of the module. */ - params?: ParamsAmino; + /** params defines all the parameters of the module. */ + params: ParamsAmino; /** fee_pool defines the fee pool at genesis. */ - fee_pool?: FeePoolAmino; + fee_pool: FeePoolAmino; /** fee_pool defines the delegator withdraw infos at genesis. */ - delegator_withdraw_infos?: DelegatorWithdrawInfoAmino[]; + delegator_withdraw_infos: DelegatorWithdrawInfoAmino[]; /** fee_pool defines the previous proposer at genesis. */ previous_proposer?: string; /** fee_pool defines the outstanding rewards of all validators at genesis. */ - outstanding_rewards?: ValidatorOutstandingRewardsRecordAmino[]; - /** fee_pool defines the accumulated commisions of all validators at genesis. */ - validator_accumulated_commissions?: ValidatorAccumulatedCommissionRecordAmino[]; + outstanding_rewards: ValidatorOutstandingRewardsRecordAmino[]; + /** fee_pool defines the accumulated commissions of all validators at genesis. */ + validator_accumulated_commissions: ValidatorAccumulatedCommissionRecordAmino[]; /** fee_pool defines the historical rewards of all validators at genesis. */ - validator_historical_rewards?: ValidatorHistoricalRewardsRecordAmino[]; + validator_historical_rewards: ValidatorHistoricalRewardsRecordAmino[]; /** fee_pool defines the current rewards of all validators at genesis. */ - validator_current_rewards?: ValidatorCurrentRewardsRecordAmino[]; + validator_current_rewards: ValidatorCurrentRewardsRecordAmino[]; /** fee_pool defines the delegator starting infos at genesis. */ - delegator_starting_infos?: DelegatorStartingInfoRecordAmino[]; + delegator_starting_infos: DelegatorStartingInfoRecordAmino[]; /** fee_pool defines the validator slash events at genesis. */ - validator_slash_events?: ValidatorSlashEventRecordAmino[]; + validator_slash_events: ValidatorSlashEventRecordAmino[]; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -527,7 +527,7 @@ export const ValidatorAccumulatedCommissionRecord = { toAmino(message: ValidatorAccumulatedCommissionRecord): ValidatorAccumulatedCommissionRecordAmino { const obj: any = {}; obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; - obj.accumulated = message.accumulated ? ValidatorAccumulatedCommission.toAmino(message.accumulated) : undefined; + obj.accumulated = message.accumulated ? ValidatorAccumulatedCommission.toAmino(message.accumulated) : ValidatorAccumulatedCommission.toAmino(ValidatorAccumulatedCommission.fromPartial({})); return obj; }, fromAminoMsg(object: ValidatorAccumulatedCommissionRecordAminoMsg): ValidatorAccumulatedCommissionRecord { @@ -620,7 +620,7 @@ export const ValidatorHistoricalRewardsRecord = { const obj: any = {}; obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; obj.period = message.period !== BigInt(0) ? message.period.toString() : undefined; - obj.rewards = message.rewards ? ValidatorHistoricalRewards.toAmino(message.rewards) : undefined; + obj.rewards = message.rewards ? ValidatorHistoricalRewards.toAmino(message.rewards) : ValidatorHistoricalRewards.toAmino(ValidatorHistoricalRewards.fromPartial({})); return obj; }, fromAminoMsg(object: ValidatorHistoricalRewardsRecordAminoMsg): ValidatorHistoricalRewardsRecord { @@ -701,7 +701,7 @@ export const ValidatorCurrentRewardsRecord = { toAmino(message: ValidatorCurrentRewardsRecord): ValidatorCurrentRewardsRecordAmino { const obj: any = {}; obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; - obj.rewards = message.rewards ? ValidatorCurrentRewards.toAmino(message.rewards) : undefined; + obj.rewards = message.rewards ? ValidatorCurrentRewards.toAmino(message.rewards) : ValidatorCurrentRewards.toAmino(ValidatorCurrentRewards.fromPartial({})); return obj; }, fromAminoMsg(object: ValidatorCurrentRewardsRecordAminoMsg): ValidatorCurrentRewardsRecord { @@ -794,7 +794,7 @@ export const DelegatorStartingInfoRecord = { const obj: any = {}; obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; - obj.starting_info = message.startingInfo ? DelegatorStartingInfo.toAmino(message.startingInfo) : undefined; + obj.starting_info = message.startingInfo ? DelegatorStartingInfo.toAmino(message.startingInfo) : DelegatorStartingInfo.toAmino(DelegatorStartingInfo.fromPartial({})); return obj; }, fromAminoMsg(object: DelegatorStartingInfoRecordAminoMsg): DelegatorStartingInfoRecord { @@ -899,7 +899,7 @@ export const ValidatorSlashEventRecord = { obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; obj.period = message.period !== BigInt(0) ? message.period.toString() : undefined; - obj.validator_slash_event = message.validatorSlashEvent ? ValidatorSlashEvent.toAmino(message.validatorSlashEvent) : undefined; + obj.validator_slash_event = message.validatorSlashEvent ? ValidatorSlashEvent.toAmino(message.validatorSlashEvent) : ValidatorSlashEvent.toAmino(ValidatorSlashEvent.fromPartial({})); return obj; }, fromAminoMsg(object: ValidatorSlashEventRecordAminoMsg): ValidatorSlashEventRecord { @@ -1053,8 +1053,8 @@ export const GenesisState = { }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; - obj.fee_pool = message.feePool ? FeePool.toAmino(message.feePool) : undefined; + obj.params = message.params ? Params.toAmino(message.params) : Params.toAmino(Params.fromPartial({})); + obj.fee_pool = message.feePool ? FeePool.toAmino(message.feePool) : FeePool.toAmino(FeePool.fromPartial({})); if (message.delegatorWithdrawInfos) { obj.delegator_withdraw_infos = message.delegatorWithdrawInfos.map(e => e ? DelegatorWithdrawInfo.toAmino(e) : undefined); } else { diff --git a/src/codegen/cosmos/distribution/v1beta1/query.lcd.ts b/src/codegen/cosmos/distribution/v1beta1/query.lcd.ts index 1d0dbb1..5173393 100644 --- a/src/codegen/cosmos/distribution/v1beta1/query.lcd.ts +++ b/src/codegen/cosmos/distribution/v1beta1/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../../helpers"; import { LCDClient } from "@cosmology/lcd"; -import { QueryParamsRequest, QueryParamsResponseSDKType, QueryValidatorOutstandingRewardsRequest, QueryValidatorOutstandingRewardsResponseSDKType, QueryValidatorCommissionRequest, QueryValidatorCommissionResponseSDKType, QueryValidatorSlashesRequest, QueryValidatorSlashesResponseSDKType, QueryDelegationRewardsRequest, QueryDelegationRewardsResponseSDKType, QueryDelegationTotalRewardsRequest, QueryDelegationTotalRewardsResponseSDKType, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponseSDKType, QueryDelegatorWithdrawAddressRequest, QueryDelegatorWithdrawAddressResponseSDKType, QueryCommunityPoolRequest, QueryCommunityPoolResponseSDKType } from "./query"; +import { QueryParamsRequest, QueryParamsResponseSDKType, QueryValidatorDistributionInfoRequest, QueryValidatorDistributionInfoResponseSDKType, QueryValidatorOutstandingRewardsRequest, QueryValidatorOutstandingRewardsResponseSDKType, QueryValidatorCommissionRequest, QueryValidatorCommissionResponseSDKType, QueryValidatorSlashesRequest, QueryValidatorSlashesResponseSDKType, QueryDelegationRewardsRequest, QueryDelegationRewardsResponseSDKType, QueryDelegationTotalRewardsRequest, QueryDelegationTotalRewardsResponseSDKType, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponseSDKType, QueryDelegatorWithdrawAddressRequest, QueryDelegatorWithdrawAddressResponseSDKType, QueryCommunityPoolRequest, QueryCommunityPoolResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -10,6 +10,7 @@ export class LCDQueryClient { }) { this.req = requestClient; this.params = this.params.bind(this); + this.validatorDistributionInfo = this.validatorDistributionInfo.bind(this); this.validatorOutstandingRewards = this.validatorOutstandingRewards.bind(this); this.validatorCommission = this.validatorCommission.bind(this); this.validatorSlashes = this.validatorSlashes.bind(this); @@ -24,6 +25,11 @@ export class LCDQueryClient { const endpoint = `cosmos/distribution/v1beta1/params`; return await this.req.get(endpoint); } + /* ValidatorDistributionInfo queries validator commission and self-delegation rewards for validator */ + async validatorDistributionInfo(params: QueryValidatorDistributionInfoRequest): Promise { + const endpoint = `cosmos/distribution/v1beta1/validators/${params.validatorAddress}`; + return await this.req.get(endpoint); + } /* ValidatorOutstandingRewards queries rewards of a validator address. */ async validatorOutstandingRewards(params: QueryValidatorOutstandingRewardsRequest): Promise { const endpoint = `cosmos/distribution/v1beta1/validators/${params.validatorAddress}/outstanding_rewards`; @@ -56,7 +62,7 @@ export class LCDQueryClient { const endpoint = `cosmos/distribution/v1beta1/delegators/${params.delegatorAddress}/rewards/${params.validatorAddress}`; return await this.req.get(endpoint); } - /* DelegationTotalRewards queries the total rewards accrued by a each + /* DelegationTotalRewards queries the total rewards accrued by each validator. */ async delegationTotalRewards(params: QueryDelegationTotalRewardsRequest): Promise { const endpoint = `cosmos/distribution/v1beta1/delegators/${params.delegatorAddress}/rewards`; diff --git a/src/codegen/cosmos/distribution/v1beta1/query.rpc.Query.ts b/src/codegen/cosmos/distribution/v1beta1/query.rpc.Query.ts index 6ecc809..85261c3 100644 --- a/src/codegen/cosmos/distribution/v1beta1/query.rpc.Query.ts +++ b/src/codegen/cosmos/distribution/v1beta1/query.rpc.Query.ts @@ -1,11 +1,13 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryParamsRequest, QueryParamsResponse, QueryValidatorOutstandingRewardsRequest, QueryValidatorOutstandingRewardsResponse, QueryValidatorCommissionRequest, QueryValidatorCommissionResponse, QueryValidatorSlashesRequest, QueryValidatorSlashesResponse, QueryDelegationRewardsRequest, QueryDelegationRewardsResponse, QueryDelegationTotalRewardsRequest, QueryDelegationTotalRewardsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorWithdrawAddressRequest, QueryDelegatorWithdrawAddressResponse, QueryCommunityPoolRequest, QueryCommunityPoolResponse } from "./query"; +import { QueryParamsRequest, QueryParamsResponse, QueryValidatorDistributionInfoRequest, QueryValidatorDistributionInfoResponse, QueryValidatorOutstandingRewardsRequest, QueryValidatorOutstandingRewardsResponse, QueryValidatorCommissionRequest, QueryValidatorCommissionResponse, QueryValidatorSlashesRequest, QueryValidatorSlashesResponse, QueryDelegationRewardsRequest, QueryDelegationRewardsResponse, QueryDelegationTotalRewardsRequest, QueryDelegationTotalRewardsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorWithdrawAddressRequest, QueryDelegatorWithdrawAddressResponse, QueryCommunityPoolRequest, QueryCommunityPoolResponse } from "./query"; /** Query defines the gRPC querier service for distribution module. */ export interface Query { /** Params queries params of the distribution module. */ params(request?: QueryParamsRequest): Promise; + /** ValidatorDistributionInfo queries validator commission and self-delegation rewards for validator */ + validatorDistributionInfo(request: QueryValidatorDistributionInfoRequest): Promise; /** ValidatorOutstandingRewards queries rewards of a validator address. */ validatorOutstandingRewards(request: QueryValidatorOutstandingRewardsRequest): Promise; /** ValidatorCommission queries accumulated commission for a validator. */ @@ -15,7 +17,7 @@ export interface Query { /** DelegationRewards queries the total rewards accrued by a delegation. */ delegationRewards(request: QueryDelegationRewardsRequest): Promise; /** - * DelegationTotalRewards queries the total rewards accrued by a each + * DelegationTotalRewards queries the total rewards accrued by each * validator. */ delegationTotalRewards(request: QueryDelegationTotalRewardsRequest): Promise; @@ -31,6 +33,7 @@ export class QueryClientImpl implements Query { constructor(rpc: Rpc) { this.rpc = rpc; this.params = this.params.bind(this); + this.validatorDistributionInfo = this.validatorDistributionInfo.bind(this); this.validatorOutstandingRewards = this.validatorOutstandingRewards.bind(this); this.validatorCommission = this.validatorCommission.bind(this); this.validatorSlashes = this.validatorSlashes.bind(this); @@ -45,6 +48,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "Params", data); return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); } + validatorDistributionInfo(request: QueryValidatorDistributionInfoRequest): Promise { + const data = QueryValidatorDistributionInfoRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "ValidatorDistributionInfo", data); + return promise.then(data => QueryValidatorDistributionInfoResponse.decode(new BinaryReader(data))); + } validatorOutstandingRewards(request: QueryValidatorOutstandingRewardsRequest): Promise { const data = QueryValidatorOutstandingRewardsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.distribution.v1beta1.Query", "ValidatorOutstandingRewards", data); @@ -93,6 +101,9 @@ export const createRpcQueryExtension = (base: QueryClient) => { params(request?: QueryParamsRequest): Promise { return queryService.params(request); }, + validatorDistributionInfo(request: QueryValidatorDistributionInfoRequest): Promise { + return queryService.validatorDistributionInfo(request); + }, validatorOutstandingRewards(request: QueryValidatorOutstandingRewardsRequest): Promise { return queryService.validatorOutstandingRewards(request); }, diff --git a/src/codegen/cosmos/distribution/v1beta1/query.ts b/src/codegen/cosmos/distribution/v1beta1/query.ts index 9bff97a..9f147b5 100644 --- a/src/codegen/cosmos/distribution/v1beta1/query.ts +++ b/src/codegen/cosmos/distribution/v1beta1/query.ts @@ -28,7 +28,7 @@ export interface QueryParamsResponseProtoMsg { /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseAmino { /** params defines the parameters of the module. */ - params?: ParamsAmino; + params: ParamsAmino; } export interface QueryParamsResponseAminoMsg { type: "cosmos-sdk/QueryParamsResponse"; @@ -38,6 +38,60 @@ export interface QueryParamsResponseAminoMsg { export interface QueryParamsResponseSDKType { params: ParamsSDKType; } +/** QueryValidatorDistributionInfoRequest is the request type for the Query/ValidatorDistributionInfo RPC method. */ +export interface QueryValidatorDistributionInfoRequest { + /** validator_address defines the validator address to query for. */ + validatorAddress: string; +} +export interface QueryValidatorDistributionInfoRequestProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorDistributionInfoRequest"; + value: Uint8Array; +} +/** QueryValidatorDistributionInfoRequest is the request type for the Query/ValidatorDistributionInfo RPC method. */ +export interface QueryValidatorDistributionInfoRequestAmino { + /** validator_address defines the validator address to query for. */ + validator_address?: string; +} +export interface QueryValidatorDistributionInfoRequestAminoMsg { + type: "cosmos-sdk/QueryValidatorDistributionInfoRequest"; + value: QueryValidatorDistributionInfoRequestAmino; +} +/** QueryValidatorDistributionInfoRequest is the request type for the Query/ValidatorDistributionInfo RPC method. */ +export interface QueryValidatorDistributionInfoRequestSDKType { + validator_address: string; +} +/** QueryValidatorDistributionInfoResponse is the response type for the Query/ValidatorDistributionInfo RPC method. */ +export interface QueryValidatorDistributionInfoResponse { + /** operator_address defines the validator operator address. */ + operatorAddress: string; + /** self_bond_rewards defines the self delegations rewards. */ + selfBondRewards: DecCoin[]; + /** commission defines the commission the validator received. */ + commission: DecCoin[]; +} +export interface QueryValidatorDistributionInfoResponseProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorDistributionInfoResponse"; + value: Uint8Array; +} +/** QueryValidatorDistributionInfoResponse is the response type for the Query/ValidatorDistributionInfo RPC method. */ +export interface QueryValidatorDistributionInfoResponseAmino { + /** operator_address defines the validator operator address. */ + operator_address?: string; + /** self_bond_rewards defines the self delegations rewards. */ + self_bond_rewards: DecCoinAmino[]; + /** commission defines the commission the validator received. */ + commission?: DecCoinAmino[]; +} +export interface QueryValidatorDistributionInfoResponseAminoMsg { + type: "cosmos-sdk/QueryValidatorDistributionInfoResponse"; + value: QueryValidatorDistributionInfoResponseAmino; +} +/** QueryValidatorDistributionInfoResponse is the response type for the Query/ValidatorDistributionInfo RPC method. */ +export interface QueryValidatorDistributionInfoResponseSDKType { + operator_address: string; + self_bond_rewards: DecCoinSDKType[]; + commission: DecCoinSDKType[]; +} /** * QueryValidatorOutstandingRewardsRequest is the request type for the * Query/ValidatorOutstandingRewards RPC method. @@ -85,7 +139,7 @@ export interface QueryValidatorOutstandingRewardsResponseProtoMsg { * Query/ValidatorOutstandingRewards RPC method. */ export interface QueryValidatorOutstandingRewardsResponseAmino { - rewards?: ValidatorOutstandingRewardsAmino; + rewards: ValidatorOutstandingRewardsAmino; } export interface QueryValidatorOutstandingRewardsResponseAminoMsg { type: "cosmos-sdk/QueryValidatorOutstandingRewardsResponse"; @@ -134,7 +188,7 @@ export interface QueryValidatorCommissionRequestSDKType { * Query/ValidatorCommission RPC method */ export interface QueryValidatorCommissionResponse { - /** commission defines the commision the validator received. */ + /** commission defines the commission the validator received. */ commission: ValidatorAccumulatedCommission; } export interface QueryValidatorCommissionResponseProtoMsg { @@ -146,8 +200,8 @@ export interface QueryValidatorCommissionResponseProtoMsg { * Query/ValidatorCommission RPC method */ export interface QueryValidatorCommissionResponseAmino { - /** commission defines the commision the validator received. */ - commission?: ValidatorAccumulatedCommissionAmino; + /** commission defines the commission the validator received. */ + commission: ValidatorAccumulatedCommissionAmino; } export interface QueryValidatorCommissionResponseAminoMsg { type: "cosmos-sdk/QueryValidatorCommissionResponse"; @@ -226,7 +280,7 @@ export interface QueryValidatorSlashesResponseProtoMsg { */ export interface QueryValidatorSlashesResponseAmino { /** slashes defines the slashes the validator received. */ - slashes?: ValidatorSlashEventAmino[]; + slashes: ValidatorSlashEventAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -296,7 +350,7 @@ export interface QueryDelegationRewardsResponseProtoMsg { */ export interface QueryDelegationRewardsResponseAmino { /** rewards defines the rewards accrued by a delegation. */ - rewards?: DecCoinAmino[]; + rewards: DecCoinAmino[]; } export interface QueryDelegationRewardsResponseAminoMsg { type: "cosmos-sdk/QueryDelegationRewardsResponse"; @@ -360,9 +414,9 @@ export interface QueryDelegationTotalRewardsResponseProtoMsg { */ export interface QueryDelegationTotalRewardsResponseAmino { /** rewards defines all the rewards accrued by a delegator. */ - rewards?: DelegationDelegatorRewardAmino[]; + rewards: DelegationDelegatorRewardAmino[]; /** total defines the sum of all the rewards. */ - total?: DecCoinAmino[]; + total: DecCoinAmino[]; } export interface QueryDelegationTotalRewardsResponseAminoMsg { type: "cosmos-sdk/QueryDelegationTotalRewardsResponse"; @@ -541,7 +595,7 @@ export interface QueryCommunityPoolResponseProtoMsg { */ export interface QueryCommunityPoolResponseAmino { /** pool defines community pool's coins. */ - pool?: DecCoinAmino[]; + pool: DecCoinAmino[]; } export interface QueryCommunityPoolResponseAminoMsg { type: "cosmos-sdk/QueryCommunityPoolResponse"; @@ -654,7 +708,7 @@ export const QueryParamsResponse = { }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.params = message.params ? Params.toAmino(message.params) : Params.toAmino(Params.fromPartial({})); return obj; }, fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { @@ -679,6 +733,172 @@ export const QueryParamsResponse = { }; } }; +function createBaseQueryValidatorDistributionInfoRequest(): QueryValidatorDistributionInfoRequest { + return { + validatorAddress: "" + }; +} +export const QueryValidatorDistributionInfoRequest = { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorDistributionInfoRequest", + encode(message: QueryValidatorDistributionInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validatorAddress !== "") { + writer.uint32(10).string(message.validatorAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorDistributionInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorDistributionInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validatorAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryValidatorDistributionInfoRequest { + const message = createBaseQueryValidatorDistributionInfoRequest(); + message.validatorAddress = object.validatorAddress ?? ""; + return message; + }, + fromAmino(object: QueryValidatorDistributionInfoRequestAmino): QueryValidatorDistributionInfoRequest { + const message = createBaseQueryValidatorDistributionInfoRequest(); + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + return message; + }, + toAmino(message: QueryValidatorDistributionInfoRequest): QueryValidatorDistributionInfoRequestAmino { + const obj: any = {}; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + return obj; + }, + fromAminoMsg(object: QueryValidatorDistributionInfoRequestAminoMsg): QueryValidatorDistributionInfoRequest { + return QueryValidatorDistributionInfoRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorDistributionInfoRequest): QueryValidatorDistributionInfoRequestAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorDistributionInfoRequest", + value: QueryValidatorDistributionInfoRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorDistributionInfoRequestProtoMsg): QueryValidatorDistributionInfoRequest { + return QueryValidatorDistributionInfoRequest.decode(message.value); + }, + toProto(message: QueryValidatorDistributionInfoRequest): Uint8Array { + return QueryValidatorDistributionInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorDistributionInfoRequest): QueryValidatorDistributionInfoRequestProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorDistributionInfoRequest", + value: QueryValidatorDistributionInfoRequest.encode(message).finish() + }; + } +}; +function createBaseQueryValidatorDistributionInfoResponse(): QueryValidatorDistributionInfoResponse { + return { + operatorAddress: "", + selfBondRewards: [], + commission: [] + }; +} +export const QueryValidatorDistributionInfoResponse = { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorDistributionInfoResponse", + encode(message: QueryValidatorDistributionInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.operatorAddress !== "") { + writer.uint32(10).string(message.operatorAddress); + } + for (const v of message.selfBondRewards) { + DecCoin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.commission) { + DecCoin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryValidatorDistributionInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryValidatorDistributionInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.operatorAddress = reader.string(); + break; + case 2: + message.selfBondRewards.push(DecCoin.decode(reader, reader.uint32())); + break; + case 3: + message.commission.push(DecCoin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryValidatorDistributionInfoResponse { + const message = createBaseQueryValidatorDistributionInfoResponse(); + message.operatorAddress = object.operatorAddress ?? ""; + message.selfBondRewards = object.selfBondRewards?.map(e => DecCoin.fromPartial(e)) || []; + message.commission = object.commission?.map(e => DecCoin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QueryValidatorDistributionInfoResponseAmino): QueryValidatorDistributionInfoResponse { + const message = createBaseQueryValidatorDistributionInfoResponse(); + if (object.operator_address !== undefined && object.operator_address !== null) { + message.operatorAddress = object.operator_address; + } + message.selfBondRewards = object.self_bond_rewards?.map(e => DecCoin.fromAmino(e)) || []; + message.commission = object.commission?.map(e => DecCoin.fromAmino(e)) || []; + return message; + }, + toAmino(message: QueryValidatorDistributionInfoResponse): QueryValidatorDistributionInfoResponseAmino { + const obj: any = {}; + obj.operator_address = message.operatorAddress === "" ? undefined : message.operatorAddress; + if (message.selfBondRewards) { + obj.self_bond_rewards = message.selfBondRewards.map(e => e ? DecCoin.toAmino(e) : undefined); + } else { + obj.self_bond_rewards = message.selfBondRewards; + } + if (message.commission) { + obj.commission = message.commission.map(e => e ? DecCoin.toAmino(e) : undefined); + } else { + obj.commission = message.commission; + } + return obj; + }, + fromAminoMsg(object: QueryValidatorDistributionInfoResponseAminoMsg): QueryValidatorDistributionInfoResponse { + return QueryValidatorDistributionInfoResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryValidatorDistributionInfoResponse): QueryValidatorDistributionInfoResponseAminoMsg { + return { + type: "cosmos-sdk/QueryValidatorDistributionInfoResponse", + value: QueryValidatorDistributionInfoResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryValidatorDistributionInfoResponseProtoMsg): QueryValidatorDistributionInfoResponse { + return QueryValidatorDistributionInfoResponse.decode(message.value); + }, + toProto(message: QueryValidatorDistributionInfoResponse): Uint8Array { + return QueryValidatorDistributionInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryValidatorDistributionInfoResponse): QueryValidatorDistributionInfoResponseProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.QueryValidatorDistributionInfoResponse", + value: QueryValidatorDistributionInfoResponse.encode(message).finish() + }; + } +}; function createBaseQueryValidatorOutstandingRewardsRequest(): QueryValidatorOutstandingRewardsRequest { return { validatorAddress: "" @@ -792,7 +1012,7 @@ export const QueryValidatorOutstandingRewardsResponse = { }, toAmino(message: QueryValidatorOutstandingRewardsResponse): QueryValidatorOutstandingRewardsResponseAmino { const obj: any = {}; - obj.rewards = message.rewards ? ValidatorOutstandingRewards.toAmino(message.rewards) : undefined; + obj.rewards = message.rewards ? ValidatorOutstandingRewards.toAmino(message.rewards) : ValidatorOutstandingRewards.toAmino(ValidatorOutstandingRewards.fromPartial({})); return obj; }, fromAminoMsg(object: QueryValidatorOutstandingRewardsResponseAminoMsg): QueryValidatorOutstandingRewardsResponse { @@ -930,7 +1150,7 @@ export const QueryValidatorCommissionResponse = { }, toAmino(message: QueryValidatorCommissionResponse): QueryValidatorCommissionResponseAmino { const obj: any = {}; - obj.commission = message.commission ? ValidatorAccumulatedCommission.toAmino(message.commission) : undefined; + obj.commission = message.commission ? ValidatorAccumulatedCommission.toAmino(message.commission) : ValidatorAccumulatedCommission.toAmino(ValidatorAccumulatedCommission.fromPartial({})); return obj; }, fromAminoMsg(object: QueryValidatorCommissionResponseAminoMsg): QueryValidatorCommissionResponse { diff --git a/src/codegen/cosmos/distribution/v1beta1/tx.amino.ts b/src/codegen/cosmos/distribution/v1beta1/tx.amino.ts index 5b1270c..34f6bac 100644 --- a/src/codegen/cosmos/distribution/v1beta1/tx.amino.ts +++ b/src/codegen/cosmos/distribution/v1beta1/tx.amino.ts @@ -1,4 +1,4 @@ -import { MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool } from "./tx"; +import { MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool, MsgUpdateParams, MsgCommunityPoolSpend, MsgDepositValidatorRewardsPool } from "./tx"; export const AminoConverter = { "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress": { aminoType: "cosmos-sdk/MsgModifyWithdrawAddress", @@ -19,5 +19,20 @@ export const AminoConverter = { aminoType: "cosmos-sdk/MsgFundCommunityPool", toAmino: MsgFundCommunityPool.toAmino, fromAmino: MsgFundCommunityPool.fromAmino + }, + "/cosmos.distribution.v1beta1.MsgUpdateParams": { + aminoType: "cosmos-sdk/distribution/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + }, + "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend": { + aminoType: "cosmos-sdk/distr/MsgCommunityPoolSpend", + toAmino: MsgCommunityPoolSpend.toAmino, + fromAmino: MsgCommunityPoolSpend.fromAmino + }, + "/cosmos.distribution.v1beta1.MsgDepositValidatorRewardsPool": { + aminoType: "cosmos-sdk/distr/MsgDepositValRewards", + toAmino: MsgDepositValidatorRewardsPool.toAmino, + fromAmino: MsgDepositValidatorRewardsPool.fromAmino } }; \ No newline at end of file diff --git a/src/codegen/cosmos/distribution/v1beta1/tx.registry.ts b/src/codegen/cosmos/distribution/v1beta1/tx.registry.ts index 98b599d..c8f023a 100644 --- a/src/codegen/cosmos/distribution/v1beta1/tx.registry.ts +++ b/src/codegen/cosmos/distribution/v1beta1/tx.registry.ts @@ -1,6 +1,6 @@ import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", MsgSetWithdrawAddress], ["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", MsgWithdrawDelegatorReward], ["/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", MsgWithdrawValidatorCommission], ["/cosmos.distribution.v1beta1.MsgFundCommunityPool", MsgFundCommunityPool]]; +import { MsgSetWithdrawAddress, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, MsgFundCommunityPool, MsgUpdateParams, MsgCommunityPoolSpend, MsgDepositValidatorRewardsPool } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", MsgSetWithdrawAddress], ["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", MsgWithdrawDelegatorReward], ["/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", MsgWithdrawValidatorCommission], ["/cosmos.distribution.v1beta1.MsgFundCommunityPool", MsgFundCommunityPool], ["/cosmos.distribution.v1beta1.MsgUpdateParams", MsgUpdateParams], ["/cosmos.distribution.v1beta1.MsgCommunityPoolSpend", MsgCommunityPoolSpend], ["/cosmos.distribution.v1beta1.MsgDepositValidatorRewardsPool", MsgDepositValidatorRewardsPool]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -31,6 +31,24 @@ export const MessageComposer = { typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", value: MsgFundCommunityPool.encode(value).finish() }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + }, + communityPoolSpend(value: MsgCommunityPoolSpend) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend", + value: MsgCommunityPoolSpend.encode(value).finish() + }; + }, + depositValidatorRewardsPool(value: MsgDepositValidatorRewardsPool) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgDepositValidatorRewardsPool", + value: MsgDepositValidatorRewardsPool.encode(value).finish() + }; } }, withTypeUrl: { @@ -57,6 +75,24 @@ export const MessageComposer = { typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", value }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParams", + value + }; + }, + communityPoolSpend(value: MsgCommunityPoolSpend) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend", + value + }; + }, + depositValidatorRewardsPool(value: MsgDepositValidatorRewardsPool) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgDepositValidatorRewardsPool", + value + }; } }, fromPartial: { @@ -83,6 +119,24 @@ export const MessageComposer = { typeUrl: "/cosmos.distribution.v1beta1.MsgFundCommunityPool", value: MsgFundCommunityPool.fromPartial(value) }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + }, + communityPoolSpend(value: MsgCommunityPoolSpend) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend", + value: MsgCommunityPoolSpend.fromPartial(value) + }; + }, + depositValidatorRewardsPool(value: MsgDepositValidatorRewardsPool) { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgDepositValidatorRewardsPool", + value: MsgDepositValidatorRewardsPool.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/src/codegen/cosmos/distribution/v1beta1/tx.rpc.msg.ts b/src/codegen/cosmos/distribution/v1beta1/tx.rpc.msg.ts index c66ec3e..0afdf33 100644 --- a/src/codegen/cosmos/distribution/v1beta1/tx.rpc.msg.ts +++ b/src/codegen/cosmos/distribution/v1beta1/tx.rpc.msg.ts @@ -1,6 +1,6 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; -import { MsgSetWithdrawAddress, MsgSetWithdrawAddressResponse, MsgWithdrawDelegatorReward, MsgWithdrawDelegatorRewardResponse, MsgWithdrawValidatorCommission, MsgWithdrawValidatorCommissionResponse, MsgFundCommunityPool, MsgFundCommunityPoolResponse } from "./tx"; +import { MsgSetWithdrawAddress, MsgSetWithdrawAddressResponse, MsgWithdrawDelegatorReward, MsgWithdrawDelegatorRewardResponse, MsgWithdrawValidatorCommission, MsgWithdrawValidatorCommissionResponse, MsgFundCommunityPool, MsgFundCommunityPoolResponse, MsgUpdateParams, MsgUpdateParamsResponse, MsgCommunityPoolSpend, MsgCommunityPoolSpendResponse, MsgDepositValidatorRewardsPool, MsgDepositValidatorRewardsPoolResponse } from "./tx"; /** Msg defines the distribution Msg service. */ export interface Msg { /** @@ -23,6 +23,29 @@ export interface Msg { * fund the community pool. */ fundCommunityPool(request: MsgFundCommunityPool): Promise; + /** + * UpdateParams defines a governance operation for updating the x/distribution + * module parameters. The authority is defined in the keeper. + * + * Since: cosmos-sdk 0.47 + */ + updateParams(request: MsgUpdateParams): Promise; + /** + * CommunityPoolSpend defines a governance operation for sending tokens from + * the community pool in the x/distribution module to another account, which + * could be the governance module itself. The authority is defined in the + * keeper. + * + * Since: cosmos-sdk 0.47 + */ + communityPoolSpend(request: MsgCommunityPoolSpend): Promise; + /** + * DepositValidatorRewardsPool defines a method to provide additional rewards + * to delegators to a specific validator. + * + * Since: cosmos-sdk 0.50 + */ + depositValidatorRewardsPool(request: MsgDepositValidatorRewardsPool): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -32,6 +55,9 @@ export class MsgClientImpl implements Msg { this.withdrawDelegatorReward = this.withdrawDelegatorReward.bind(this); this.withdrawValidatorCommission = this.withdrawValidatorCommission.bind(this); this.fundCommunityPool = this.fundCommunityPool.bind(this); + this.updateParams = this.updateParams.bind(this); + this.communityPoolSpend = this.communityPoolSpend.bind(this); + this.depositValidatorRewardsPool = this.depositValidatorRewardsPool.bind(this); } setWithdrawAddress(request: MsgSetWithdrawAddress): Promise { const data = MsgSetWithdrawAddress.encode(request).finish(); @@ -53,4 +79,19 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "FundCommunityPool", data); return promise.then(data => MsgFundCommunityPoolResponse.decode(new BinaryReader(data))); } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } + communityPoolSpend(request: MsgCommunityPoolSpend): Promise { + const data = MsgCommunityPoolSpend.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "CommunityPoolSpend", data); + return promise.then(data => MsgCommunityPoolSpendResponse.decode(new BinaryReader(data))); + } + depositValidatorRewardsPool(request: MsgDepositValidatorRewardsPool): Promise { + const data = MsgDepositValidatorRewardsPool.encode(request).finish(); + const promise = this.rpc.request("cosmos.distribution.v1beta1.Msg", "DepositValidatorRewardsPool", data); + return promise.then(data => MsgDepositValidatorRewardsPoolResponse.decode(new BinaryReader(data))); + } } \ No newline at end of file diff --git a/src/codegen/cosmos/distribution/v1beta1/tx.ts b/src/codegen/cosmos/distribution/v1beta1/tx.ts index e4da980..415d574 100644 --- a/src/codegen/cosmos/distribution/v1beta1/tx.ts +++ b/src/codegen/cosmos/distribution/v1beta1/tx.ts @@ -1,4 +1,5 @@ import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { Params, ParamsAmino, ParamsSDKType } from "./distribution"; import { BinaryReader, BinaryWriter } from "../../../binary"; /** * MsgSetWithdrawAddress sets the withdraw address for @@ -32,19 +33,28 @@ export interface MsgSetWithdrawAddressSDKType { delegator_address: string; withdraw_address: string; } -/** MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. */ +/** + * MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response + * type. + */ export interface MsgSetWithdrawAddressResponse {} export interface MsgSetWithdrawAddressResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse"; value: Uint8Array; } -/** MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. */ +/** + * MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response + * type. + */ export interface MsgSetWithdrawAddressResponseAmino {} export interface MsgSetWithdrawAddressResponseAminoMsg { type: "cosmos-sdk/MsgSetWithdrawAddressResponse"; value: MsgSetWithdrawAddressResponseAmino; } -/** MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. */ +/** + * MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response + * type. + */ export interface MsgSetWithdrawAddressResponseSDKType {} /** * MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator @@ -78,20 +88,37 @@ export interface MsgWithdrawDelegatorRewardSDKType { delegator_address: string; validator_address: string; } -/** MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. */ -export interface MsgWithdrawDelegatorRewardResponse {} +/** + * MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward + * response type. + */ +export interface MsgWithdrawDelegatorRewardResponse { + /** Since: cosmos-sdk 0.46 */ + amount: Coin[]; +} export interface MsgWithdrawDelegatorRewardResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse"; value: Uint8Array; } -/** MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. */ -export interface MsgWithdrawDelegatorRewardResponseAmino {} +/** + * MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward + * response type. + */ +export interface MsgWithdrawDelegatorRewardResponseAmino { + /** Since: cosmos-sdk 0.46 */ + amount: CoinAmino[]; +} export interface MsgWithdrawDelegatorRewardResponseAminoMsg { type: "cosmos-sdk/MsgWithdrawDelegatorRewardResponse"; value: MsgWithdrawDelegatorRewardResponseAmino; } -/** MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. */ -export interface MsgWithdrawDelegatorRewardResponseSDKType {} +/** + * MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward + * response type. + */ +export interface MsgWithdrawDelegatorRewardResponseSDKType { + amount: CoinSDKType[]; +} /** * MsgWithdrawValidatorCommission withdraws the full commission to the validator * address. @@ -121,20 +148,37 @@ export interface MsgWithdrawValidatorCommissionAminoMsg { export interface MsgWithdrawValidatorCommissionSDKType { validator_address: string; } -/** MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. */ -export interface MsgWithdrawValidatorCommissionResponse {} +/** + * MsgWithdrawValidatorCommissionResponse defines the + * Msg/WithdrawValidatorCommission response type. + */ +export interface MsgWithdrawValidatorCommissionResponse { + /** Since: cosmos-sdk 0.46 */ + amount: Coin[]; +} export interface MsgWithdrawValidatorCommissionResponseProtoMsg { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse"; value: Uint8Array; } -/** MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. */ -export interface MsgWithdrawValidatorCommissionResponseAmino {} +/** + * MsgWithdrawValidatorCommissionResponse defines the + * Msg/WithdrawValidatorCommission response type. + */ +export interface MsgWithdrawValidatorCommissionResponseAmino { + /** Since: cosmos-sdk 0.46 */ + amount: CoinAmino[]; +} export interface MsgWithdrawValidatorCommissionResponseAminoMsg { type: "cosmos-sdk/MsgWithdrawValidatorCommissionResponse"; value: MsgWithdrawValidatorCommissionResponseAmino; } -/** MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. */ -export interface MsgWithdrawValidatorCommissionResponseSDKType {} +/** + * MsgWithdrawValidatorCommissionResponse defines the + * Msg/WithdrawValidatorCommission response type. + */ +export interface MsgWithdrawValidatorCommissionResponseSDKType { + amount: CoinSDKType[]; +} /** * MsgFundCommunityPool allows an account to directly * fund the community pool. @@ -152,7 +196,7 @@ export interface MsgFundCommunityPoolProtoMsg { * fund the community pool. */ export interface MsgFundCommunityPoolAmino { - amount?: CoinAmino[]; + amount: CoinAmino[]; depositor?: string; } export interface MsgFundCommunityPoolAminoMsg { @@ -181,6 +225,227 @@ export interface MsgFundCommunityPoolResponseAminoMsg { } /** MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. */ export interface MsgFundCommunityPoolResponseSDKType {} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** + * params defines the x/distribution parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParams"; + value: Uint8Array; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; + /** + * params defines the x/distribution parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/distribution/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsSDKType; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseSDKType {} +/** + * MsgCommunityPoolSpend defines a message for sending tokens from the community + * pool to another account. This message is typically executed via a governance + * proposal with the governance module being the executing authority. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgCommunityPoolSpend { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + recipient: string; + amount: Coin[]; +} +export interface MsgCommunityPoolSpendProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend"; + value: Uint8Array; +} +/** + * MsgCommunityPoolSpend defines a message for sending tokens from the community + * pool to another account. This message is typically executed via a governance + * proposal with the governance module being the executing authority. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgCommunityPoolSpendAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; + recipient?: string; + amount: CoinAmino[]; +} +export interface MsgCommunityPoolSpendAminoMsg { + type: "cosmos-sdk/distr/MsgCommunityPoolSpend"; + value: MsgCommunityPoolSpendAmino; +} +/** + * MsgCommunityPoolSpend defines a message for sending tokens from the community + * pool to another account. This message is typically executed via a governance + * proposal with the governance module being the executing authority. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgCommunityPoolSpendSDKType { + authority: string; + recipient: string; + amount: CoinSDKType[]; +} +/** + * MsgCommunityPoolSpendResponse defines the response to executing a + * MsgCommunityPoolSpend message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgCommunityPoolSpendResponse {} +export interface MsgCommunityPoolSpendResponseProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpendResponse"; + value: Uint8Array; +} +/** + * MsgCommunityPoolSpendResponse defines the response to executing a + * MsgCommunityPoolSpend message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgCommunityPoolSpendResponseAmino {} +export interface MsgCommunityPoolSpendResponseAminoMsg { + type: "cosmos-sdk/MsgCommunityPoolSpendResponse"; + value: MsgCommunityPoolSpendResponseAmino; +} +/** + * MsgCommunityPoolSpendResponse defines the response to executing a + * MsgCommunityPoolSpend message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgCommunityPoolSpendResponseSDKType {} +/** + * DepositValidatorRewardsPool defines the request structure to provide + * additional rewards to delegators from a specific validator. + * + * Since: cosmos-sdk 0.50 + */ +export interface MsgDepositValidatorRewardsPool { + depositor: string; + validatorAddress: string; + amount: Coin[]; +} +export interface MsgDepositValidatorRewardsPoolProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgDepositValidatorRewardsPool"; + value: Uint8Array; +} +/** + * DepositValidatorRewardsPool defines the request structure to provide + * additional rewards to delegators from a specific validator. + * + * Since: cosmos-sdk 0.50 + */ +export interface MsgDepositValidatorRewardsPoolAmino { + depositor?: string; + validator_address?: string; + amount: CoinAmino[]; +} +export interface MsgDepositValidatorRewardsPoolAminoMsg { + type: "cosmos-sdk/distr/MsgDepositValRewards"; + value: MsgDepositValidatorRewardsPoolAmino; +} +/** + * DepositValidatorRewardsPool defines the request structure to provide + * additional rewards to delegators from a specific validator. + * + * Since: cosmos-sdk 0.50 + */ +export interface MsgDepositValidatorRewardsPoolSDKType { + depositor: string; + validator_address: string; + amount: CoinSDKType[]; +} +/** + * MsgDepositValidatorRewardsPoolResponse defines the response to executing a + * MsgDepositValidatorRewardsPool message. + * + * Since: cosmos-sdk 0.50 + */ +export interface MsgDepositValidatorRewardsPoolResponse {} +export interface MsgDepositValidatorRewardsPoolResponseProtoMsg { + typeUrl: "/cosmos.distribution.v1beta1.MsgDepositValidatorRewardsPoolResponse"; + value: Uint8Array; +} +/** + * MsgDepositValidatorRewardsPoolResponse defines the response to executing a + * MsgDepositValidatorRewardsPool message. + * + * Since: cosmos-sdk 0.50 + */ +export interface MsgDepositValidatorRewardsPoolResponseAmino {} +export interface MsgDepositValidatorRewardsPoolResponseAminoMsg { + type: "cosmos-sdk/MsgDepositValidatorRewardsPoolResponse"; + value: MsgDepositValidatorRewardsPoolResponseAmino; +} +/** + * MsgDepositValidatorRewardsPoolResponse defines the response to executing a + * MsgDepositValidatorRewardsPool message. + * + * Since: cosmos-sdk 0.50 + */ +export interface MsgDepositValidatorRewardsPoolResponseSDKType {} function createBaseMsgSetWithdrawAddress(): MsgSetWithdrawAddress { return { delegatorAddress: "", @@ -400,11 +665,16 @@ export const MsgWithdrawDelegatorReward = { } }; function createBaseMsgWithdrawDelegatorRewardResponse(): MsgWithdrawDelegatorRewardResponse { - return {}; + return { + amount: [] + }; } export const MsgWithdrawDelegatorRewardResponse = { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse", - encode(_: MsgWithdrawDelegatorRewardResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + encode(message: MsgWithdrawDelegatorRewardResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawDelegatorRewardResponse { @@ -414,6 +684,9 @@ export const MsgWithdrawDelegatorRewardResponse = { while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -421,16 +694,23 @@ export const MsgWithdrawDelegatorRewardResponse = { } return message; }, - fromPartial(_: Partial): MsgWithdrawDelegatorRewardResponse { + fromPartial(object: Partial): MsgWithdrawDelegatorRewardResponse { const message = createBaseMsgWithdrawDelegatorRewardResponse(); + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; return message; }, - fromAmino(_: MsgWithdrawDelegatorRewardResponseAmino): MsgWithdrawDelegatorRewardResponse { + fromAmino(object: MsgWithdrawDelegatorRewardResponseAmino): MsgWithdrawDelegatorRewardResponse { const message = createBaseMsgWithdrawDelegatorRewardResponse(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; return message; }, - toAmino(_: MsgWithdrawDelegatorRewardResponse): MsgWithdrawDelegatorRewardResponseAmino { + toAmino(message: MsgWithdrawDelegatorRewardResponse): MsgWithdrawDelegatorRewardResponseAmino { const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = message.amount; + } return obj; }, fromAminoMsg(object: MsgWithdrawDelegatorRewardResponseAminoMsg): MsgWithdrawDelegatorRewardResponse { @@ -525,11 +805,16 @@ export const MsgWithdrawValidatorCommission = { } }; function createBaseMsgWithdrawValidatorCommissionResponse(): MsgWithdrawValidatorCommissionResponse { - return {}; + return { + amount: [] + }; } export const MsgWithdrawValidatorCommissionResponse = { typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse", - encode(_: MsgWithdrawValidatorCommissionResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + encode(message: MsgWithdrawValidatorCommissionResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawValidatorCommissionResponse { @@ -539,6 +824,9 @@ export const MsgWithdrawValidatorCommissionResponse = { while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -546,16 +834,23 @@ export const MsgWithdrawValidatorCommissionResponse = { } return message; }, - fromPartial(_: Partial): MsgWithdrawValidatorCommissionResponse { + fromPartial(object: Partial): MsgWithdrawValidatorCommissionResponse { const message = createBaseMsgWithdrawValidatorCommissionResponse(); + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; return message; }, - fromAmino(_: MsgWithdrawValidatorCommissionResponseAmino): MsgWithdrawValidatorCommissionResponse { + fromAmino(object: MsgWithdrawValidatorCommissionResponseAmino): MsgWithdrawValidatorCommissionResponse { const message = createBaseMsgWithdrawValidatorCommissionResponse(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; return message; }, - toAmino(_: MsgWithdrawValidatorCommissionResponse): MsgWithdrawValidatorCommissionResponseAmino { + toAmino(message: MsgWithdrawValidatorCommissionResponse): MsgWithdrawValidatorCommissionResponseAmino { const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = message.amount; + } return obj; }, fromAminoMsg(object: MsgWithdrawValidatorCommissionResponseAminoMsg): MsgWithdrawValidatorCommissionResponse { @@ -718,4 +1013,443 @@ export const MsgFundCommunityPoolResponse = { value: MsgFundCommunityPoolResponse.encode(message).finish() }; } +}; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.params = message.params ? Params.toAmino(message.params) : Params.toAmino(Params.fromPartial({})); + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/distribution/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +function createBaseMsgCommunityPoolSpend(): MsgCommunityPoolSpend { + return { + authority: "", + recipient: "", + amount: [] + }; +} +export const MsgCommunityPoolSpend = { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend", + encode(message: MsgCommunityPoolSpend, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.recipient !== "") { + writer.uint32(18).string(message.recipient); + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCommunityPoolSpend { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCommunityPoolSpend(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.recipient = reader.string(); + break; + case 3: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCommunityPoolSpend { + const message = createBaseMsgCommunityPoolSpend(); + message.authority = object.authority ?? ""; + message.recipient = object.recipient ?? ""; + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgCommunityPoolSpendAmino): MsgCommunityPoolSpend { + const message = createBaseMsgCommunityPoolSpend(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.recipient !== undefined && object.recipient !== null) { + message.recipient = object.recipient; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgCommunityPoolSpend): MsgCommunityPoolSpendAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.recipient = message.recipient === "" ? undefined : message.recipient; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = message.amount; + } + return obj; + }, + fromAminoMsg(object: MsgCommunityPoolSpendAminoMsg): MsgCommunityPoolSpend { + return MsgCommunityPoolSpend.fromAmino(object.value); + }, + toAminoMsg(message: MsgCommunityPoolSpend): MsgCommunityPoolSpendAminoMsg { + return { + type: "cosmos-sdk/distr/MsgCommunityPoolSpend", + value: MsgCommunityPoolSpend.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCommunityPoolSpendProtoMsg): MsgCommunityPoolSpend { + return MsgCommunityPoolSpend.decode(message.value); + }, + toProto(message: MsgCommunityPoolSpend): Uint8Array { + return MsgCommunityPoolSpend.encode(message).finish(); + }, + toProtoMsg(message: MsgCommunityPoolSpend): MsgCommunityPoolSpendProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpend", + value: MsgCommunityPoolSpend.encode(message).finish() + }; + } +}; +function createBaseMsgCommunityPoolSpendResponse(): MsgCommunityPoolSpendResponse { + return {}; +} +export const MsgCommunityPoolSpendResponse = { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpendResponse", + encode(_: MsgCommunityPoolSpendResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCommunityPoolSpendResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCommunityPoolSpendResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgCommunityPoolSpendResponse { + const message = createBaseMsgCommunityPoolSpendResponse(); + return message; + }, + fromAmino(_: MsgCommunityPoolSpendResponseAmino): MsgCommunityPoolSpendResponse { + const message = createBaseMsgCommunityPoolSpendResponse(); + return message; + }, + toAmino(_: MsgCommunityPoolSpendResponse): MsgCommunityPoolSpendResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCommunityPoolSpendResponseAminoMsg): MsgCommunityPoolSpendResponse { + return MsgCommunityPoolSpendResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCommunityPoolSpendResponse): MsgCommunityPoolSpendResponseAminoMsg { + return { + type: "cosmos-sdk/MsgCommunityPoolSpendResponse", + value: MsgCommunityPoolSpendResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCommunityPoolSpendResponseProtoMsg): MsgCommunityPoolSpendResponse { + return MsgCommunityPoolSpendResponse.decode(message.value); + }, + toProto(message: MsgCommunityPoolSpendResponse): Uint8Array { + return MsgCommunityPoolSpendResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCommunityPoolSpendResponse): MsgCommunityPoolSpendResponseProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgCommunityPoolSpendResponse", + value: MsgCommunityPoolSpendResponse.encode(message).finish() + }; + } +}; +function createBaseMsgDepositValidatorRewardsPool(): MsgDepositValidatorRewardsPool { + return { + depositor: "", + validatorAddress: "", + amount: [] + }; +} +export const MsgDepositValidatorRewardsPool = { + typeUrl: "/cosmos.distribution.v1beta1.MsgDepositValidatorRewardsPool", + encode(message: MsgDepositValidatorRewardsPool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.depositor !== "") { + writer.uint32(10).string(message.depositor); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDepositValidatorRewardsPool { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDepositValidatorRewardsPool(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.depositor = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgDepositValidatorRewardsPool { + const message = createBaseMsgDepositValidatorRewardsPool(); + message.depositor = object.depositor ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgDepositValidatorRewardsPoolAmino): MsgDepositValidatorRewardsPool { + const message = createBaseMsgDepositValidatorRewardsPool(); + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgDepositValidatorRewardsPool): MsgDepositValidatorRewardsPoolAmino { + const obj: any = {}; + obj.depositor = message.depositor === "" ? undefined : message.depositor; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = message.amount; + } + return obj; + }, + fromAminoMsg(object: MsgDepositValidatorRewardsPoolAminoMsg): MsgDepositValidatorRewardsPool { + return MsgDepositValidatorRewardsPool.fromAmino(object.value); + }, + toAminoMsg(message: MsgDepositValidatorRewardsPool): MsgDepositValidatorRewardsPoolAminoMsg { + return { + type: "cosmos-sdk/distr/MsgDepositValRewards", + value: MsgDepositValidatorRewardsPool.toAmino(message) + }; + }, + fromProtoMsg(message: MsgDepositValidatorRewardsPoolProtoMsg): MsgDepositValidatorRewardsPool { + return MsgDepositValidatorRewardsPool.decode(message.value); + }, + toProto(message: MsgDepositValidatorRewardsPool): Uint8Array { + return MsgDepositValidatorRewardsPool.encode(message).finish(); + }, + toProtoMsg(message: MsgDepositValidatorRewardsPool): MsgDepositValidatorRewardsPoolProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgDepositValidatorRewardsPool", + value: MsgDepositValidatorRewardsPool.encode(message).finish() + }; + } +}; +function createBaseMsgDepositValidatorRewardsPoolResponse(): MsgDepositValidatorRewardsPoolResponse { + return {}; +} +export const MsgDepositValidatorRewardsPoolResponse = { + typeUrl: "/cosmos.distribution.v1beta1.MsgDepositValidatorRewardsPoolResponse", + encode(_: MsgDepositValidatorRewardsPoolResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDepositValidatorRewardsPoolResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDepositValidatorRewardsPoolResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgDepositValidatorRewardsPoolResponse { + const message = createBaseMsgDepositValidatorRewardsPoolResponse(); + return message; + }, + fromAmino(_: MsgDepositValidatorRewardsPoolResponseAmino): MsgDepositValidatorRewardsPoolResponse { + const message = createBaseMsgDepositValidatorRewardsPoolResponse(); + return message; + }, + toAmino(_: MsgDepositValidatorRewardsPoolResponse): MsgDepositValidatorRewardsPoolResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgDepositValidatorRewardsPoolResponseAminoMsg): MsgDepositValidatorRewardsPoolResponse { + return MsgDepositValidatorRewardsPoolResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgDepositValidatorRewardsPoolResponse): MsgDepositValidatorRewardsPoolResponseAminoMsg { + return { + type: "cosmos-sdk/MsgDepositValidatorRewardsPoolResponse", + value: MsgDepositValidatorRewardsPoolResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgDepositValidatorRewardsPoolResponseProtoMsg): MsgDepositValidatorRewardsPoolResponse { + return MsgDepositValidatorRewardsPoolResponse.decode(message.value); + }, + toProto(message: MsgDepositValidatorRewardsPoolResponse): Uint8Array { + return MsgDepositValidatorRewardsPoolResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgDepositValidatorRewardsPoolResponse): MsgDepositValidatorRewardsPoolResponseProtoMsg { + return { + typeUrl: "/cosmos.distribution.v1beta1.MsgDepositValidatorRewardsPoolResponse", + value: MsgDepositValidatorRewardsPoolResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/src/codegen/cosmos/evidence/v1beta1/evidence.ts b/src/codegen/cosmos/evidence/v1beta1/evidence.ts index b58ff9c..1a0e85a 100644 --- a/src/codegen/cosmos/evidence/v1beta1/evidence.ts +++ b/src/codegen/cosmos/evidence/v1beta1/evidence.ts @@ -6,9 +6,13 @@ import { toTimestamp, fromTimestamp } from "../../../helpers"; * signing misbehavior. */ export interface Equivocation { + /** height is the equivocation height. */ height: bigint; + /** time is the equivocation time. */ time: Date; + /** power is the equivocation validator power. */ power: bigint; + /** consensus_address is the equivocation validator consensus address. */ consensusAddress: string; } export interface EquivocationProtoMsg { @@ -20,9 +24,13 @@ export interface EquivocationProtoMsg { * signing misbehavior. */ export interface EquivocationAmino { + /** height is the equivocation height. */ height?: string; - time?: string; + /** time is the equivocation time. */ + time: string; + /** power is the equivocation validator power. */ power?: string; + /** consensus_address is the equivocation validator consensus address. */ consensus_address?: string; } export interface EquivocationAminoMsg { @@ -117,7 +125,7 @@ export const Equivocation = { toAmino(message: Equivocation): EquivocationAmino { const obj: any = {}; obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; - obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : new Date(); obj.power = message.power !== BigInt(0) ? message.power.toString() : undefined; obj.consensus_address = message.consensusAddress === "" ? undefined : message.consensusAddress; return obj; diff --git a/src/codegen/cosmos/evidence/v1beta1/query.lcd.ts b/src/codegen/cosmos/evidence/v1beta1/query.lcd.ts index 5696b22..4898535 100644 --- a/src/codegen/cosmos/evidence/v1beta1/query.lcd.ts +++ b/src/codegen/cosmos/evidence/v1beta1/query.lcd.ts @@ -14,8 +14,14 @@ export class LCDQueryClient { } /* Evidence queries evidence based on evidence hash. */ async evidence(params: QueryEvidenceRequest): Promise { - const endpoint = `cosmos/evidence/v1beta1/evidence/${params.evidenceHash}`; - return await this.req.get(endpoint); + const options: any = { + params: {} + }; + if (typeof params?.evidenceHash !== "undefined") { + options.params.evidence_hash = params.evidenceHash; + } + const endpoint = `cosmos/evidence/v1beta1/evidence/${params.hash}`; + return await this.req.get(endpoint, options); } /* AllEvidence queries all evidence. */ async allEvidence(params: QueryAllEvidenceRequest = { diff --git a/src/codegen/cosmos/evidence/v1beta1/query.ts b/src/codegen/cosmos/evidence/v1beta1/query.ts index b98ac9a..e18f62a 100644 --- a/src/codegen/cosmos/evidence/v1beta1/query.ts +++ b/src/codegen/cosmos/evidence/v1beta1/query.ts @@ -4,8 +4,18 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { bytesFromBase64, base64FromBytes } from "../../../helpers"; /** QueryEvidenceRequest is the request type for the Query/Evidence RPC method. */ export interface QueryEvidenceRequest { - /** evidence_hash defines the hash of the requested evidence. */ + /** + * evidence_hash defines the hash of the requested evidence. + * Deprecated: Use hash, a HEX encoded string, instead. + */ + /** @deprecated */ evidenceHash: Uint8Array; + /** + * hash defines the evidence hash of the requested evidence. + * + * Since: cosmos-sdk 0.47 + */ + hash: string; } export interface QueryEvidenceRequestProtoMsg { typeUrl: "/cosmos.evidence.v1beta1.QueryEvidenceRequest"; @@ -13,8 +23,18 @@ export interface QueryEvidenceRequestProtoMsg { } /** QueryEvidenceRequest is the request type for the Query/Evidence RPC method. */ export interface QueryEvidenceRequestAmino { - /** evidence_hash defines the hash of the requested evidence. */ + /** + * evidence_hash defines the hash of the requested evidence. + * Deprecated: Use hash, a HEX encoded string, instead. + */ + /** @deprecated */ evidence_hash?: string; + /** + * hash defines the evidence hash of the requested evidence. + * + * Since: cosmos-sdk 0.47 + */ + hash?: string; } export interface QueryEvidenceRequestAminoMsg { type: "cosmos-sdk/QueryEvidenceRequest"; @@ -22,7 +42,9 @@ export interface QueryEvidenceRequestAminoMsg { } /** QueryEvidenceRequest is the request type for the Query/Evidence RPC method. */ export interface QueryEvidenceRequestSDKType { + /** @deprecated */ evidence_hash: Uint8Array; + hash: string; } /** QueryEvidenceResponse is the response type for the Query/Evidence RPC method. */ export interface QueryEvidenceResponse { @@ -115,7 +137,8 @@ export interface QueryAllEvidenceResponseSDKType { } function createBaseQueryEvidenceRequest(): QueryEvidenceRequest { return { - evidenceHash: new Uint8Array() + evidenceHash: new Uint8Array(), + hash: "" }; } export const QueryEvidenceRequest = { @@ -124,6 +147,9 @@ export const QueryEvidenceRequest = { if (message.evidenceHash.length !== 0) { writer.uint32(10).bytes(message.evidenceHash); } + if (message.hash !== "") { + writer.uint32(18).string(message.hash); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryEvidenceRequest { @@ -136,6 +162,9 @@ export const QueryEvidenceRequest = { case 1: message.evidenceHash = reader.bytes(); break; + case 2: + message.hash = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -146,6 +175,7 @@ export const QueryEvidenceRequest = { fromPartial(object: Partial): QueryEvidenceRequest { const message = createBaseQueryEvidenceRequest(); message.evidenceHash = object.evidenceHash ?? new Uint8Array(); + message.hash = object.hash ?? ""; return message; }, fromAmino(object: QueryEvidenceRequestAmino): QueryEvidenceRequest { @@ -153,11 +183,15 @@ export const QueryEvidenceRequest = { if (object.evidence_hash !== undefined && object.evidence_hash !== null) { message.evidenceHash = bytesFromBase64(object.evidence_hash); } + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } return message; }, toAmino(message: QueryEvidenceRequest): QueryEvidenceRequestAmino { const obj: any = {}; obj.evidence_hash = message.evidenceHash ? base64FromBytes(message.evidenceHash) : undefined; + obj.hash = message.hash === "" ? undefined : message.hash; return obj; }, fromAminoMsg(object: QueryEvidenceRequestAminoMsg): QueryEvidenceRequest { diff --git a/src/codegen/cosmos/evidence/v1beta1/tx.ts b/src/codegen/cosmos/evidence/v1beta1/tx.ts index 1774ebf..abef14f 100644 --- a/src/codegen/cosmos/evidence/v1beta1/tx.ts +++ b/src/codegen/cosmos/evidence/v1beta1/tx.ts @@ -6,7 +6,9 @@ import { bytesFromBase64, base64FromBytes } from "../../../helpers"; * Evidence of misbehavior such as equivocation or counterfactual signing. */ export interface MsgSubmitEvidence { + /** submitter is the signer account address of evidence. */ submitter: string; + /** evidence defines the evidence of misbehavior. */ evidence?: Any; } export interface MsgSubmitEvidenceProtoMsg { @@ -18,7 +20,9 @@ export interface MsgSubmitEvidenceProtoMsg { * Evidence of misbehavior such as equivocation or counterfactual signing. */ export interface MsgSubmitEvidenceAmino { + /** submitter is the signer account address of evidence. */ submitter?: string; + /** evidence defines the evidence of misbehavior. */ evidence?: AnyAmino; } export interface MsgSubmitEvidenceAminoMsg { diff --git a/src/codegen/cosmos/feegrant/v1beta1/feegrant.ts b/src/codegen/cosmos/feegrant/v1beta1/feegrant.ts index 60f065b..389a548 100644 --- a/src/codegen/cosmos/feegrant/v1beta1/feegrant.ts +++ b/src/codegen/cosmos/feegrant/v1beta1/feegrant.ts @@ -5,13 +5,13 @@ import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { toTimestamp, fromTimestamp } from "../../../helpers"; /** - * BasicAllowance implements Allowance with a one-time grant of tokens + * BasicAllowance implements Allowance with a one-time grant of coins * that optionally expires. The grantee can use up to SpendLimit to cover fees. */ export interface BasicAllowance { /** - * spend_limit specifies the maximum amount of tokens that can be spent - * by this allowance and will be updated as tokens are spent. If it is + * spend_limit specifies the maximum amount of coins that can be spent + * by this allowance and will be updated as coins are spent. If it is * empty, there is no spend limit and any amount of coins can be spent. */ spendLimit: Coin[]; @@ -23,16 +23,16 @@ export interface BasicAllowanceProtoMsg { value: Uint8Array; } /** - * BasicAllowance implements Allowance with a one-time grant of tokens + * BasicAllowance implements Allowance with a one-time grant of coins * that optionally expires. The grantee can use up to SpendLimit to cover fees. */ export interface BasicAllowanceAmino { /** - * spend_limit specifies the maximum amount of tokens that can be spent - * by this allowance and will be updated as tokens are spent. If it is + * spend_limit specifies the maximum amount of coins that can be spent + * by this allowance and will be updated as coins are spent. If it is * empty, there is no spend limit and any amount of coins can be spent. */ - spend_limit?: CoinAmino[]; + spend_limit: CoinAmino[]; /** expiration specifies an optional time when this allowance expires */ expiration?: string; } @@ -41,7 +41,7 @@ export interface BasicAllowanceAminoMsg { value: BasicAllowanceAmino; } /** - * BasicAllowance implements Allowance with a one-time grant of tokens + * BasicAllowance implements Allowance with a one-time grant of coins * that optionally expires. The grantee can use up to SpendLimit to cover fees. */ export interface BasicAllowanceSDKType { @@ -84,25 +84,25 @@ export interface PeriodicAllowanceProtoMsg { */ export interface PeriodicAllowanceAmino { /** basic specifies a struct of `BasicAllowance` */ - basic?: BasicAllowanceAmino; + basic: BasicAllowanceAmino; /** * period specifies the time duration in which period_spend_limit coins can * be spent before that allowance is reset */ - period?: DurationAmino; + period: DurationAmino; /** * period_spend_limit specifies the maximum number of coins that can be spent * in the period */ - period_spend_limit?: CoinAmino[]; + period_spend_limit: CoinAmino[]; /** period_can_spend is the number of coins left to be spent before the period_reset time */ - period_can_spend?: CoinAmino[]; + period_can_spend: CoinAmino[]; /** * period_reset is the time at which this period resets and a new one begins, * it is calculated from the start time of the first transaction after the * last period ended */ - period_reset?: string; + period_reset: string; } export interface PeriodicAllowanceAminoMsg { type: "cosmos-sdk/PeriodicAllowance"; @@ -121,7 +121,7 @@ export interface PeriodicAllowanceSDKType { } /** AllowedMsgAllowance creates allowance only for specified message types. */ export interface AllowedMsgAllowance { - /** allowance can be any of basic and filtered fee allowance. */ + /** allowance can be any of basic and periodic fee allowance. */ allowance?: Any; /** allowed_messages are the messages for which the grantee has the access. */ allowedMessages: string[]; @@ -132,7 +132,7 @@ export interface AllowedMsgAllowanceProtoMsg { } /** AllowedMsgAllowance creates allowance only for specified message types. */ export interface AllowedMsgAllowanceAmino { - /** allowance can be any of basic and filtered fee allowance. */ + /** allowance can be any of basic and periodic fee allowance. */ allowance?: AnyAmino; /** allowed_messages are the messages for which the grantee has the access. */ allowed_messages?: string[]; @@ -152,7 +152,7 @@ export interface Grant { granter: string; /** grantee is the address of the user being granted an allowance of another user's funds. */ grantee: string; - /** allowance can be any of basic and filtered fee allowance. */ + /** allowance can be any of basic, periodic, allowed fee allowance. */ allowance?: Any; } export interface GrantProtoMsg { @@ -165,7 +165,7 @@ export interface GrantAmino { granter?: string; /** grantee is the address of the user being granted an allowance of another user's funds. */ grantee?: string; - /** allowance can be any of basic and filtered fee allowance. */ + /** allowance can be any of basic, periodic, allowed fee allowance. */ allowance?: AnyAmino; } export interface GrantAminoMsg { @@ -345,8 +345,8 @@ export const PeriodicAllowance = { }, toAmino(message: PeriodicAllowance): PeriodicAllowanceAmino { const obj: any = {}; - obj.basic = message.basic ? BasicAllowance.toAmino(message.basic) : undefined; - obj.period = message.period ? Duration.toAmino(message.period) : undefined; + obj.basic = message.basic ? BasicAllowance.toAmino(message.basic) : BasicAllowance.toAmino(BasicAllowance.fromPartial({})); + obj.period = message.period ? Duration.toAmino(message.period) : Duration.toAmino(Duration.fromPartial({})); if (message.periodSpendLimit) { obj.period_spend_limit = message.periodSpendLimit.map(e => e ? Coin.toAmino(e) : undefined); } else { @@ -357,7 +357,7 @@ export const PeriodicAllowance = { } else { obj.period_can_spend = message.periodCanSpend; } - obj.period_reset = message.periodReset ? Timestamp.toAmino(toTimestamp(message.periodReset)) : undefined; + obj.period_reset = message.periodReset ? Timestamp.toAmino(toTimestamp(message.periodReset)) : new Date(); return obj; }, fromAminoMsg(object: PeriodicAllowanceAminoMsg): PeriodicAllowance { diff --git a/src/codegen/cosmos/feegrant/v1beta1/genesis.ts b/src/codegen/cosmos/feegrant/v1beta1/genesis.ts index d59a42b..6551e00 100644 --- a/src/codegen/cosmos/feegrant/v1beta1/genesis.ts +++ b/src/codegen/cosmos/feegrant/v1beta1/genesis.ts @@ -10,7 +10,7 @@ export interface GenesisStateProtoMsg { } /** GenesisState contains a set of fee allowances, persisted from the store */ export interface GenesisStateAmino { - allowances?: GrantAmino[]; + allowances: GrantAmino[]; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; diff --git a/src/codegen/cosmos/feegrant/v1beta1/query.lcd.ts b/src/codegen/cosmos/feegrant/v1beta1/query.lcd.ts index 6ecda48..732e759 100644 --- a/src/codegen/cosmos/feegrant/v1beta1/query.lcd.ts +++ b/src/codegen/cosmos/feegrant/v1beta1/query.lcd.ts @@ -13,12 +13,12 @@ export class LCDQueryClient { this.allowances = this.allowances.bind(this); this.allowancesByGranter = this.allowancesByGranter.bind(this); } - /* Allowance returns fee granted to the grantee by the granter. */ + /* Allowance returns granted allwance to the grantee by the granter. */ async allowance(params: QueryAllowanceRequest): Promise { const endpoint = `cosmos/feegrant/v1beta1/allowance/${params.granter}/${params.grantee}`; return await this.req.get(endpoint); } - /* Allowances returns all the grants for address. */ + /* Allowances returns all the grants for the given grantee address. */ async allowances(params: QueryAllowancesRequest): Promise { const options: any = { params: {} @@ -30,7 +30,8 @@ export class LCDQueryClient { return await this.req.get(endpoint, options); } /* AllowancesByGranter returns all the grants given by an address - Since v0.46 */ + + Since: cosmos-sdk 0.46 */ async allowancesByGranter(params: QueryAllowancesByGranterRequest): Promise { const options: any = { params: {} diff --git a/src/codegen/cosmos/feegrant/v1beta1/query.rpc.Query.ts b/src/codegen/cosmos/feegrant/v1beta1/query.rpc.Query.ts index 610becf..ea35b65 100644 --- a/src/codegen/cosmos/feegrant/v1beta1/query.rpc.Query.ts +++ b/src/codegen/cosmos/feegrant/v1beta1/query.rpc.Query.ts @@ -4,13 +4,14 @@ import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; import { QueryAllowanceRequest, QueryAllowanceResponse, QueryAllowancesRequest, QueryAllowancesResponse, QueryAllowancesByGranterRequest, QueryAllowancesByGranterResponse } from "./query"; /** Query defines the gRPC querier service. */ export interface Query { - /** Allowance returns fee granted to the grantee by the granter. */ + /** Allowance returns granted allwance to the grantee by the granter. */ allowance(request: QueryAllowanceRequest): Promise; - /** Allowances returns all the grants for address. */ + /** Allowances returns all the grants for the given grantee address. */ allowances(request: QueryAllowancesRequest): Promise; /** * AllowancesByGranter returns all the grants given by an address - * Since v0.46 + * + * Since: cosmos-sdk 0.46 */ allowancesByGranter(request: QueryAllowancesByGranterRequest): Promise; } diff --git a/src/codegen/cosmos/feegrant/v1beta1/query.ts b/src/codegen/cosmos/feegrant/v1beta1/query.ts index 5be101a..8a4993a 100644 --- a/src/codegen/cosmos/feegrant/v1beta1/query.ts +++ b/src/codegen/cosmos/feegrant/v1beta1/query.ts @@ -102,7 +102,11 @@ export interface QueryAllowancesResponseSDKType { allowances: GrantSDKType[]; pagination?: PageResponseSDKType; } -/** QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. */ +/** + * QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. + * + * Since: cosmos-sdk 0.46 + */ export interface QueryAllowancesByGranterRequest { granter: string; /** pagination defines an pagination for the request. */ @@ -112,7 +116,11 @@ export interface QueryAllowancesByGranterRequestProtoMsg { typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesByGranterRequest"; value: Uint8Array; } -/** QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. */ +/** + * QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. + * + * Since: cosmos-sdk 0.46 + */ export interface QueryAllowancesByGranterRequestAmino { granter?: string; /** pagination defines an pagination for the request. */ @@ -122,12 +130,20 @@ export interface QueryAllowancesByGranterRequestAminoMsg { type: "cosmos-sdk/QueryAllowancesByGranterRequest"; value: QueryAllowancesByGranterRequestAmino; } -/** QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. */ +/** + * QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. + * + * Since: cosmos-sdk 0.46 + */ export interface QueryAllowancesByGranterRequestSDKType { granter: string; pagination?: PageRequestSDKType; } -/** QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. */ +/** + * QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. + * + * Since: cosmos-sdk 0.46 + */ export interface QueryAllowancesByGranterResponse { /** allowances that have been issued by the granter. */ allowances: Grant[]; @@ -138,7 +154,11 @@ export interface QueryAllowancesByGranterResponseProtoMsg { typeUrl: "/cosmos.feegrant.v1beta1.QueryAllowancesByGranterResponse"; value: Uint8Array; } -/** QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. */ +/** + * QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. + * + * Since: cosmos-sdk 0.46 + */ export interface QueryAllowancesByGranterResponseAmino { /** allowances that have been issued by the granter. */ allowances?: GrantAmino[]; @@ -149,7 +169,11 @@ export interface QueryAllowancesByGranterResponseAminoMsg { type: "cosmos-sdk/QueryAllowancesByGranterResponse"; value: QueryAllowancesByGranterResponseAmino; } -/** QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. */ +/** + * QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. + * + * Since: cosmos-sdk 0.46 + */ export interface QueryAllowancesByGranterResponseSDKType { allowances: GrantSDKType[]; pagination?: PageResponseSDKType; diff --git a/src/codegen/cosmos/feegrant/v1beta1/tx.amino.ts b/src/codegen/cosmos/feegrant/v1beta1/tx.amino.ts index 1a5cbbb..abc5f21 100644 --- a/src/codegen/cosmos/feegrant/v1beta1/tx.amino.ts +++ b/src/codegen/cosmos/feegrant/v1beta1/tx.amino.ts @@ -1,4 +1,4 @@ -import { MsgGrantAllowance, MsgRevokeAllowance } from "./tx"; +import { MsgGrantAllowance, MsgRevokeAllowance, MsgPruneAllowances } from "./tx"; export const AminoConverter = { "/cosmos.feegrant.v1beta1.MsgGrantAllowance": { aminoType: "cosmos-sdk/MsgGrantAllowance", @@ -9,5 +9,10 @@ export const AminoConverter = { aminoType: "cosmos-sdk/MsgRevokeAllowance", toAmino: MsgRevokeAllowance.toAmino, fromAmino: MsgRevokeAllowance.fromAmino + }, + "/cosmos.feegrant.v1beta1.MsgPruneAllowances": { + aminoType: "cosmos-sdk/MsgPruneAllowances", + toAmino: MsgPruneAllowances.toAmino, + fromAmino: MsgPruneAllowances.fromAmino } }; \ No newline at end of file diff --git a/src/codegen/cosmos/feegrant/v1beta1/tx.registry.ts b/src/codegen/cosmos/feegrant/v1beta1/tx.registry.ts index db2faf6..ea147b8 100644 --- a/src/codegen/cosmos/feegrant/v1beta1/tx.registry.ts +++ b/src/codegen/cosmos/feegrant/v1beta1/tx.registry.ts @@ -1,6 +1,6 @@ import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgGrantAllowance, MsgRevokeAllowance } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.feegrant.v1beta1.MsgGrantAllowance", MsgGrantAllowance], ["/cosmos.feegrant.v1beta1.MsgRevokeAllowance", MsgRevokeAllowance]]; +import { MsgGrantAllowance, MsgRevokeAllowance, MsgPruneAllowances } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.feegrant.v1beta1.MsgGrantAllowance", MsgGrantAllowance], ["/cosmos.feegrant.v1beta1.MsgRevokeAllowance", MsgRevokeAllowance], ["/cosmos.feegrant.v1beta1.MsgPruneAllowances", MsgPruneAllowances]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -19,6 +19,12 @@ export const MessageComposer = { typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", value: MsgRevokeAllowance.encode(value).finish() }; + }, + pruneAllowances(value: MsgPruneAllowances) { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgPruneAllowances", + value: MsgPruneAllowances.encode(value).finish() + }; } }, withTypeUrl: { @@ -33,6 +39,12 @@ export const MessageComposer = { typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", value }; + }, + pruneAllowances(value: MsgPruneAllowances) { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgPruneAllowances", + value + }; } }, fromPartial: { @@ -47,6 +59,12 @@ export const MessageComposer = { typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", value: MsgRevokeAllowance.fromPartial(value) }; + }, + pruneAllowances(value: MsgPruneAllowances) { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgPruneAllowances", + value: MsgPruneAllowances.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/src/codegen/cosmos/feegrant/v1beta1/tx.rpc.msg.ts b/src/codegen/cosmos/feegrant/v1beta1/tx.rpc.msg.ts index 34b6550..274855d 100644 --- a/src/codegen/cosmos/feegrant/v1beta1/tx.rpc.msg.ts +++ b/src/codegen/cosmos/feegrant/v1beta1/tx.rpc.msg.ts @@ -1,6 +1,6 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; -import { MsgGrantAllowance, MsgGrantAllowanceResponse, MsgRevokeAllowance, MsgRevokeAllowanceResponse } from "./tx"; +import { MsgGrantAllowance, MsgGrantAllowanceResponse, MsgRevokeAllowance, MsgRevokeAllowanceResponse, MsgPruneAllowances, MsgPruneAllowancesResponse } from "./tx"; /** Msg defines the feegrant msg service. */ export interface Msg { /** @@ -13,6 +13,12 @@ export interface Msg { * has been granted to the grantee. */ revokeAllowance(request: MsgRevokeAllowance): Promise; + /** + * PruneAllowances prunes expired fee allowances, currently up to 75 at a time. + * + * Since cosmos-sdk 0.50 + */ + pruneAllowances(request: MsgPruneAllowances): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -20,6 +26,7 @@ export class MsgClientImpl implements Msg { this.rpc = rpc; this.grantAllowance = this.grantAllowance.bind(this); this.revokeAllowance = this.revokeAllowance.bind(this); + this.pruneAllowances = this.pruneAllowances.bind(this); } grantAllowance(request: MsgGrantAllowance): Promise { const data = MsgGrantAllowance.encode(request).finish(); @@ -31,4 +38,9 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("cosmos.feegrant.v1beta1.Msg", "RevokeAllowance", data); return promise.then(data => MsgRevokeAllowanceResponse.decode(new BinaryReader(data))); } + pruneAllowances(request: MsgPruneAllowances): Promise { + const data = MsgPruneAllowances.encode(request).finish(); + const promise = this.rpc.request("cosmos.feegrant.v1beta1.Msg", "PruneAllowances", data); + return promise.then(data => MsgPruneAllowancesResponse.decode(new BinaryReader(data))); + } } \ No newline at end of file diff --git a/src/codegen/cosmos/feegrant/v1beta1/tx.ts b/src/codegen/cosmos/feegrant/v1beta1/tx.ts index 5816f37..e7f04d6 100644 --- a/src/codegen/cosmos/feegrant/v1beta1/tx.ts +++ b/src/codegen/cosmos/feegrant/v1beta1/tx.ts @@ -9,7 +9,7 @@ export interface MsgGrantAllowance { granter: string; /** grantee is the address of the user being granted an allowance of another user's funds. */ grantee: string; - /** allowance can be any of basic and filtered fee allowance. */ + /** allowance can be any of basic, periodic, allowed fee allowance. */ allowance?: Any; } export interface MsgGrantAllowanceProtoMsg { @@ -25,7 +25,7 @@ export interface MsgGrantAllowanceAmino { granter?: string; /** grantee is the address of the user being granted an allowance of another user's funds. */ grantee?: string; - /** allowance can be any of basic and filtered fee allowance. */ + /** allowance can be any of basic, periodic, allowed fee allowance. */ allowance?: AnyAmino; } export interface MsgGrantAllowanceAminoMsg { @@ -96,6 +96,66 @@ export interface MsgRevokeAllowanceResponseAminoMsg { } /** MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. */ export interface MsgRevokeAllowanceResponseSDKType {} +/** + * MsgPruneAllowances prunes expired fee allowances. + * + * Since cosmos-sdk 0.50 + */ +export interface MsgPruneAllowances { + /** pruner is the address of the user pruning expired allowances. */ + pruner: string; +} +export interface MsgPruneAllowancesProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.MsgPruneAllowances"; + value: Uint8Array; +} +/** + * MsgPruneAllowances prunes expired fee allowances. + * + * Since cosmos-sdk 0.50 + */ +export interface MsgPruneAllowancesAmino { + /** pruner is the address of the user pruning expired allowances. */ + pruner?: string; +} +export interface MsgPruneAllowancesAminoMsg { + type: "cosmos-sdk/MsgPruneAllowances"; + value: MsgPruneAllowancesAmino; +} +/** + * MsgPruneAllowances prunes expired fee allowances. + * + * Since cosmos-sdk 0.50 + */ +export interface MsgPruneAllowancesSDKType { + pruner: string; +} +/** + * MsgPruneAllowancesResponse defines the Msg/PruneAllowancesResponse response type. + * + * Since cosmos-sdk 0.50 + */ +export interface MsgPruneAllowancesResponse {} +export interface MsgPruneAllowancesResponseProtoMsg { + typeUrl: "/cosmos.feegrant.v1beta1.MsgPruneAllowancesResponse"; + value: Uint8Array; +} +/** + * MsgPruneAllowancesResponse defines the Msg/PruneAllowancesResponse response type. + * + * Since cosmos-sdk 0.50 + */ +export interface MsgPruneAllowancesResponseAmino {} +export interface MsgPruneAllowancesResponseAminoMsg { + type: "cosmos-sdk/MsgPruneAllowancesResponse"; + value: MsgPruneAllowancesResponseAmino; +} +/** + * MsgPruneAllowancesResponse defines the Msg/PruneAllowancesResponse response type. + * + * Since cosmos-sdk 0.50 + */ +export interface MsgPruneAllowancesResponseSDKType {} function createBaseMsgGrantAllowance(): MsgGrantAllowance { return { granter: "", @@ -381,4 +441,129 @@ export const MsgRevokeAllowanceResponse = { value: MsgRevokeAllowanceResponse.encode(message).finish() }; } +}; +function createBaseMsgPruneAllowances(): MsgPruneAllowances { + return { + pruner: "" + }; +} +export const MsgPruneAllowances = { + typeUrl: "/cosmos.feegrant.v1beta1.MsgPruneAllowances", + encode(message: MsgPruneAllowances, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pruner !== "") { + writer.uint32(10).string(message.pruner); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgPruneAllowances { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPruneAllowances(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pruner = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgPruneAllowances { + const message = createBaseMsgPruneAllowances(); + message.pruner = object.pruner ?? ""; + return message; + }, + fromAmino(object: MsgPruneAllowancesAmino): MsgPruneAllowances { + const message = createBaseMsgPruneAllowances(); + if (object.pruner !== undefined && object.pruner !== null) { + message.pruner = object.pruner; + } + return message; + }, + toAmino(message: MsgPruneAllowances): MsgPruneAllowancesAmino { + const obj: any = {}; + obj.pruner = message.pruner === "" ? undefined : message.pruner; + return obj; + }, + fromAminoMsg(object: MsgPruneAllowancesAminoMsg): MsgPruneAllowances { + return MsgPruneAllowances.fromAmino(object.value); + }, + toAminoMsg(message: MsgPruneAllowances): MsgPruneAllowancesAminoMsg { + return { + type: "cosmos-sdk/MsgPruneAllowances", + value: MsgPruneAllowances.toAmino(message) + }; + }, + fromProtoMsg(message: MsgPruneAllowancesProtoMsg): MsgPruneAllowances { + return MsgPruneAllowances.decode(message.value); + }, + toProto(message: MsgPruneAllowances): Uint8Array { + return MsgPruneAllowances.encode(message).finish(); + }, + toProtoMsg(message: MsgPruneAllowances): MsgPruneAllowancesProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgPruneAllowances", + value: MsgPruneAllowances.encode(message).finish() + }; + } +}; +function createBaseMsgPruneAllowancesResponse(): MsgPruneAllowancesResponse { + return {}; +} +export const MsgPruneAllowancesResponse = { + typeUrl: "/cosmos.feegrant.v1beta1.MsgPruneAllowancesResponse", + encode(_: MsgPruneAllowancesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgPruneAllowancesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPruneAllowancesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgPruneAllowancesResponse { + const message = createBaseMsgPruneAllowancesResponse(); + return message; + }, + fromAmino(_: MsgPruneAllowancesResponseAmino): MsgPruneAllowancesResponse { + const message = createBaseMsgPruneAllowancesResponse(); + return message; + }, + toAmino(_: MsgPruneAllowancesResponse): MsgPruneAllowancesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgPruneAllowancesResponseAminoMsg): MsgPruneAllowancesResponse { + return MsgPruneAllowancesResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgPruneAllowancesResponse): MsgPruneAllowancesResponseAminoMsg { + return { + type: "cosmos-sdk/MsgPruneAllowancesResponse", + value: MsgPruneAllowancesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgPruneAllowancesResponseProtoMsg): MsgPruneAllowancesResponse { + return MsgPruneAllowancesResponse.decode(message.value); + }, + toProto(message: MsgPruneAllowancesResponse): Uint8Array { + return MsgPruneAllowancesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgPruneAllowancesResponse): MsgPruneAllowancesResponseProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgPruneAllowancesResponse", + value: MsgPruneAllowancesResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/src/codegen/cosmos/gov/v1/genesis.ts b/src/codegen/cosmos/gov/v1/genesis.ts new file mode 100644 index 0000000..b50424f --- /dev/null +++ b/src/codegen/cosmos/gov/v1/genesis.ts @@ -0,0 +1,284 @@ +import { Deposit, DepositAmino, DepositSDKType, Vote, VoteAmino, VoteSDKType, Proposal, ProposalAmino, ProposalSDKType, DepositParams, DepositParamsAmino, DepositParamsSDKType, VotingParams, VotingParamsAmino, VotingParamsSDKType, TallyParams, TallyParamsAmino, TallyParamsSDKType, Params, ParamsAmino, ParamsSDKType } from "./gov"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** GenesisState defines the gov module's genesis state. */ +export interface GenesisState { + /** starting_proposal_id is the ID of the starting proposal. */ + startingProposalId: bigint; + /** deposits defines all the deposits present at genesis. */ + deposits: Deposit[]; + /** votes defines all the votes present at genesis. */ + votes: Vote[]; + /** proposals defines all the proposals present at genesis. */ + proposals: Proposal[]; + /** + * Deprecated: Prefer to use `params` instead. + * deposit_params defines all the paramaters of related to deposit. + */ + /** @deprecated */ + depositParams?: DepositParams; + /** + * Deprecated: Prefer to use `params` instead. + * voting_params defines all the paramaters of related to voting. + */ + /** @deprecated */ + votingParams?: VotingParams; + /** + * Deprecated: Prefer to use `params` instead. + * tally_params defines all the paramaters of related to tally. + */ + /** @deprecated */ + tallyParams?: TallyParams; + /** + * params defines all the paramaters of x/gov module. + * + * Since: cosmos-sdk 0.47 + */ + params?: Params; + /** + * The constitution allows builders to lay a foundation and define purpose. + * This is an immutable string set in genesis. + * There are no amendments, to go outside of scope, just fork. + * constitution is an immutable string in genesis for a chain builder to lay out their vision, ideas and ideals. + * + * Since: cosmos-sdk 0.50 + */ + constitution: string; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmos.gov.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the gov module's genesis state. */ +export interface GenesisStateAmino { + /** starting_proposal_id is the ID of the starting proposal. */ + starting_proposal_id?: string; + /** deposits defines all the deposits present at genesis. */ + deposits?: DepositAmino[]; + /** votes defines all the votes present at genesis. */ + votes?: VoteAmino[]; + /** proposals defines all the proposals present at genesis. */ + proposals?: ProposalAmino[]; + /** + * Deprecated: Prefer to use `params` instead. + * deposit_params defines all the paramaters of related to deposit. + */ + /** @deprecated */ + deposit_params?: DepositParamsAmino; + /** + * Deprecated: Prefer to use `params` instead. + * voting_params defines all the paramaters of related to voting. + */ + /** @deprecated */ + voting_params?: VotingParamsAmino; + /** + * Deprecated: Prefer to use `params` instead. + * tally_params defines all the paramaters of related to tally. + */ + /** @deprecated */ + tally_params?: TallyParamsAmino; + /** + * params defines all the paramaters of x/gov module. + * + * Since: cosmos-sdk 0.47 + */ + params?: ParamsAmino; + /** + * The constitution allows builders to lay a foundation and define purpose. + * This is an immutable string set in genesis. + * There are no amendments, to go outside of scope, just fork. + * constitution is an immutable string in genesis for a chain builder to lay out their vision, ideas and ideals. + * + * Since: cosmos-sdk 0.50 + */ + constitution?: string; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/v1/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the gov module's genesis state. */ +export interface GenesisStateSDKType { + starting_proposal_id: bigint; + deposits: DepositSDKType[]; + votes: VoteSDKType[]; + proposals: ProposalSDKType[]; + /** @deprecated */ + deposit_params?: DepositParamsSDKType; + /** @deprecated */ + voting_params?: VotingParamsSDKType; + /** @deprecated */ + tally_params?: TallyParamsSDKType; + params?: ParamsSDKType; + constitution: string; +} +function createBaseGenesisState(): GenesisState { + return { + startingProposalId: BigInt(0), + deposits: [], + votes: [], + proposals: [], + depositParams: undefined, + votingParams: undefined, + tallyParams: undefined, + params: undefined, + constitution: "" + }; +} +export const GenesisState = { + typeUrl: "/cosmos.gov.v1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.startingProposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.startingProposalId); + } + for (const v of message.deposits) { + Deposit.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.votes) { + Vote.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.proposals) { + Proposal.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.depositParams !== undefined) { + DepositParams.encode(message.depositParams, writer.uint32(42).fork()).ldelim(); + } + if (message.votingParams !== undefined) { + VotingParams.encode(message.votingParams, writer.uint32(50).fork()).ldelim(); + } + if (message.tallyParams !== undefined) { + TallyParams.encode(message.tallyParams, writer.uint32(58).fork()).ldelim(); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(66).fork()).ldelim(); + } + if (message.constitution !== "") { + writer.uint32(74).string(message.constitution); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startingProposalId = reader.uint64(); + break; + case 2: + message.deposits.push(Deposit.decode(reader, reader.uint32())); + break; + case 3: + message.votes.push(Vote.decode(reader, reader.uint32())); + break; + case 4: + message.proposals.push(Proposal.decode(reader, reader.uint32())); + break; + case 5: + message.depositParams = DepositParams.decode(reader, reader.uint32()); + break; + case 6: + message.votingParams = VotingParams.decode(reader, reader.uint32()); + break; + case 7: + message.tallyParams = TallyParams.decode(reader, reader.uint32()); + break; + case 8: + message.params = Params.decode(reader, reader.uint32()); + break; + case 9: + message.constitution = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.startingProposalId = object.startingProposalId !== undefined && object.startingProposalId !== null ? BigInt(object.startingProposalId.toString()) : BigInt(0); + message.deposits = object.deposits?.map(e => Deposit.fromPartial(e)) || []; + message.votes = object.votes?.map(e => Vote.fromPartial(e)) || []; + message.proposals = object.proposals?.map(e => Proposal.fromPartial(e)) || []; + message.depositParams = object.depositParams !== undefined && object.depositParams !== null ? DepositParams.fromPartial(object.depositParams) : undefined; + message.votingParams = object.votingParams !== undefined && object.votingParams !== null ? VotingParams.fromPartial(object.votingParams) : undefined; + message.tallyParams = object.tallyParams !== undefined && object.tallyParams !== null ? TallyParams.fromPartial(object.tallyParams) : undefined; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.constitution = object.constitution ?? ""; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.starting_proposal_id !== undefined && object.starting_proposal_id !== null) { + message.startingProposalId = BigInt(object.starting_proposal_id); + } + message.deposits = object.deposits?.map(e => Deposit.fromAmino(e)) || []; + message.votes = object.votes?.map(e => Vote.fromAmino(e)) || []; + message.proposals = object.proposals?.map(e => Proposal.fromAmino(e)) || []; + if (object.deposit_params !== undefined && object.deposit_params !== null) { + message.depositParams = DepositParams.fromAmino(object.deposit_params); + } + if (object.voting_params !== undefined && object.voting_params !== null) { + message.votingParams = VotingParams.fromAmino(object.voting_params); + } + if (object.tally_params !== undefined && object.tally_params !== null) { + message.tallyParams = TallyParams.fromAmino(object.tally_params); + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + if (object.constitution !== undefined && object.constitution !== null) { + message.constitution = object.constitution; + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.starting_proposal_id = message.startingProposalId !== BigInt(0) ? message.startingProposalId.toString() : undefined; + if (message.deposits) { + obj.deposits = message.deposits.map(e => e ? Deposit.toAmino(e) : undefined); + } else { + obj.deposits = message.deposits; + } + if (message.votes) { + obj.votes = message.votes.map(e => e ? Vote.toAmino(e) : undefined); + } else { + obj.votes = message.votes; + } + if (message.proposals) { + obj.proposals = message.proposals.map(e => e ? Proposal.toAmino(e) : undefined); + } else { + obj.proposals = message.proposals; + } + obj.deposit_params = message.depositParams ? DepositParams.toAmino(message.depositParams) : undefined; + obj.voting_params = message.votingParams ? VotingParams.toAmino(message.votingParams) : undefined; + obj.tally_params = message.tallyParams ? TallyParams.toAmino(message.tallyParams) : undefined; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.constitution = message.constitution === "" ? undefined : message.constitution; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: "cosmos-sdk/v1/GenesisState", + value: GenesisState.toAmino(message) + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/gov/v1/gov.ts b/src/codegen/cosmos/gov/v1/gov.ts new file mode 100644 index 0000000..97f0149 --- /dev/null +++ b/src/codegen/cosmos/gov/v1/gov.ts @@ -0,0 +1,1853 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { toTimestamp, fromTimestamp } from "../../../helpers"; +/** VoteOption enumerates the valid vote options for a given governance proposal. */ +export enum VoteOption { + /** VOTE_OPTION_UNSPECIFIED - VOTE_OPTION_UNSPECIFIED defines a no-op vote option. */ + VOTE_OPTION_UNSPECIFIED = 0, + /** VOTE_OPTION_YES - VOTE_OPTION_YES defines a yes vote option. */ + VOTE_OPTION_YES = 1, + /** VOTE_OPTION_ABSTAIN - VOTE_OPTION_ABSTAIN defines an abstain vote option. */ + VOTE_OPTION_ABSTAIN = 2, + /** VOTE_OPTION_NO - VOTE_OPTION_NO defines a no vote option. */ + VOTE_OPTION_NO = 3, + /** VOTE_OPTION_NO_WITH_VETO - VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. */ + VOTE_OPTION_NO_WITH_VETO = 4, + UNRECOGNIZED = -1, +} +export const VoteOptionSDKType = VoteOption; +export const VoteOptionAmino = VoteOption; +export function voteOptionFromJSON(object: any): VoteOption { + switch (object) { + case 0: + case "VOTE_OPTION_UNSPECIFIED": + return VoteOption.VOTE_OPTION_UNSPECIFIED; + case 1: + case "VOTE_OPTION_YES": + return VoteOption.VOTE_OPTION_YES; + case 2: + case "VOTE_OPTION_ABSTAIN": + return VoteOption.VOTE_OPTION_ABSTAIN; + case 3: + case "VOTE_OPTION_NO": + return VoteOption.VOTE_OPTION_NO; + case 4: + case "VOTE_OPTION_NO_WITH_VETO": + return VoteOption.VOTE_OPTION_NO_WITH_VETO; + case -1: + case "UNRECOGNIZED": + default: + return VoteOption.UNRECOGNIZED; + } +} +export function voteOptionToJSON(object: VoteOption): string { + switch (object) { + case VoteOption.VOTE_OPTION_UNSPECIFIED: + return "VOTE_OPTION_UNSPECIFIED"; + case VoteOption.VOTE_OPTION_YES: + return "VOTE_OPTION_YES"; + case VoteOption.VOTE_OPTION_ABSTAIN: + return "VOTE_OPTION_ABSTAIN"; + case VoteOption.VOTE_OPTION_NO: + return "VOTE_OPTION_NO"; + case VoteOption.VOTE_OPTION_NO_WITH_VETO: + return "VOTE_OPTION_NO_WITH_VETO"; + case VoteOption.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** ProposalStatus enumerates the valid statuses of a proposal. */ +export enum ProposalStatus { + /** PROPOSAL_STATUS_UNSPECIFIED - PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. */ + PROPOSAL_STATUS_UNSPECIFIED = 0, + /** + * PROPOSAL_STATUS_DEPOSIT_PERIOD - PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + * period. + */ + PROPOSAL_STATUS_DEPOSIT_PERIOD = 1, + /** + * PROPOSAL_STATUS_VOTING_PERIOD - PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + * period. + */ + PROPOSAL_STATUS_VOTING_PERIOD = 2, + /** + * PROPOSAL_STATUS_PASSED - PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + * passed. + */ + PROPOSAL_STATUS_PASSED = 3, + /** + * PROPOSAL_STATUS_REJECTED - PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + * been rejected. + */ + PROPOSAL_STATUS_REJECTED = 4, + /** + * PROPOSAL_STATUS_FAILED - PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + * failed. + */ + PROPOSAL_STATUS_FAILED = 5, + UNRECOGNIZED = -1, +} +export const ProposalStatusSDKType = ProposalStatus; +export const ProposalStatusAmino = ProposalStatus; +export function proposalStatusFromJSON(object: any): ProposalStatus { + switch (object) { + case 0: + case "PROPOSAL_STATUS_UNSPECIFIED": + return ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED; + case 1: + case "PROPOSAL_STATUS_DEPOSIT_PERIOD": + return ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD; + case 2: + case "PROPOSAL_STATUS_VOTING_PERIOD": + return ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD; + case 3: + case "PROPOSAL_STATUS_PASSED": + return ProposalStatus.PROPOSAL_STATUS_PASSED; + case 4: + case "PROPOSAL_STATUS_REJECTED": + return ProposalStatus.PROPOSAL_STATUS_REJECTED; + case 5: + case "PROPOSAL_STATUS_FAILED": + return ProposalStatus.PROPOSAL_STATUS_FAILED; + case -1: + case "UNRECOGNIZED": + default: + return ProposalStatus.UNRECOGNIZED; + } +} +export function proposalStatusToJSON(object: ProposalStatus): string { + switch (object) { + case ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED: + return "PROPOSAL_STATUS_UNSPECIFIED"; + case ProposalStatus.PROPOSAL_STATUS_DEPOSIT_PERIOD: + return "PROPOSAL_STATUS_DEPOSIT_PERIOD"; + case ProposalStatus.PROPOSAL_STATUS_VOTING_PERIOD: + return "PROPOSAL_STATUS_VOTING_PERIOD"; + case ProposalStatus.PROPOSAL_STATUS_PASSED: + return "PROPOSAL_STATUS_PASSED"; + case ProposalStatus.PROPOSAL_STATUS_REJECTED: + return "PROPOSAL_STATUS_REJECTED"; + case ProposalStatus.PROPOSAL_STATUS_FAILED: + return "PROPOSAL_STATUS_FAILED"; + case ProposalStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** WeightedVoteOption defines a unit of vote for vote split. */ +export interface WeightedVoteOption { + /** option defines the valid vote options, it must not contain duplicate vote options. */ + option: VoteOption; + /** weight is the vote weight associated with the vote option. */ + weight: string; +} +export interface WeightedVoteOptionProtoMsg { + typeUrl: "/cosmos.gov.v1.WeightedVoteOption"; + value: Uint8Array; +} +/** WeightedVoteOption defines a unit of vote for vote split. */ +export interface WeightedVoteOptionAmino { + /** option defines the valid vote options, it must not contain duplicate vote options. */ + option?: VoteOption; + /** weight is the vote weight associated with the vote option. */ + weight?: string; +} +export interface WeightedVoteOptionAminoMsg { + type: "cosmos-sdk/v1/WeightedVoteOption"; + value: WeightedVoteOptionAmino; +} +/** WeightedVoteOption defines a unit of vote for vote split. */ +export interface WeightedVoteOptionSDKType { + option: VoteOption; + weight: string; +} +/** + * Deposit defines an amount deposited by an account address to an active + * proposal. + */ +export interface Deposit { + /** proposal_id defines the unique id of the proposal. */ + proposalId: bigint; + /** depositor defines the deposit addresses from the proposals. */ + depositor: string; + /** amount to be deposited by depositor. */ + amount: Coin[]; +} +export interface DepositProtoMsg { + typeUrl: "/cosmos.gov.v1.Deposit"; + value: Uint8Array; +} +/** + * Deposit defines an amount deposited by an account address to an active + * proposal. + */ +export interface DepositAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id?: string; + /** depositor defines the deposit addresses from the proposals. */ + depositor?: string; + /** amount to be deposited by depositor. */ + amount: CoinAmino[]; +} +export interface DepositAminoMsg { + type: "cosmos-sdk/v1/Deposit"; + value: DepositAmino; +} +/** + * Deposit defines an amount deposited by an account address to an active + * proposal. + */ +export interface DepositSDKType { + proposal_id: bigint; + depositor: string; + amount: CoinSDKType[]; +} +/** Proposal defines the core field members of a governance proposal. */ +export interface Proposal { + /** id defines the unique id of the proposal. */ + id: bigint; + /** messages are the arbitrary messages to be executed if the proposal passes. */ + messages: Any[]; + /** status defines the proposal status. */ + status: ProposalStatus; + /** + * final_tally_result is the final tally result of the proposal. When + * querying a proposal via gRPC, this field is not populated until the + * proposal's voting period has ended. + */ + finalTallyResult?: TallyResult; + /** submit_time is the time of proposal submission. */ + submitTime?: Date; + /** deposit_end_time is the end time for deposition. */ + depositEndTime?: Date; + /** total_deposit is the total deposit on the proposal. */ + totalDeposit: Coin[]; + /** voting_start_time is the starting time to vote on a proposal. */ + votingStartTime?: Date; + /** voting_end_time is the end time of voting on a proposal. */ + votingEndTime?: Date; + /** + * metadata is any arbitrary metadata attached to the proposal. + * the recommended format of the metadata is to be found here: + * https://docs.cosmos.network/v0.47/modules/gov#proposal-3 + */ + metadata: string; + /** + * title is the title of the proposal + * + * Since: cosmos-sdk 0.47 + */ + title: string; + /** + * summary is a short summary of the proposal + * + * Since: cosmos-sdk 0.47 + */ + summary: string; + /** + * proposer is the address of the proposal sumbitter + * + * Since: cosmos-sdk 0.47 + */ + proposer: string; + /** + * expedited defines if the proposal is expedited + * + * Since: cosmos-sdk 0.50 + */ + expedited: boolean; + /** + * failed_reason defines the reason why the proposal failed + * + * Since: cosmos-sdk 0.50 + */ + failedReason: string; +} +export interface ProposalProtoMsg { + typeUrl: "/cosmos.gov.v1.Proposal"; + value: Uint8Array; +} +/** Proposal defines the core field members of a governance proposal. */ +export interface ProposalAmino { + /** id defines the unique id of the proposal. */ + id?: string; + /** messages are the arbitrary messages to be executed if the proposal passes. */ + messages?: AnyAmino[]; + /** status defines the proposal status. */ + status?: ProposalStatus; + /** + * final_tally_result is the final tally result of the proposal. When + * querying a proposal via gRPC, this field is not populated until the + * proposal's voting period has ended. + */ + final_tally_result?: TallyResultAmino; + /** submit_time is the time of proposal submission. */ + submit_time?: string; + /** deposit_end_time is the end time for deposition. */ + deposit_end_time?: string; + /** total_deposit is the total deposit on the proposal. */ + total_deposit: CoinAmino[]; + /** voting_start_time is the starting time to vote on a proposal. */ + voting_start_time?: string; + /** voting_end_time is the end time of voting on a proposal. */ + voting_end_time?: string; + /** + * metadata is any arbitrary metadata attached to the proposal. + * the recommended format of the metadata is to be found here: + * https://docs.cosmos.network/v0.47/modules/gov#proposal-3 + */ + metadata?: string; + /** + * title is the title of the proposal + * + * Since: cosmos-sdk 0.47 + */ + title?: string; + /** + * summary is a short summary of the proposal + * + * Since: cosmos-sdk 0.47 + */ + summary?: string; + /** + * proposer is the address of the proposal sumbitter + * + * Since: cosmos-sdk 0.47 + */ + proposer?: string; + /** + * expedited defines if the proposal is expedited + * + * Since: cosmos-sdk 0.50 + */ + expedited?: boolean; + /** + * failed_reason defines the reason why the proposal failed + * + * Since: cosmos-sdk 0.50 + */ + failed_reason?: string; +} +export interface ProposalAminoMsg { + type: "cosmos-sdk/v1/Proposal"; + value: ProposalAmino; +} +/** Proposal defines the core field members of a governance proposal. */ +export interface ProposalSDKType { + id: bigint; + messages: AnySDKType[]; + status: ProposalStatus; + final_tally_result?: TallyResultSDKType; + submit_time?: Date; + deposit_end_time?: Date; + total_deposit: CoinSDKType[]; + voting_start_time?: Date; + voting_end_time?: Date; + metadata: string; + title: string; + summary: string; + proposer: string; + expedited: boolean; + failed_reason: string; +} +/** TallyResult defines a standard tally for a governance proposal. */ +export interface TallyResult { + /** yes_count is the number of yes votes on a proposal. */ + yesCount: string; + /** abstain_count is the number of abstain votes on a proposal. */ + abstainCount: string; + /** no_count is the number of no votes on a proposal. */ + noCount: string; + /** no_with_veto_count is the number of no with veto votes on a proposal. */ + noWithVetoCount: string; +} +export interface TallyResultProtoMsg { + typeUrl: "/cosmos.gov.v1.TallyResult"; + value: Uint8Array; +} +/** TallyResult defines a standard tally for a governance proposal. */ +export interface TallyResultAmino { + /** yes_count is the number of yes votes on a proposal. */ + yes_count?: string; + /** abstain_count is the number of abstain votes on a proposal. */ + abstain_count?: string; + /** no_count is the number of no votes on a proposal. */ + no_count?: string; + /** no_with_veto_count is the number of no with veto votes on a proposal. */ + no_with_veto_count?: string; +} +export interface TallyResultAminoMsg { + type: "cosmos-sdk/v1/TallyResult"; + value: TallyResultAmino; +} +/** TallyResult defines a standard tally for a governance proposal. */ +export interface TallyResultSDKType { + yes_count: string; + abstain_count: string; + no_count: string; + no_with_veto_count: string; +} +/** + * Vote defines a vote on a governance proposal. + * A Vote consists of a proposal ID, the voter, and the vote option. + */ +export interface Vote { + /** proposal_id defines the unique id of the proposal. */ + proposalId: bigint; + /** voter is the voter address of the proposal. */ + voter: string; + /** options is the weighted vote options. */ + options: WeightedVoteOption[]; + /** + * metadata is any arbitrary metadata attached to the vote. + * the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/gov#vote-5 + */ + metadata: string; +} +export interface VoteProtoMsg { + typeUrl: "/cosmos.gov.v1.Vote"; + value: Uint8Array; +} +/** + * Vote defines a vote on a governance proposal. + * A Vote consists of a proposal ID, the voter, and the vote option. + */ +export interface VoteAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id?: string; + /** voter is the voter address of the proposal. */ + voter?: string; + /** options is the weighted vote options. */ + options?: WeightedVoteOptionAmino[]; + /** + * metadata is any arbitrary metadata attached to the vote. + * the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/gov#vote-5 + */ + metadata?: string; +} +export interface VoteAminoMsg { + type: "cosmos-sdk/v1/Vote"; + value: VoteAmino; +} +/** + * Vote defines a vote on a governance proposal. + * A Vote consists of a proposal ID, the voter, and the vote option. + */ +export interface VoteSDKType { + proposal_id: bigint; + voter: string; + options: WeightedVoteOptionSDKType[]; + metadata: string; +} +/** DepositParams defines the params for deposits on governance proposals. */ +/** @deprecated */ +export interface DepositParams { + /** Minimum deposit for a proposal to enter voting period. */ + minDeposit: Coin[]; + /** + * Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + * months. + */ + maxDepositPeriod?: Duration; +} +export interface DepositParamsProtoMsg { + typeUrl: "/cosmos.gov.v1.DepositParams"; + value: Uint8Array; +} +/** DepositParams defines the params for deposits on governance proposals. */ +/** @deprecated */ +export interface DepositParamsAmino { + /** Minimum deposit for a proposal to enter voting period. */ + min_deposit?: CoinAmino[]; + /** + * Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + * months. + */ + max_deposit_period?: DurationAmino; +} +export interface DepositParamsAminoMsg { + type: "cosmos-sdk/v1/DepositParams"; + value: DepositParamsAmino; +} +/** DepositParams defines the params for deposits on governance proposals. */ +/** @deprecated */ +export interface DepositParamsSDKType { + min_deposit: CoinSDKType[]; + max_deposit_period?: DurationSDKType; +} +/** VotingParams defines the params for voting on governance proposals. */ +/** @deprecated */ +export interface VotingParams { + /** Duration of the voting period. */ + votingPeriod?: Duration; +} +export interface VotingParamsProtoMsg { + typeUrl: "/cosmos.gov.v1.VotingParams"; + value: Uint8Array; +} +/** VotingParams defines the params for voting on governance proposals. */ +/** @deprecated */ +export interface VotingParamsAmino { + /** Duration of the voting period. */ + voting_period?: DurationAmino; +} +export interface VotingParamsAminoMsg { + type: "cosmos-sdk/v1/VotingParams"; + value: VotingParamsAmino; +} +/** VotingParams defines the params for voting on governance proposals. */ +/** @deprecated */ +export interface VotingParamsSDKType { + voting_period?: DurationSDKType; +} +/** TallyParams defines the params for tallying votes on governance proposals. */ +/** @deprecated */ +export interface TallyParams { + /** + * Minimum percentage of total stake needed to vote for a result to be + * considered valid. + */ + quorum: string; + /** Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. */ + threshold: string; + /** + * Minimum value of Veto votes to Total votes ratio for proposal to be + * vetoed. Default value: 1/3. + */ + vetoThreshold: string; +} +export interface TallyParamsProtoMsg { + typeUrl: "/cosmos.gov.v1.TallyParams"; + value: Uint8Array; +} +/** TallyParams defines the params for tallying votes on governance proposals. */ +/** @deprecated */ +export interface TallyParamsAmino { + /** + * Minimum percentage of total stake needed to vote for a result to be + * considered valid. + */ + quorum?: string; + /** Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. */ + threshold?: string; + /** + * Minimum value of Veto votes to Total votes ratio for proposal to be + * vetoed. Default value: 1/3. + */ + veto_threshold?: string; +} +export interface TallyParamsAminoMsg { + type: "cosmos-sdk/v1/TallyParams"; + value: TallyParamsAmino; +} +/** TallyParams defines the params for tallying votes on governance proposals. */ +/** @deprecated */ +export interface TallyParamsSDKType { + quorum: string; + threshold: string; + veto_threshold: string; +} +/** + * Params defines the parameters for the x/gov module. + * + * Since: cosmos-sdk 0.47 + */ +export interface Params { + /** Minimum deposit for a proposal to enter voting period. */ + minDeposit: Coin[]; + /** + * Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + * months. + */ + maxDepositPeriod?: Duration; + /** Duration of the voting period. */ + votingPeriod?: Duration; + /** + * Minimum percentage of total stake needed to vote for a result to be + * considered valid. + */ + quorum: string; + /** Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. */ + threshold: string; + /** + * Minimum value of Veto votes to Total votes ratio for proposal to be + * vetoed. Default value: 1/3. + */ + vetoThreshold: string; + /** The ratio representing the proportion of the deposit value that must be paid at proposal submission. */ + minInitialDepositRatio: string; + /** + * The cancel ratio which will not be returned back to the depositors when a proposal is cancelled. + * + * Since: cosmos-sdk 0.50 + */ + proposalCancelRatio: string; + /** + * The address which will receive (proposal_cancel_ratio * deposit) proposal deposits. + * If empty, the (proposal_cancel_ratio * deposit) proposal deposits will be burned. + * + * Since: cosmos-sdk 0.50 + */ + proposalCancelDest: string; + /** + * Duration of the voting period of an expedited proposal. + * + * Since: cosmos-sdk 0.50 + */ + expeditedVotingPeriod?: Duration; + /** + * Minimum proportion of Yes votes for proposal to pass. Default value: 0.67. + * + * Since: cosmos-sdk 0.50 + */ + expeditedThreshold: string; + /** Minimum expedited deposit for a proposal to enter voting period. */ + expeditedMinDeposit: Coin[]; + /** burn deposits if a proposal does not meet quorum */ + burnVoteQuorum: boolean; + /** burn deposits if the proposal does not enter voting period */ + burnProposalDepositPrevote: boolean; + /** burn deposits if quorum with vote type no_veto is met */ + burnVoteVeto: boolean; + /** + * The ratio representing the proportion of the deposit value minimum that must be met when making a deposit. + * Default value: 0.01. Meaning that for a chain with a min_deposit of 100stake, a deposit of 1stake would be + * required. + * + * Since: cosmos-sdk 0.50 + */ + minDepositRatio: string; +} +export interface ParamsProtoMsg { + typeUrl: "/cosmos.gov.v1.Params"; + value: Uint8Array; +} +/** + * Params defines the parameters for the x/gov module. + * + * Since: cosmos-sdk 0.47 + */ +export interface ParamsAmino { + /** Minimum deposit for a proposal to enter voting period. */ + min_deposit: CoinAmino[]; + /** + * Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + * months. + */ + max_deposit_period?: DurationAmino; + /** Duration of the voting period. */ + voting_period?: DurationAmino; + /** + * Minimum percentage of total stake needed to vote for a result to be + * considered valid. + */ + quorum?: string; + /** Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. */ + threshold?: string; + /** + * Minimum value of Veto votes to Total votes ratio for proposal to be + * vetoed. Default value: 1/3. + */ + veto_threshold?: string; + /** The ratio representing the proportion of the deposit value that must be paid at proposal submission. */ + min_initial_deposit_ratio?: string; + /** + * The cancel ratio which will not be returned back to the depositors when a proposal is cancelled. + * + * Since: cosmos-sdk 0.50 + */ + proposal_cancel_ratio?: string; + /** + * The address which will receive (proposal_cancel_ratio * deposit) proposal deposits. + * If empty, the (proposal_cancel_ratio * deposit) proposal deposits will be burned. + * + * Since: cosmos-sdk 0.50 + */ + proposal_cancel_dest?: string; + /** + * Duration of the voting period of an expedited proposal. + * + * Since: cosmos-sdk 0.50 + */ + expedited_voting_period?: DurationAmino; + /** + * Minimum proportion of Yes votes for proposal to pass. Default value: 0.67. + * + * Since: cosmos-sdk 0.50 + */ + expedited_threshold?: string; + /** Minimum expedited deposit for a proposal to enter voting period. */ + expedited_min_deposit: CoinAmino[]; + /** burn deposits if a proposal does not meet quorum */ + burn_vote_quorum?: boolean; + /** burn deposits if the proposal does not enter voting period */ + burn_proposal_deposit_prevote?: boolean; + /** burn deposits if quorum with vote type no_veto is met */ + burn_vote_veto?: boolean; + /** + * The ratio representing the proportion of the deposit value minimum that must be met when making a deposit. + * Default value: 0.01. Meaning that for a chain with a min_deposit of 100stake, a deposit of 1stake would be + * required. + * + * Since: cosmos-sdk 0.50 + */ + min_deposit_ratio?: string; +} +export interface ParamsAminoMsg { + type: "cosmos-sdk/v1/Params"; + value: ParamsAmino; +} +/** + * Params defines the parameters for the x/gov module. + * + * Since: cosmos-sdk 0.47 + */ +export interface ParamsSDKType { + min_deposit: CoinSDKType[]; + max_deposit_period?: DurationSDKType; + voting_period?: DurationSDKType; + quorum: string; + threshold: string; + veto_threshold: string; + min_initial_deposit_ratio: string; + proposal_cancel_ratio: string; + proposal_cancel_dest: string; + expedited_voting_period?: DurationSDKType; + expedited_threshold: string; + expedited_min_deposit: CoinSDKType[]; + burn_vote_quorum: boolean; + burn_proposal_deposit_prevote: boolean; + burn_vote_veto: boolean; + min_deposit_ratio: string; +} +function createBaseWeightedVoteOption(): WeightedVoteOption { + return { + option: 0, + weight: "" + }; +} +export const WeightedVoteOption = { + typeUrl: "/cosmos.gov.v1.WeightedVoteOption", + encode(message: WeightedVoteOption, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.option !== 0) { + writer.uint32(8).int32(message.option); + } + if (message.weight !== "") { + writer.uint32(18).string(message.weight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): WeightedVoteOption { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseWeightedVoteOption(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.option = (reader.int32() as any); + break; + case 2: + message.weight = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): WeightedVoteOption { + const message = createBaseWeightedVoteOption(); + message.option = object.option ?? 0; + message.weight = object.weight ?? ""; + return message; + }, + fromAmino(object: WeightedVoteOptionAmino): WeightedVoteOption { + const message = createBaseWeightedVoteOption(); + if (object.option !== undefined && object.option !== null) { + message.option = object.option; + } + if (object.weight !== undefined && object.weight !== null) { + message.weight = object.weight; + } + return message; + }, + toAmino(message: WeightedVoteOption): WeightedVoteOptionAmino { + const obj: any = {}; + obj.option = message.option === 0 ? undefined : message.option; + obj.weight = message.weight === "" ? undefined : message.weight; + return obj; + }, + fromAminoMsg(object: WeightedVoteOptionAminoMsg): WeightedVoteOption { + return WeightedVoteOption.fromAmino(object.value); + }, + toAminoMsg(message: WeightedVoteOption): WeightedVoteOptionAminoMsg { + return { + type: "cosmos-sdk/v1/WeightedVoteOption", + value: WeightedVoteOption.toAmino(message) + }; + }, + fromProtoMsg(message: WeightedVoteOptionProtoMsg): WeightedVoteOption { + return WeightedVoteOption.decode(message.value); + }, + toProto(message: WeightedVoteOption): Uint8Array { + return WeightedVoteOption.encode(message).finish(); + }, + toProtoMsg(message: WeightedVoteOption): WeightedVoteOptionProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.WeightedVoteOption", + value: WeightedVoteOption.encode(message).finish() + }; + } +}; +function createBaseDeposit(): Deposit { + return { + proposalId: BigInt(0), + depositor: "", + amount: [] + }; +} +export const Deposit = { + typeUrl: "/cosmos.gov.v1.Deposit", + encode(message: Deposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.depositor !== "") { + writer.uint32(18).string(message.depositor); + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Deposit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeposit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.depositor = reader.string(); + break; + case 3: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Deposit { + const message = createBaseDeposit(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.depositor = object.depositor ?? ""; + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: DepositAmino): Deposit { + const message = createBaseDeposit(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: Deposit): DepositAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.depositor = message.depositor === "" ? undefined : message.depositor; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = message.amount; + } + return obj; + }, + fromAminoMsg(object: DepositAminoMsg): Deposit { + return Deposit.fromAmino(object.value); + }, + toAminoMsg(message: Deposit): DepositAminoMsg { + return { + type: "cosmos-sdk/v1/Deposit", + value: Deposit.toAmino(message) + }; + }, + fromProtoMsg(message: DepositProtoMsg): Deposit { + return Deposit.decode(message.value); + }, + toProto(message: Deposit): Uint8Array { + return Deposit.encode(message).finish(); + }, + toProtoMsg(message: Deposit): DepositProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.Deposit", + value: Deposit.encode(message).finish() + }; + } +}; +function createBaseProposal(): Proposal { + return { + id: BigInt(0), + messages: [], + status: 0, + finalTallyResult: undefined, + submitTime: undefined, + depositEndTime: undefined, + totalDeposit: [], + votingStartTime: undefined, + votingEndTime: undefined, + metadata: "", + title: "", + summary: "", + proposer: "", + expedited: false, + failedReason: "" + }; +} +export const Proposal = { + typeUrl: "/cosmos.gov.v1.Proposal", + encode(message: Proposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { + writer.uint32(8).uint64(message.id); + } + for (const v of message.messages) { + Any.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.status !== 0) { + writer.uint32(24).int32(message.status); + } + if (message.finalTallyResult !== undefined) { + TallyResult.encode(message.finalTallyResult, writer.uint32(34).fork()).ldelim(); + } + if (message.submitTime !== undefined) { + Timestamp.encode(toTimestamp(message.submitTime), writer.uint32(42).fork()).ldelim(); + } + if (message.depositEndTime !== undefined) { + Timestamp.encode(toTimestamp(message.depositEndTime), writer.uint32(50).fork()).ldelim(); + } + for (const v of message.totalDeposit) { + Coin.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.votingStartTime !== undefined) { + Timestamp.encode(toTimestamp(message.votingStartTime), writer.uint32(66).fork()).ldelim(); + } + if (message.votingEndTime !== undefined) { + Timestamp.encode(toTimestamp(message.votingEndTime), writer.uint32(74).fork()).ldelim(); + } + if (message.metadata !== "") { + writer.uint32(82).string(message.metadata); + } + if (message.title !== "") { + writer.uint32(90).string(message.title); + } + if (message.summary !== "") { + writer.uint32(98).string(message.summary); + } + if (message.proposer !== "") { + writer.uint32(106).string(message.proposer); + } + if (message.expedited === true) { + writer.uint32(112).bool(message.expedited); + } + if (message.failedReason !== "") { + writer.uint32(122).string(message.failedReason); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Proposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint64(); + break; + case 2: + message.messages.push(Any.decode(reader, reader.uint32())); + break; + case 3: + message.status = (reader.int32() as any); + break; + case 4: + message.finalTallyResult = TallyResult.decode(reader, reader.uint32()); + break; + case 5: + message.submitTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 6: + message.depositEndTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 7: + message.totalDeposit.push(Coin.decode(reader, reader.uint32())); + break; + case 8: + message.votingStartTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 9: + message.votingEndTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 10: + message.metadata = reader.string(); + break; + case 11: + message.title = reader.string(); + break; + case 12: + message.summary = reader.string(); + break; + case 13: + message.proposer = reader.string(); + break; + case 14: + message.expedited = reader.bool(); + break; + case 15: + message.failedReason = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Proposal { + const message = createBaseProposal(); + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); + message.messages = object.messages?.map(e => Any.fromPartial(e)) || []; + message.status = object.status ?? 0; + message.finalTallyResult = object.finalTallyResult !== undefined && object.finalTallyResult !== null ? TallyResult.fromPartial(object.finalTallyResult) : undefined; + message.submitTime = object.submitTime ?? undefined; + message.depositEndTime = object.depositEndTime ?? undefined; + message.totalDeposit = object.totalDeposit?.map(e => Coin.fromPartial(e)) || []; + message.votingStartTime = object.votingStartTime ?? undefined; + message.votingEndTime = object.votingEndTime ?? undefined; + message.metadata = object.metadata ?? ""; + message.title = object.title ?? ""; + message.summary = object.summary ?? ""; + message.proposer = object.proposer ?? ""; + message.expedited = object.expedited ?? false; + message.failedReason = object.failedReason ?? ""; + return message; + }, + fromAmino(object: ProposalAmino): Proposal { + const message = createBaseProposal(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + message.messages = object.messages?.map(e => Any.fromAmino(e)) || []; + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.final_tally_result !== undefined && object.final_tally_result !== null) { + message.finalTallyResult = TallyResult.fromAmino(object.final_tally_result); + } + if (object.submit_time !== undefined && object.submit_time !== null) { + message.submitTime = fromTimestamp(Timestamp.fromAmino(object.submit_time)); + } + if (object.deposit_end_time !== undefined && object.deposit_end_time !== null) { + message.depositEndTime = fromTimestamp(Timestamp.fromAmino(object.deposit_end_time)); + } + message.totalDeposit = object.total_deposit?.map(e => Coin.fromAmino(e)) || []; + if (object.voting_start_time !== undefined && object.voting_start_time !== null) { + message.votingStartTime = fromTimestamp(Timestamp.fromAmino(object.voting_start_time)); + } + if (object.voting_end_time !== undefined && object.voting_end_time !== null) { + message.votingEndTime = fromTimestamp(Timestamp.fromAmino(object.voting_end_time)); + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.summary !== undefined && object.summary !== null) { + message.summary = object.summary; + } + if (object.proposer !== undefined && object.proposer !== null) { + message.proposer = object.proposer; + } + if (object.expedited !== undefined && object.expedited !== null) { + message.expedited = object.expedited; + } + if (object.failed_reason !== undefined && object.failed_reason !== null) { + message.failedReason = object.failed_reason; + } + return message; + }, + toAmino(message: Proposal): ProposalAmino { + const obj: any = {}; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + if (message.messages) { + obj.messages = message.messages.map(e => e ? Any.toAmino(e) : undefined); + } else { + obj.messages = message.messages; + } + obj.status = message.status === 0 ? undefined : message.status; + obj.final_tally_result = message.finalTallyResult ? TallyResult.toAmino(message.finalTallyResult) : undefined; + obj.submit_time = message.submitTime ? Timestamp.toAmino(toTimestamp(message.submitTime)) : undefined; + obj.deposit_end_time = message.depositEndTime ? Timestamp.toAmino(toTimestamp(message.depositEndTime)) : undefined; + if (message.totalDeposit) { + obj.total_deposit = message.totalDeposit.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.total_deposit = message.totalDeposit; + } + obj.voting_start_time = message.votingStartTime ? Timestamp.toAmino(toTimestamp(message.votingStartTime)) : undefined; + obj.voting_end_time = message.votingEndTime ? Timestamp.toAmino(toTimestamp(message.votingEndTime)) : undefined; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + obj.title = message.title === "" ? undefined : message.title; + obj.summary = message.summary === "" ? undefined : message.summary; + obj.proposer = message.proposer === "" ? undefined : message.proposer; + obj.expedited = message.expedited === false ? undefined : message.expedited; + obj.failed_reason = message.failedReason === "" ? undefined : message.failedReason; + return obj; + }, + fromAminoMsg(object: ProposalAminoMsg): Proposal { + return Proposal.fromAmino(object.value); + }, + toAminoMsg(message: Proposal): ProposalAminoMsg { + return { + type: "cosmos-sdk/v1/Proposal", + value: Proposal.toAmino(message) + }; + }, + fromProtoMsg(message: ProposalProtoMsg): Proposal { + return Proposal.decode(message.value); + }, + toProto(message: Proposal): Uint8Array { + return Proposal.encode(message).finish(); + }, + toProtoMsg(message: Proposal): ProposalProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.Proposal", + value: Proposal.encode(message).finish() + }; + } +}; +function createBaseTallyResult(): TallyResult { + return { + yesCount: "", + abstainCount: "", + noCount: "", + noWithVetoCount: "" + }; +} +export const TallyResult = { + typeUrl: "/cosmos.gov.v1.TallyResult", + encode(message: TallyResult, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.yesCount !== "") { + writer.uint32(10).string(message.yesCount); + } + if (message.abstainCount !== "") { + writer.uint32(18).string(message.abstainCount); + } + if (message.noCount !== "") { + writer.uint32(26).string(message.noCount); + } + if (message.noWithVetoCount !== "") { + writer.uint32(34).string(message.noWithVetoCount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TallyResult { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTallyResult(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.yesCount = reader.string(); + break; + case 2: + message.abstainCount = reader.string(); + break; + case 3: + message.noCount = reader.string(); + break; + case 4: + message.noWithVetoCount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TallyResult { + const message = createBaseTallyResult(); + message.yesCount = object.yesCount ?? ""; + message.abstainCount = object.abstainCount ?? ""; + message.noCount = object.noCount ?? ""; + message.noWithVetoCount = object.noWithVetoCount ?? ""; + return message; + }, + fromAmino(object: TallyResultAmino): TallyResult { + const message = createBaseTallyResult(); + if (object.yes_count !== undefined && object.yes_count !== null) { + message.yesCount = object.yes_count; + } + if (object.abstain_count !== undefined && object.abstain_count !== null) { + message.abstainCount = object.abstain_count; + } + if (object.no_count !== undefined && object.no_count !== null) { + message.noCount = object.no_count; + } + if (object.no_with_veto_count !== undefined && object.no_with_veto_count !== null) { + message.noWithVetoCount = object.no_with_veto_count; + } + return message; + }, + toAmino(message: TallyResult): TallyResultAmino { + const obj: any = {}; + obj.yes_count = message.yesCount === "" ? undefined : message.yesCount; + obj.abstain_count = message.abstainCount === "" ? undefined : message.abstainCount; + obj.no_count = message.noCount === "" ? undefined : message.noCount; + obj.no_with_veto_count = message.noWithVetoCount === "" ? undefined : message.noWithVetoCount; + return obj; + }, + fromAminoMsg(object: TallyResultAminoMsg): TallyResult { + return TallyResult.fromAmino(object.value); + }, + toAminoMsg(message: TallyResult): TallyResultAminoMsg { + return { + type: "cosmos-sdk/v1/TallyResult", + value: TallyResult.toAmino(message) + }; + }, + fromProtoMsg(message: TallyResultProtoMsg): TallyResult { + return TallyResult.decode(message.value); + }, + toProto(message: TallyResult): Uint8Array { + return TallyResult.encode(message).finish(); + }, + toProtoMsg(message: TallyResult): TallyResultProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.TallyResult", + value: TallyResult.encode(message).finish() + }; + } +}; +function createBaseVote(): Vote { + return { + proposalId: BigInt(0), + voter: "", + options: [], + metadata: "" + }; +} +export const Vote = { + typeUrl: "/cosmos.gov.v1.Vote", + encode(message: Vote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.voter !== "") { + writer.uint32(18).string(message.voter); + } + for (const v of message.options) { + WeightedVoteOption.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.metadata !== "") { + writer.uint32(42).string(message.metadata); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Vote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVote(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.voter = reader.string(); + break; + case 4: + message.options.push(WeightedVoteOption.decode(reader, reader.uint32())); + break; + case 5: + message.metadata = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Vote { + const message = createBaseVote(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.voter = object.voter ?? ""; + message.options = object.options?.map(e => WeightedVoteOption.fromPartial(e)) || []; + message.metadata = object.metadata ?? ""; + return message; + }, + fromAmino(object: VoteAmino): Vote { + const message = createBaseVote(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + message.options = object.options?.map(e => WeightedVoteOption.fromAmino(e)) || []; + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + return message; + }, + toAmino(message: Vote): VoteAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.voter = message.voter === "" ? undefined : message.voter; + if (message.options) { + obj.options = message.options.map(e => e ? WeightedVoteOption.toAmino(e) : undefined); + } else { + obj.options = message.options; + } + obj.metadata = message.metadata === "" ? undefined : message.metadata; + return obj; + }, + fromAminoMsg(object: VoteAminoMsg): Vote { + return Vote.fromAmino(object.value); + }, + toAminoMsg(message: Vote): VoteAminoMsg { + return { + type: "cosmos-sdk/v1/Vote", + value: Vote.toAmino(message) + }; + }, + fromProtoMsg(message: VoteProtoMsg): Vote { + return Vote.decode(message.value); + }, + toProto(message: Vote): Uint8Array { + return Vote.encode(message).finish(); + }, + toProtoMsg(message: Vote): VoteProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.Vote", + value: Vote.encode(message).finish() + }; + } +}; +function createBaseDepositParams(): DepositParams { + return { + minDeposit: [], + maxDepositPeriod: undefined + }; +} +export const DepositParams = { + typeUrl: "/cosmos.gov.v1.DepositParams", + encode(message: DepositParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.minDeposit) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.maxDepositPeriod !== undefined) { + Duration.encode(message.maxDepositPeriod, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DepositParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDepositParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.minDeposit.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.maxDepositPeriod = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DepositParams { + const message = createBaseDepositParams(); + message.minDeposit = object.minDeposit?.map(e => Coin.fromPartial(e)) || []; + message.maxDepositPeriod = object.maxDepositPeriod !== undefined && object.maxDepositPeriod !== null ? Duration.fromPartial(object.maxDepositPeriod) : undefined; + return message; + }, + fromAmino(object: DepositParamsAmino): DepositParams { + const message = createBaseDepositParams(); + message.minDeposit = object.min_deposit?.map(e => Coin.fromAmino(e)) || []; + if (object.max_deposit_period !== undefined && object.max_deposit_period !== null) { + message.maxDepositPeriod = Duration.fromAmino(object.max_deposit_period); + } + return message; + }, + toAmino(message: DepositParams): DepositParamsAmino { + const obj: any = {}; + if (message.minDeposit) { + obj.min_deposit = message.minDeposit.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.min_deposit = message.minDeposit; + } + obj.max_deposit_period = message.maxDepositPeriod ? Duration.toAmino(message.maxDepositPeriod) : undefined; + return obj; + }, + fromAminoMsg(object: DepositParamsAminoMsg): DepositParams { + return DepositParams.fromAmino(object.value); + }, + toAminoMsg(message: DepositParams): DepositParamsAminoMsg { + return { + type: "cosmos-sdk/v1/DepositParams", + value: DepositParams.toAmino(message) + }; + }, + fromProtoMsg(message: DepositParamsProtoMsg): DepositParams { + return DepositParams.decode(message.value); + }, + toProto(message: DepositParams): Uint8Array { + return DepositParams.encode(message).finish(); + }, + toProtoMsg(message: DepositParams): DepositParamsProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.DepositParams", + value: DepositParams.encode(message).finish() + }; + } +}; +function createBaseVotingParams(): VotingParams { + return { + votingPeriod: undefined + }; +} +export const VotingParams = { + typeUrl: "/cosmos.gov.v1.VotingParams", + encode(message: VotingParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.votingPeriod !== undefined) { + Duration.encode(message.votingPeriod, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): VotingParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVotingParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votingPeriod = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): VotingParams { + const message = createBaseVotingParams(); + message.votingPeriod = object.votingPeriod !== undefined && object.votingPeriod !== null ? Duration.fromPartial(object.votingPeriod) : undefined; + return message; + }, + fromAmino(object: VotingParamsAmino): VotingParams { + const message = createBaseVotingParams(); + if (object.voting_period !== undefined && object.voting_period !== null) { + message.votingPeriod = Duration.fromAmino(object.voting_period); + } + return message; + }, + toAmino(message: VotingParams): VotingParamsAmino { + const obj: any = {}; + obj.voting_period = message.votingPeriod ? Duration.toAmino(message.votingPeriod) : undefined; + return obj; + }, + fromAminoMsg(object: VotingParamsAminoMsg): VotingParams { + return VotingParams.fromAmino(object.value); + }, + toAminoMsg(message: VotingParams): VotingParamsAminoMsg { + return { + type: "cosmos-sdk/v1/VotingParams", + value: VotingParams.toAmino(message) + }; + }, + fromProtoMsg(message: VotingParamsProtoMsg): VotingParams { + return VotingParams.decode(message.value); + }, + toProto(message: VotingParams): Uint8Array { + return VotingParams.encode(message).finish(); + }, + toProtoMsg(message: VotingParams): VotingParamsProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.VotingParams", + value: VotingParams.encode(message).finish() + }; + } +}; +function createBaseTallyParams(): TallyParams { + return { + quorum: "", + threshold: "", + vetoThreshold: "" + }; +} +export const TallyParams = { + typeUrl: "/cosmos.gov.v1.TallyParams", + encode(message: TallyParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.quorum !== "") { + writer.uint32(10).string(message.quorum); + } + if (message.threshold !== "") { + writer.uint32(18).string(message.threshold); + } + if (message.vetoThreshold !== "") { + writer.uint32(26).string(message.vetoThreshold); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TallyParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTallyParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.quorum = reader.string(); + break; + case 2: + message.threshold = reader.string(); + break; + case 3: + message.vetoThreshold = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TallyParams { + const message = createBaseTallyParams(); + message.quorum = object.quorum ?? ""; + message.threshold = object.threshold ?? ""; + message.vetoThreshold = object.vetoThreshold ?? ""; + return message; + }, + fromAmino(object: TallyParamsAmino): TallyParams { + const message = createBaseTallyParams(); + if (object.quorum !== undefined && object.quorum !== null) { + message.quorum = object.quorum; + } + if (object.threshold !== undefined && object.threshold !== null) { + message.threshold = object.threshold; + } + if (object.veto_threshold !== undefined && object.veto_threshold !== null) { + message.vetoThreshold = object.veto_threshold; + } + return message; + }, + toAmino(message: TallyParams): TallyParamsAmino { + const obj: any = {}; + obj.quorum = message.quorum === "" ? undefined : message.quorum; + obj.threshold = message.threshold === "" ? undefined : message.threshold; + obj.veto_threshold = message.vetoThreshold === "" ? undefined : message.vetoThreshold; + return obj; + }, + fromAminoMsg(object: TallyParamsAminoMsg): TallyParams { + return TallyParams.fromAmino(object.value); + }, + toAminoMsg(message: TallyParams): TallyParamsAminoMsg { + return { + type: "cosmos-sdk/v1/TallyParams", + value: TallyParams.toAmino(message) + }; + }, + fromProtoMsg(message: TallyParamsProtoMsg): TallyParams { + return TallyParams.decode(message.value); + }, + toProto(message: TallyParams): Uint8Array { + return TallyParams.encode(message).finish(); + }, + toProtoMsg(message: TallyParams): TallyParamsProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.TallyParams", + value: TallyParams.encode(message).finish() + }; + } +}; +function createBaseParams(): Params { + return { + minDeposit: [], + maxDepositPeriod: undefined, + votingPeriod: undefined, + quorum: "", + threshold: "", + vetoThreshold: "", + minInitialDepositRatio: "", + proposalCancelRatio: "", + proposalCancelDest: "", + expeditedVotingPeriod: undefined, + expeditedThreshold: "", + expeditedMinDeposit: [], + burnVoteQuorum: false, + burnProposalDepositPrevote: false, + burnVoteVeto: false, + minDepositRatio: "" + }; +} +export const Params = { + typeUrl: "/cosmos.gov.v1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.minDeposit) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.maxDepositPeriod !== undefined) { + Duration.encode(message.maxDepositPeriod, writer.uint32(18).fork()).ldelim(); + } + if (message.votingPeriod !== undefined) { + Duration.encode(message.votingPeriod, writer.uint32(26).fork()).ldelim(); + } + if (message.quorum !== "") { + writer.uint32(34).string(message.quorum); + } + if (message.threshold !== "") { + writer.uint32(42).string(message.threshold); + } + if (message.vetoThreshold !== "") { + writer.uint32(50).string(message.vetoThreshold); + } + if (message.minInitialDepositRatio !== "") { + writer.uint32(58).string(message.minInitialDepositRatio); + } + if (message.proposalCancelRatio !== "") { + writer.uint32(66).string(message.proposalCancelRatio); + } + if (message.proposalCancelDest !== "") { + writer.uint32(74).string(message.proposalCancelDest); + } + if (message.expeditedVotingPeriod !== undefined) { + Duration.encode(message.expeditedVotingPeriod, writer.uint32(82).fork()).ldelim(); + } + if (message.expeditedThreshold !== "") { + writer.uint32(90).string(message.expeditedThreshold); + } + for (const v of message.expeditedMinDeposit) { + Coin.encode(v!, writer.uint32(98).fork()).ldelim(); + } + if (message.burnVoteQuorum === true) { + writer.uint32(104).bool(message.burnVoteQuorum); + } + if (message.burnProposalDepositPrevote === true) { + writer.uint32(112).bool(message.burnProposalDepositPrevote); + } + if (message.burnVoteVeto === true) { + writer.uint32(120).bool(message.burnVoteVeto); + } + if (message.minDepositRatio !== "") { + writer.uint32(130).string(message.minDepositRatio); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.minDeposit.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.maxDepositPeriod = Duration.decode(reader, reader.uint32()); + break; + case 3: + message.votingPeriod = Duration.decode(reader, reader.uint32()); + break; + case 4: + message.quorum = reader.string(); + break; + case 5: + message.threshold = reader.string(); + break; + case 6: + message.vetoThreshold = reader.string(); + break; + case 7: + message.minInitialDepositRatio = reader.string(); + break; + case 8: + message.proposalCancelRatio = reader.string(); + break; + case 9: + message.proposalCancelDest = reader.string(); + break; + case 10: + message.expeditedVotingPeriod = Duration.decode(reader, reader.uint32()); + break; + case 11: + message.expeditedThreshold = reader.string(); + break; + case 12: + message.expeditedMinDeposit.push(Coin.decode(reader, reader.uint32())); + break; + case 13: + message.burnVoteQuorum = reader.bool(); + break; + case 14: + message.burnProposalDepositPrevote = reader.bool(); + break; + case 15: + message.burnVoteVeto = reader.bool(); + break; + case 16: + message.minDepositRatio = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.minDeposit = object.minDeposit?.map(e => Coin.fromPartial(e)) || []; + message.maxDepositPeriod = object.maxDepositPeriod !== undefined && object.maxDepositPeriod !== null ? Duration.fromPartial(object.maxDepositPeriod) : undefined; + message.votingPeriod = object.votingPeriod !== undefined && object.votingPeriod !== null ? Duration.fromPartial(object.votingPeriod) : undefined; + message.quorum = object.quorum ?? ""; + message.threshold = object.threshold ?? ""; + message.vetoThreshold = object.vetoThreshold ?? ""; + message.minInitialDepositRatio = object.minInitialDepositRatio ?? ""; + message.proposalCancelRatio = object.proposalCancelRatio ?? ""; + message.proposalCancelDest = object.proposalCancelDest ?? ""; + message.expeditedVotingPeriod = object.expeditedVotingPeriod !== undefined && object.expeditedVotingPeriod !== null ? Duration.fromPartial(object.expeditedVotingPeriod) : undefined; + message.expeditedThreshold = object.expeditedThreshold ?? ""; + message.expeditedMinDeposit = object.expeditedMinDeposit?.map(e => Coin.fromPartial(e)) || []; + message.burnVoteQuorum = object.burnVoteQuorum ?? false; + message.burnProposalDepositPrevote = object.burnProposalDepositPrevote ?? false; + message.burnVoteVeto = object.burnVoteVeto ?? false; + message.minDepositRatio = object.minDepositRatio ?? ""; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + message.minDeposit = object.min_deposit?.map(e => Coin.fromAmino(e)) || []; + if (object.max_deposit_period !== undefined && object.max_deposit_period !== null) { + message.maxDepositPeriod = Duration.fromAmino(object.max_deposit_period); + } + if (object.voting_period !== undefined && object.voting_period !== null) { + message.votingPeriod = Duration.fromAmino(object.voting_period); + } + if (object.quorum !== undefined && object.quorum !== null) { + message.quorum = object.quorum; + } + if (object.threshold !== undefined && object.threshold !== null) { + message.threshold = object.threshold; + } + if (object.veto_threshold !== undefined && object.veto_threshold !== null) { + message.vetoThreshold = object.veto_threshold; + } + if (object.min_initial_deposit_ratio !== undefined && object.min_initial_deposit_ratio !== null) { + message.minInitialDepositRatio = object.min_initial_deposit_ratio; + } + if (object.proposal_cancel_ratio !== undefined && object.proposal_cancel_ratio !== null) { + message.proposalCancelRatio = object.proposal_cancel_ratio; + } + if (object.proposal_cancel_dest !== undefined && object.proposal_cancel_dest !== null) { + message.proposalCancelDest = object.proposal_cancel_dest; + } + if (object.expedited_voting_period !== undefined && object.expedited_voting_period !== null) { + message.expeditedVotingPeriod = Duration.fromAmino(object.expedited_voting_period); + } + if (object.expedited_threshold !== undefined && object.expedited_threshold !== null) { + message.expeditedThreshold = object.expedited_threshold; + } + message.expeditedMinDeposit = object.expedited_min_deposit?.map(e => Coin.fromAmino(e)) || []; + if (object.burn_vote_quorum !== undefined && object.burn_vote_quorum !== null) { + message.burnVoteQuorum = object.burn_vote_quorum; + } + if (object.burn_proposal_deposit_prevote !== undefined && object.burn_proposal_deposit_prevote !== null) { + message.burnProposalDepositPrevote = object.burn_proposal_deposit_prevote; + } + if (object.burn_vote_veto !== undefined && object.burn_vote_veto !== null) { + message.burnVoteVeto = object.burn_vote_veto; + } + if (object.min_deposit_ratio !== undefined && object.min_deposit_ratio !== null) { + message.minDepositRatio = object.min_deposit_ratio; + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + if (message.minDeposit) { + obj.min_deposit = message.minDeposit.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.min_deposit = message.minDeposit; + } + obj.max_deposit_period = message.maxDepositPeriod ? Duration.toAmino(message.maxDepositPeriod) : undefined; + obj.voting_period = message.votingPeriod ? Duration.toAmino(message.votingPeriod) : undefined; + obj.quorum = message.quorum === "" ? undefined : message.quorum; + obj.threshold = message.threshold === "" ? undefined : message.threshold; + obj.veto_threshold = message.vetoThreshold === "" ? undefined : message.vetoThreshold; + obj.min_initial_deposit_ratio = message.minInitialDepositRatio === "" ? undefined : message.minInitialDepositRatio; + obj.proposal_cancel_ratio = message.proposalCancelRatio === "" ? undefined : message.proposalCancelRatio; + obj.proposal_cancel_dest = message.proposalCancelDest === "" ? undefined : message.proposalCancelDest; + obj.expedited_voting_period = message.expeditedVotingPeriod ? Duration.toAmino(message.expeditedVotingPeriod) : undefined; + obj.expedited_threshold = message.expeditedThreshold === "" ? undefined : message.expeditedThreshold; + if (message.expeditedMinDeposit) { + obj.expedited_min_deposit = message.expeditedMinDeposit.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.expedited_min_deposit = message.expeditedMinDeposit; + } + obj.burn_vote_quorum = message.burnVoteQuorum === false ? undefined : message.burnVoteQuorum; + obj.burn_proposal_deposit_prevote = message.burnProposalDepositPrevote === false ? undefined : message.burnProposalDepositPrevote; + obj.burn_vote_veto = message.burnVoteVeto === false ? undefined : message.burnVoteVeto; + obj.min_deposit_ratio = message.minDepositRatio === "" ? undefined : message.minDepositRatio; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "cosmos-sdk/v1/Params", + value: Params.toAmino(message) + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.Params", + value: Params.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/gov/v1/query.lcd.ts b/src/codegen/cosmos/gov/v1/query.lcd.ts new file mode 100644 index 0000000..b1927f1 --- /dev/null +++ b/src/codegen/cosmos/gov/v1/query.lcd.ts @@ -0,0 +1,94 @@ +import { setPaginationParams } from "../../../helpers"; +import { LCDClient } from "@cosmology/lcd"; +import { QueryConstitutionRequest, QueryConstitutionResponseSDKType, QueryProposalRequest, QueryProposalResponseSDKType, QueryProposalsRequest, QueryProposalsResponseSDKType, QueryVoteRequest, QueryVoteResponseSDKType, QueryVotesRequest, QueryVotesResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType, QueryDepositRequest, QueryDepositResponseSDKType, QueryDepositsRequest, QueryDepositsResponseSDKType, QueryTallyResultRequest, QueryTallyResultResponseSDKType } from "./query"; +export class LCDQueryClient { + req: LCDClient; + constructor({ + requestClient + }: { + requestClient: LCDClient; + }) { + this.req = requestClient; + this.constitution = this.constitution.bind(this); + this.proposal = this.proposal.bind(this); + this.proposals = this.proposals.bind(this); + this.vote = this.vote.bind(this); + this.votes = this.votes.bind(this); + this.params = this.params.bind(this); + this.deposit = this.deposit.bind(this); + this.deposits = this.deposits.bind(this); + this.tallyResult = this.tallyResult.bind(this); + } + /* Constitution queries the chain's constitution. */ + async constitution(_params: QueryConstitutionRequest = {}): Promise { + const endpoint = `cosmos/gov/v1/constitution`; + return await this.req.get(endpoint); + } + /* Proposal queries proposal details based on ProposalID. */ + async proposal(params: QueryProposalRequest): Promise { + const endpoint = `cosmos/gov/v1/proposals/${params.proposalId}`; + return await this.req.get(endpoint); + } + /* Proposals queries all proposals based on given status. */ + async proposals(params: QueryProposalsRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.proposalStatus !== "undefined") { + options.params.proposal_status = params.proposalStatus; + } + if (typeof params?.voter !== "undefined") { + options.params.voter = params.voter; + } + if (typeof params?.depositor !== "undefined") { + options.params.depositor = params.depositor; + } + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + const endpoint = `cosmos/gov/v1/proposals`; + return await this.req.get(endpoint, options); + } + /* Vote queries voted information based on proposalID, voterAddr. */ + async vote(params: QueryVoteRequest): Promise { + const endpoint = `cosmos/gov/v1/proposals/${params.proposalId}/votes/${params.voter}`; + return await this.req.get(endpoint); + } + /* Votes queries votes of a given proposal. */ + async votes(params: QueryVotesRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + const endpoint = `cosmos/gov/v1/proposals/${params.proposalId}/votes`; + return await this.req.get(endpoint, options); + } + /* Params queries all parameters of the gov module. */ + async params(params: QueryParamsRequest): Promise { + const endpoint = `cosmos/gov/v1/params/${params.paramsType}`; + return await this.req.get(endpoint); + } + /* Deposit queries single deposit information based on proposalID, depositAddr. */ + async deposit(params: QueryDepositRequest): Promise { + const endpoint = `cosmos/gov/v1/proposals/${params.proposalId}/deposits/${params.depositor}`; + return await this.req.get(endpoint); + } + /* Deposits queries all deposits of a single proposal. */ + async deposits(params: QueryDepositsRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + const endpoint = `cosmos/gov/v1/proposals/${params.proposalId}/deposits`; + return await this.req.get(endpoint, options); + } + /* TallyResult queries the tally of a proposal vote. */ + async tallyResult(params: QueryTallyResultRequest): Promise { + const endpoint = `cosmos/gov/v1/proposals/${params.proposalId}/tally`; + return await this.req.get(endpoint); + } +} \ No newline at end of file diff --git a/src/codegen/cosmos/gov/v1/query.rpc.Query.ts b/src/codegen/cosmos/gov/v1/query.rpc.Query.ts new file mode 100644 index 0000000..7f578a0 --- /dev/null +++ b/src/codegen/cosmos/gov/v1/query.rpc.Query.ts @@ -0,0 +1,118 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryConstitutionRequest, QueryConstitutionResponse, QueryProposalRequest, QueryProposalResponse, QueryProposalsRequest, QueryProposalsResponse, QueryVoteRequest, QueryVoteResponse, QueryVotesRequest, QueryVotesResponse, QueryParamsRequest, QueryParamsResponse, QueryDepositRequest, QueryDepositResponse, QueryDepositsRequest, QueryDepositsResponse, QueryTallyResultRequest, QueryTallyResultResponse } from "./query"; +/** Query defines the gRPC querier service for gov module */ +export interface Query { + /** Constitution queries the chain's constitution. */ + constitution(request?: QueryConstitutionRequest): Promise; + /** Proposal queries proposal details based on ProposalID. */ + proposal(request: QueryProposalRequest): Promise; + /** Proposals queries all proposals based on given status. */ + proposals(request: QueryProposalsRequest): Promise; + /** Vote queries voted information based on proposalID, voterAddr. */ + vote(request: QueryVoteRequest): Promise; + /** Votes queries votes of a given proposal. */ + votes(request: QueryVotesRequest): Promise; + /** Params queries all parameters of the gov module. */ + params(request: QueryParamsRequest): Promise; + /** Deposit queries single deposit information based on proposalID, depositAddr. */ + deposit(request: QueryDepositRequest): Promise; + /** Deposits queries all deposits of a single proposal. */ + deposits(request: QueryDepositsRequest): Promise; + /** TallyResult queries the tally of a proposal vote. */ + tallyResult(request: QueryTallyResultRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.constitution = this.constitution.bind(this); + this.proposal = this.proposal.bind(this); + this.proposals = this.proposals.bind(this); + this.vote = this.vote.bind(this); + this.votes = this.votes.bind(this); + this.params = this.params.bind(this); + this.deposit = this.deposit.bind(this); + this.deposits = this.deposits.bind(this); + this.tallyResult = this.tallyResult.bind(this); + } + constitution(request: QueryConstitutionRequest = {}): Promise { + const data = QueryConstitutionRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Query", "Constitution", data); + return promise.then(data => QueryConstitutionResponse.decode(new BinaryReader(data))); + } + proposal(request: QueryProposalRequest): Promise { + const data = QueryProposalRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Query", "Proposal", data); + return promise.then(data => QueryProposalResponse.decode(new BinaryReader(data))); + } + proposals(request: QueryProposalsRequest): Promise { + const data = QueryProposalsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Query", "Proposals", data); + return promise.then(data => QueryProposalsResponse.decode(new BinaryReader(data))); + } + vote(request: QueryVoteRequest): Promise { + const data = QueryVoteRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Query", "Vote", data); + return promise.then(data => QueryVoteResponse.decode(new BinaryReader(data))); + } + votes(request: QueryVotesRequest): Promise { + const data = QueryVotesRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Query", "Votes", data); + return promise.then(data => QueryVotesResponse.decode(new BinaryReader(data))); + } + params(request: QueryParamsRequest): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); + } + deposit(request: QueryDepositRequest): Promise { + const data = QueryDepositRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Query", "Deposit", data); + return promise.then(data => QueryDepositResponse.decode(new BinaryReader(data))); + } + deposits(request: QueryDepositsRequest): Promise { + const data = QueryDepositsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Query", "Deposits", data); + return promise.then(data => QueryDepositsResponse.decode(new BinaryReader(data))); + } + tallyResult(request: QueryTallyResultRequest): Promise { + const data = QueryTallyResultRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Query", "TallyResult", data); + return promise.then(data => QueryTallyResultResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + constitution(request?: QueryConstitutionRequest): Promise { + return queryService.constitution(request); + }, + proposal(request: QueryProposalRequest): Promise { + return queryService.proposal(request); + }, + proposals(request: QueryProposalsRequest): Promise { + return queryService.proposals(request); + }, + vote(request: QueryVoteRequest): Promise { + return queryService.vote(request); + }, + votes(request: QueryVotesRequest): Promise { + return queryService.votes(request); + }, + params(request: QueryParamsRequest): Promise { + return queryService.params(request); + }, + deposit(request: QueryDepositRequest): Promise { + return queryService.deposit(request); + }, + deposits(request: QueryDepositsRequest): Promise { + return queryService.deposits(request); + }, + tallyResult(request: QueryTallyResultRequest): Promise { + return queryService.tallyResult(request); + } + }; +}; \ No newline at end of file diff --git a/src/codegen/cosmos/gov/v1/query.ts b/src/codegen/cosmos/gov/v1/query.ts new file mode 100644 index 0000000..3907619 --- /dev/null +++ b/src/codegen/cosmos/gov/v1/query.ts @@ -0,0 +1,1895 @@ +import { ProposalStatus, Proposal, ProposalAmino, ProposalSDKType, Vote, VoteAmino, VoteSDKType, VotingParams, VotingParamsAmino, VotingParamsSDKType, DepositParams, DepositParamsAmino, DepositParamsSDKType, TallyParams, TallyParamsAmino, TallyParamsSDKType, Params, ParamsAmino, ParamsSDKType, Deposit, DepositAmino, DepositSDKType, TallyResult, TallyResultAmino, TallyResultSDKType } from "./gov"; +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** QueryConstitutionRequest is the request type for the Query/Constitution RPC method */ +export interface QueryConstitutionRequest {} +export interface QueryConstitutionRequestProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryConstitutionRequest"; + value: Uint8Array; +} +/** QueryConstitutionRequest is the request type for the Query/Constitution RPC method */ +export interface QueryConstitutionRequestAmino {} +export interface QueryConstitutionRequestAminoMsg { + type: "cosmos-sdk/v1/QueryConstitutionRequest"; + value: QueryConstitutionRequestAmino; +} +/** QueryConstitutionRequest is the request type for the Query/Constitution RPC method */ +export interface QueryConstitutionRequestSDKType {} +/** QueryConstitutionResponse is the response type for the Query/Constitution RPC method */ +export interface QueryConstitutionResponse { + constitution: string; +} +export interface QueryConstitutionResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryConstitutionResponse"; + value: Uint8Array; +} +/** QueryConstitutionResponse is the response type for the Query/Constitution RPC method */ +export interface QueryConstitutionResponseAmino { + constitution?: string; +} +export interface QueryConstitutionResponseAminoMsg { + type: "cosmos-sdk/v1/QueryConstitutionResponse"; + value: QueryConstitutionResponseAmino; +} +/** QueryConstitutionResponse is the response type for the Query/Constitution RPC method */ +export interface QueryConstitutionResponseSDKType { + constitution: string; +} +/** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ +export interface QueryProposalRequest { + /** proposal_id defines the unique id of the proposal. */ + proposalId: bigint; +} +export interface QueryProposalRequestProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryProposalRequest"; + value: Uint8Array; +} +/** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ +export interface QueryProposalRequestAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id?: string; +} +export interface QueryProposalRequestAminoMsg { + type: "cosmos-sdk/v1/QueryProposalRequest"; + value: QueryProposalRequestAmino; +} +/** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ +export interface QueryProposalRequestSDKType { + proposal_id: bigint; +} +/** QueryProposalResponse is the response type for the Query/Proposal RPC method. */ +export interface QueryProposalResponse { + /** proposal is the requested governance proposal. */ + proposal?: Proposal; +} +export interface QueryProposalResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryProposalResponse"; + value: Uint8Array; +} +/** QueryProposalResponse is the response type for the Query/Proposal RPC method. */ +export interface QueryProposalResponseAmino { + /** proposal is the requested governance proposal. */ + proposal?: ProposalAmino; +} +export interface QueryProposalResponseAminoMsg { + type: "cosmos-sdk/v1/QueryProposalResponse"; + value: QueryProposalResponseAmino; +} +/** QueryProposalResponse is the response type for the Query/Proposal RPC method. */ +export interface QueryProposalResponseSDKType { + proposal?: ProposalSDKType; +} +/** QueryProposalsRequest is the request type for the Query/Proposals RPC method. */ +export interface QueryProposalsRequest { + /** proposal_status defines the status of the proposals. */ + proposalStatus: ProposalStatus; + /** voter defines the voter address for the proposals. */ + voter: string; + /** depositor defines the deposit addresses from the proposals. */ + depositor: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryProposalsRequestProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryProposalsRequest"; + value: Uint8Array; +} +/** QueryProposalsRequest is the request type for the Query/Proposals RPC method. */ +export interface QueryProposalsRequestAmino { + /** proposal_status defines the status of the proposals. */ + proposal_status?: ProposalStatus; + /** voter defines the voter address for the proposals. */ + voter?: string; + /** depositor defines the deposit addresses from the proposals. */ + depositor?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryProposalsRequestAminoMsg { + type: "cosmos-sdk/v1/QueryProposalsRequest"; + value: QueryProposalsRequestAmino; +} +/** QueryProposalsRequest is the request type for the Query/Proposals RPC method. */ +export interface QueryProposalsRequestSDKType { + proposal_status: ProposalStatus; + voter: string; + depositor: string; + pagination?: PageRequestSDKType; +} +/** + * QueryProposalsResponse is the response type for the Query/Proposals RPC + * method. + */ +export interface QueryProposalsResponse { + /** proposals defines all the requested governance proposals. */ + proposals: Proposal[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryProposalsResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryProposalsResponse"; + value: Uint8Array; +} +/** + * QueryProposalsResponse is the response type for the Query/Proposals RPC + * method. + */ +export interface QueryProposalsResponseAmino { + /** proposals defines all the requested governance proposals. */ + proposals?: ProposalAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryProposalsResponseAminoMsg { + type: "cosmos-sdk/v1/QueryProposalsResponse"; + value: QueryProposalsResponseAmino; +} +/** + * QueryProposalsResponse is the response type for the Query/Proposals RPC + * method. + */ +export interface QueryProposalsResponseSDKType { + proposals: ProposalSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryVoteRequest is the request type for the Query/Vote RPC method. */ +export interface QueryVoteRequest { + /** proposal_id defines the unique id of the proposal. */ + proposalId: bigint; + /** voter defines the voter address for the proposals. */ + voter: string; +} +export interface QueryVoteRequestProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryVoteRequest"; + value: Uint8Array; +} +/** QueryVoteRequest is the request type for the Query/Vote RPC method. */ +export interface QueryVoteRequestAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id?: string; + /** voter defines the voter address for the proposals. */ + voter?: string; +} +export interface QueryVoteRequestAminoMsg { + type: "cosmos-sdk/v1/QueryVoteRequest"; + value: QueryVoteRequestAmino; +} +/** QueryVoteRequest is the request type for the Query/Vote RPC method. */ +export interface QueryVoteRequestSDKType { + proposal_id: bigint; + voter: string; +} +/** QueryVoteResponse is the response type for the Query/Vote RPC method. */ +export interface QueryVoteResponse { + /** vote defines the queried vote. */ + vote?: Vote; +} +export interface QueryVoteResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryVoteResponse"; + value: Uint8Array; +} +/** QueryVoteResponse is the response type for the Query/Vote RPC method. */ +export interface QueryVoteResponseAmino { + /** vote defines the queried vote. */ + vote?: VoteAmino; +} +export interface QueryVoteResponseAminoMsg { + type: "cosmos-sdk/v1/QueryVoteResponse"; + value: QueryVoteResponseAmino; +} +/** QueryVoteResponse is the response type for the Query/Vote RPC method. */ +export interface QueryVoteResponseSDKType { + vote?: VoteSDKType; +} +/** QueryVotesRequest is the request type for the Query/Votes RPC method. */ +export interface QueryVotesRequest { + /** proposal_id defines the unique id of the proposal. */ + proposalId: bigint; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryVotesRequestProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryVotesRequest"; + value: Uint8Array; +} +/** QueryVotesRequest is the request type for the Query/Votes RPC method. */ +export interface QueryVotesRequestAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryVotesRequestAminoMsg { + type: "cosmos-sdk/v1/QueryVotesRequest"; + value: QueryVotesRequestAmino; +} +/** QueryVotesRequest is the request type for the Query/Votes RPC method. */ +export interface QueryVotesRequestSDKType { + proposal_id: bigint; + pagination?: PageRequestSDKType; +} +/** QueryVotesResponse is the response type for the Query/Votes RPC method. */ +export interface QueryVotesResponse { + /** votes defines the queried votes. */ + votes: Vote[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryVotesResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryVotesResponse"; + value: Uint8Array; +} +/** QueryVotesResponse is the response type for the Query/Votes RPC method. */ +export interface QueryVotesResponseAmino { + /** votes defines the queried votes. */ + votes?: VoteAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryVotesResponseAminoMsg { + type: "cosmos-sdk/v1/QueryVotesResponse"; + value: QueryVotesResponseAmino; +} +/** QueryVotesResponse is the response type for the Query/Votes RPC method. */ +export interface QueryVotesResponseSDKType { + votes: VoteSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest { + /** + * params_type defines which parameters to query for, can be one of "voting", + * "tallying" or "deposit". + */ + paramsType: string; +} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino { + /** + * params_type defines which parameters to query for, can be one of "voting", + * "tallying" or "deposit". + */ + params_type?: string; +} +export interface QueryParamsRequestAminoMsg { + type: "cosmos-sdk/v1/QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestSDKType { + params_type: string; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** + * Deprecated: Prefer to use `params` instead. + * voting_params defines the parameters related to voting. + */ + /** @deprecated */ + votingParams?: VotingParams; + /** + * Deprecated: Prefer to use `params` instead. + * deposit_params defines the parameters related to deposit. + */ + /** @deprecated */ + depositParams?: DepositParams; + /** + * Deprecated: Prefer to use `params` instead. + * tally_params defines the parameters related to tally. + */ + /** @deprecated */ + tallyParams?: TallyParams; + /** + * params defines all the paramaters of x/gov module. + * + * Since: cosmos-sdk 0.47 + */ + params?: Params; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponseAmino { + /** + * Deprecated: Prefer to use `params` instead. + * voting_params defines the parameters related to voting. + */ + /** @deprecated */ + voting_params?: VotingParamsAmino; + /** + * Deprecated: Prefer to use `params` instead. + * deposit_params defines the parameters related to deposit. + */ + /** @deprecated */ + deposit_params?: DepositParamsAmino; + /** + * Deprecated: Prefer to use `params` instead. + * tally_params defines the parameters related to tally. + */ + /** @deprecated */ + tally_params?: TallyParamsAmino; + /** + * params defines all the paramaters of x/gov module. + * + * Since: cosmos-sdk 0.47 + */ + params?: ParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "cosmos-sdk/v1/QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponseSDKType { + /** @deprecated */ + voting_params?: VotingParamsSDKType; + /** @deprecated */ + deposit_params?: DepositParamsSDKType; + /** @deprecated */ + tally_params?: TallyParamsSDKType; + params?: ParamsSDKType; +} +/** QueryDepositRequest is the request type for the Query/Deposit RPC method. */ +export interface QueryDepositRequest { + /** proposal_id defines the unique id of the proposal. */ + proposalId: bigint; + /** depositor defines the deposit addresses from the proposals. */ + depositor: string; +} +export interface QueryDepositRequestProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryDepositRequest"; + value: Uint8Array; +} +/** QueryDepositRequest is the request type for the Query/Deposit RPC method. */ +export interface QueryDepositRequestAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id?: string; + /** depositor defines the deposit addresses from the proposals. */ + depositor?: string; +} +export interface QueryDepositRequestAminoMsg { + type: "cosmos-sdk/v1/QueryDepositRequest"; + value: QueryDepositRequestAmino; +} +/** QueryDepositRequest is the request type for the Query/Deposit RPC method. */ +export interface QueryDepositRequestSDKType { + proposal_id: bigint; + depositor: string; +} +/** QueryDepositResponse is the response type for the Query/Deposit RPC method. */ +export interface QueryDepositResponse { + /** deposit defines the requested deposit. */ + deposit?: Deposit; +} +export interface QueryDepositResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryDepositResponse"; + value: Uint8Array; +} +/** QueryDepositResponse is the response type for the Query/Deposit RPC method. */ +export interface QueryDepositResponseAmino { + /** deposit defines the requested deposit. */ + deposit?: DepositAmino; +} +export interface QueryDepositResponseAminoMsg { + type: "cosmos-sdk/v1/QueryDepositResponse"; + value: QueryDepositResponseAmino; +} +/** QueryDepositResponse is the response type for the Query/Deposit RPC method. */ +export interface QueryDepositResponseSDKType { + deposit?: DepositSDKType; +} +/** QueryDepositsRequest is the request type for the Query/Deposits RPC method. */ +export interface QueryDepositsRequest { + /** proposal_id defines the unique id of the proposal. */ + proposalId: bigint; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryDepositsRequestProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryDepositsRequest"; + value: Uint8Array; +} +/** QueryDepositsRequest is the request type for the Query/Deposits RPC method. */ +export interface QueryDepositsRequestAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryDepositsRequestAminoMsg { + type: "cosmos-sdk/v1/QueryDepositsRequest"; + value: QueryDepositsRequestAmino; +} +/** QueryDepositsRequest is the request type for the Query/Deposits RPC method. */ +export interface QueryDepositsRequestSDKType { + proposal_id: bigint; + pagination?: PageRequestSDKType; +} +/** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ +export interface QueryDepositsResponse { + /** deposits defines the requested deposits. */ + deposits: Deposit[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryDepositsResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryDepositsResponse"; + value: Uint8Array; +} +/** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ +export interface QueryDepositsResponseAmino { + /** deposits defines the requested deposits. */ + deposits?: DepositAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryDepositsResponseAminoMsg { + type: "cosmos-sdk/v1/QueryDepositsResponse"; + value: QueryDepositsResponseAmino; +} +/** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ +export interface QueryDepositsResponseSDKType { + deposits: DepositSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryTallyResultRequest is the request type for the Query/Tally RPC method. */ +export interface QueryTallyResultRequest { + /** proposal_id defines the unique id of the proposal. */ + proposalId: bigint; +} +export interface QueryTallyResultRequestProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryTallyResultRequest"; + value: Uint8Array; +} +/** QueryTallyResultRequest is the request type for the Query/Tally RPC method. */ +export interface QueryTallyResultRequestAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id?: string; +} +export interface QueryTallyResultRequestAminoMsg { + type: "cosmos-sdk/v1/QueryTallyResultRequest"; + value: QueryTallyResultRequestAmino; +} +/** QueryTallyResultRequest is the request type for the Query/Tally RPC method. */ +export interface QueryTallyResultRequestSDKType { + proposal_id: bigint; +} +/** QueryTallyResultResponse is the response type for the Query/Tally RPC method. */ +export interface QueryTallyResultResponse { + /** tally defines the requested tally. */ + tally?: TallyResult; +} +export interface QueryTallyResultResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.QueryTallyResultResponse"; + value: Uint8Array; +} +/** QueryTallyResultResponse is the response type for the Query/Tally RPC method. */ +export interface QueryTallyResultResponseAmino { + /** tally defines the requested tally. */ + tally?: TallyResultAmino; +} +export interface QueryTallyResultResponseAminoMsg { + type: "cosmos-sdk/v1/QueryTallyResultResponse"; + value: QueryTallyResultResponseAmino; +} +/** QueryTallyResultResponse is the response type for the Query/Tally RPC method. */ +export interface QueryTallyResultResponseSDKType { + tally?: TallyResultSDKType; +} +function createBaseQueryConstitutionRequest(): QueryConstitutionRequest { + return {}; +} +export const QueryConstitutionRequest = { + typeUrl: "/cosmos.gov.v1.QueryConstitutionRequest", + encode(_: QueryConstitutionRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryConstitutionRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConstitutionRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryConstitutionRequest { + const message = createBaseQueryConstitutionRequest(); + return message; + }, + fromAmino(_: QueryConstitutionRequestAmino): QueryConstitutionRequest { + const message = createBaseQueryConstitutionRequest(); + return message; + }, + toAmino(_: QueryConstitutionRequest): QueryConstitutionRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryConstitutionRequestAminoMsg): QueryConstitutionRequest { + return QueryConstitutionRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryConstitutionRequest): QueryConstitutionRequestAminoMsg { + return { + type: "cosmos-sdk/v1/QueryConstitutionRequest", + value: QueryConstitutionRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryConstitutionRequestProtoMsg): QueryConstitutionRequest { + return QueryConstitutionRequest.decode(message.value); + }, + toProto(message: QueryConstitutionRequest): Uint8Array { + return QueryConstitutionRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryConstitutionRequest): QueryConstitutionRequestProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryConstitutionRequest", + value: QueryConstitutionRequest.encode(message).finish() + }; + } +}; +function createBaseQueryConstitutionResponse(): QueryConstitutionResponse { + return { + constitution: "" + }; +} +export const QueryConstitutionResponse = { + typeUrl: "/cosmos.gov.v1.QueryConstitutionResponse", + encode(message: QueryConstitutionResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.constitution !== "") { + writer.uint32(10).string(message.constitution); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryConstitutionResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConstitutionResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.constitution = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryConstitutionResponse { + const message = createBaseQueryConstitutionResponse(); + message.constitution = object.constitution ?? ""; + return message; + }, + fromAmino(object: QueryConstitutionResponseAmino): QueryConstitutionResponse { + const message = createBaseQueryConstitutionResponse(); + if (object.constitution !== undefined && object.constitution !== null) { + message.constitution = object.constitution; + } + return message; + }, + toAmino(message: QueryConstitutionResponse): QueryConstitutionResponseAmino { + const obj: any = {}; + obj.constitution = message.constitution === "" ? undefined : message.constitution; + return obj; + }, + fromAminoMsg(object: QueryConstitutionResponseAminoMsg): QueryConstitutionResponse { + return QueryConstitutionResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryConstitutionResponse): QueryConstitutionResponseAminoMsg { + return { + type: "cosmos-sdk/v1/QueryConstitutionResponse", + value: QueryConstitutionResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryConstitutionResponseProtoMsg): QueryConstitutionResponse { + return QueryConstitutionResponse.decode(message.value); + }, + toProto(message: QueryConstitutionResponse): Uint8Array { + return QueryConstitutionResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryConstitutionResponse): QueryConstitutionResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryConstitutionResponse", + value: QueryConstitutionResponse.encode(message).finish() + }; + } +}; +function createBaseQueryProposalRequest(): QueryProposalRequest { + return { + proposalId: BigInt(0) + }; +} +export const QueryProposalRequest = { + typeUrl: "/cosmos.gov.v1.QueryProposalRequest", + encode(message: QueryProposalRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProposalRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryProposalRequest { + const message = createBaseQueryProposalRequest(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryProposalRequestAmino): QueryProposalRequest { + const message = createBaseQueryProposalRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; + }, + toAmino(message: QueryProposalRequest): QueryProposalRequestAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryProposalRequestAminoMsg): QueryProposalRequest { + return QueryProposalRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryProposalRequest): QueryProposalRequestAminoMsg { + return { + type: "cosmos-sdk/v1/QueryProposalRequest", + value: QueryProposalRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryProposalRequestProtoMsg): QueryProposalRequest { + return QueryProposalRequest.decode(message.value); + }, + toProto(message: QueryProposalRequest): Uint8Array { + return QueryProposalRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryProposalRequest): QueryProposalRequestProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryProposalRequest", + value: QueryProposalRequest.encode(message).finish() + }; + } +}; +function createBaseQueryProposalResponse(): QueryProposalResponse { + return { + proposal: undefined + }; +} +export const QueryProposalResponse = { + typeUrl: "/cosmos.gov.v1.QueryProposalResponse", + encode(message: QueryProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposal !== undefined) { + Proposal.encode(message.proposal, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProposalResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposal = Proposal.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryProposalResponse { + const message = createBaseQueryProposalResponse(); + message.proposal = object.proposal !== undefined && object.proposal !== null ? Proposal.fromPartial(object.proposal) : undefined; + return message; + }, + fromAmino(object: QueryProposalResponseAmino): QueryProposalResponse { + const message = createBaseQueryProposalResponse(); + if (object.proposal !== undefined && object.proposal !== null) { + message.proposal = Proposal.fromAmino(object.proposal); + } + return message; + }, + toAmino(message: QueryProposalResponse): QueryProposalResponseAmino { + const obj: any = {}; + obj.proposal = message.proposal ? Proposal.toAmino(message.proposal) : undefined; + return obj; + }, + fromAminoMsg(object: QueryProposalResponseAminoMsg): QueryProposalResponse { + return QueryProposalResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryProposalResponse): QueryProposalResponseAminoMsg { + return { + type: "cosmos-sdk/v1/QueryProposalResponse", + value: QueryProposalResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryProposalResponseProtoMsg): QueryProposalResponse { + return QueryProposalResponse.decode(message.value); + }, + toProto(message: QueryProposalResponse): Uint8Array { + return QueryProposalResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryProposalResponse): QueryProposalResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryProposalResponse", + value: QueryProposalResponse.encode(message).finish() + }; + } +}; +function createBaseQueryProposalsRequest(): QueryProposalsRequest { + return { + proposalStatus: 0, + voter: "", + depositor: "", + pagination: undefined + }; +} +export const QueryProposalsRequest = { + typeUrl: "/cosmos.gov.v1.QueryProposalsRequest", + encode(message: QueryProposalsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalStatus !== 0) { + writer.uint32(8).int32(message.proposalStatus); + } + if (message.voter !== "") { + writer.uint32(18).string(message.voter); + } + if (message.depositor !== "") { + writer.uint32(26).string(message.depositor); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProposalsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalStatus = (reader.int32() as any); + break; + case 2: + message.voter = reader.string(); + break; + case 3: + message.depositor = reader.string(); + break; + case 4: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryProposalsRequest { + const message = createBaseQueryProposalsRequest(); + message.proposalStatus = object.proposalStatus ?? 0; + message.voter = object.voter ?? ""; + message.depositor = object.depositor ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryProposalsRequestAmino): QueryProposalsRequest { + const message = createBaseQueryProposalsRequest(); + if (object.proposal_status !== undefined && object.proposal_status !== null) { + message.proposalStatus = object.proposal_status; + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryProposalsRequest): QueryProposalsRequestAmino { + const obj: any = {}; + obj.proposal_status = message.proposalStatus === 0 ? undefined : message.proposalStatus; + obj.voter = message.voter === "" ? undefined : message.voter; + obj.depositor = message.depositor === "" ? undefined : message.depositor; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryProposalsRequestAminoMsg): QueryProposalsRequest { + return QueryProposalsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryProposalsRequest): QueryProposalsRequestAminoMsg { + return { + type: "cosmos-sdk/v1/QueryProposalsRequest", + value: QueryProposalsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryProposalsRequestProtoMsg): QueryProposalsRequest { + return QueryProposalsRequest.decode(message.value); + }, + toProto(message: QueryProposalsRequest): Uint8Array { + return QueryProposalsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryProposalsRequest): QueryProposalsRequestProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryProposalsRequest", + value: QueryProposalsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryProposalsResponse(): QueryProposalsResponse { + return { + proposals: [], + pagination: undefined + }; +} +export const QueryProposalsResponse = { + typeUrl: "/cosmos.gov.v1.QueryProposalsResponse", + encode(message: QueryProposalsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.proposals) { + Proposal.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProposalsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposals.push(Proposal.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryProposalsResponse { + const message = createBaseQueryProposalsResponse(); + message.proposals = object.proposals?.map(e => Proposal.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryProposalsResponseAmino): QueryProposalsResponse { + const message = createBaseQueryProposalsResponse(); + message.proposals = object.proposals?.map(e => Proposal.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryProposalsResponse): QueryProposalsResponseAmino { + const obj: any = {}; + if (message.proposals) { + obj.proposals = message.proposals.map(e => e ? Proposal.toAmino(e) : undefined); + } else { + obj.proposals = message.proposals; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryProposalsResponseAminoMsg): QueryProposalsResponse { + return QueryProposalsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryProposalsResponse): QueryProposalsResponseAminoMsg { + return { + type: "cosmos-sdk/v1/QueryProposalsResponse", + value: QueryProposalsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryProposalsResponseProtoMsg): QueryProposalsResponse { + return QueryProposalsResponse.decode(message.value); + }, + toProto(message: QueryProposalsResponse): Uint8Array { + return QueryProposalsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryProposalsResponse): QueryProposalsResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryProposalsResponse", + value: QueryProposalsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryVoteRequest(): QueryVoteRequest { + return { + proposalId: BigInt(0), + voter: "" + }; +} +export const QueryVoteRequest = { + typeUrl: "/cosmos.gov.v1.QueryVoteRequest", + encode(message: QueryVoteRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.voter !== "") { + writer.uint32(18).string(message.voter); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVoteRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVoteRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.voter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryVoteRequest { + const message = createBaseQueryVoteRequest(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.voter = object.voter ?? ""; + return message; + }, + fromAmino(object: QueryVoteRequestAmino): QueryVoteRequest { + const message = createBaseQueryVoteRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + return message; + }, + toAmino(message: QueryVoteRequest): QueryVoteRequestAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.voter = message.voter === "" ? undefined : message.voter; + return obj; + }, + fromAminoMsg(object: QueryVoteRequestAminoMsg): QueryVoteRequest { + return QueryVoteRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryVoteRequest): QueryVoteRequestAminoMsg { + return { + type: "cosmos-sdk/v1/QueryVoteRequest", + value: QueryVoteRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryVoteRequestProtoMsg): QueryVoteRequest { + return QueryVoteRequest.decode(message.value); + }, + toProto(message: QueryVoteRequest): Uint8Array { + return QueryVoteRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryVoteRequest): QueryVoteRequestProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryVoteRequest", + value: QueryVoteRequest.encode(message).finish() + }; + } +}; +function createBaseQueryVoteResponse(): QueryVoteResponse { + return { + vote: undefined + }; +} +export const QueryVoteResponse = { + typeUrl: "/cosmos.gov.v1.QueryVoteResponse", + encode(message: QueryVoteResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.vote !== undefined) { + Vote.encode(message.vote, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVoteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVoteResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.vote = Vote.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryVoteResponse { + const message = createBaseQueryVoteResponse(); + message.vote = object.vote !== undefined && object.vote !== null ? Vote.fromPartial(object.vote) : undefined; + return message; + }, + fromAmino(object: QueryVoteResponseAmino): QueryVoteResponse { + const message = createBaseQueryVoteResponse(); + if (object.vote !== undefined && object.vote !== null) { + message.vote = Vote.fromAmino(object.vote); + } + return message; + }, + toAmino(message: QueryVoteResponse): QueryVoteResponseAmino { + const obj: any = {}; + obj.vote = message.vote ? Vote.toAmino(message.vote) : undefined; + return obj; + }, + fromAminoMsg(object: QueryVoteResponseAminoMsg): QueryVoteResponse { + return QueryVoteResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryVoteResponse): QueryVoteResponseAminoMsg { + return { + type: "cosmos-sdk/v1/QueryVoteResponse", + value: QueryVoteResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryVoteResponseProtoMsg): QueryVoteResponse { + return QueryVoteResponse.decode(message.value); + }, + toProto(message: QueryVoteResponse): Uint8Array { + return QueryVoteResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryVoteResponse): QueryVoteResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryVoteResponse", + value: QueryVoteResponse.encode(message).finish() + }; + } +}; +function createBaseQueryVotesRequest(): QueryVotesRequest { + return { + proposalId: BigInt(0), + pagination: undefined + }; +} +export const QueryVotesRequest = { + typeUrl: "/cosmos.gov.v1.QueryVotesRequest", + encode(message: QueryVotesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVotesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVotesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryVotesRequest { + const message = createBaseQueryVotesRequest(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryVotesRequestAmino): QueryVotesRequest { + const message = createBaseQueryVotesRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryVotesRequest): QueryVotesRequestAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryVotesRequestAminoMsg): QueryVotesRequest { + return QueryVotesRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryVotesRequest): QueryVotesRequestAminoMsg { + return { + type: "cosmos-sdk/v1/QueryVotesRequest", + value: QueryVotesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryVotesRequestProtoMsg): QueryVotesRequest { + return QueryVotesRequest.decode(message.value); + }, + toProto(message: QueryVotesRequest): Uint8Array { + return QueryVotesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryVotesRequest): QueryVotesRequestProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryVotesRequest", + value: QueryVotesRequest.encode(message).finish() + }; + } +}; +function createBaseQueryVotesResponse(): QueryVotesResponse { + return { + votes: [], + pagination: undefined + }; +} +export const QueryVotesResponse = { + typeUrl: "/cosmos.gov.v1.QueryVotesResponse", + encode(message: QueryVotesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.votes) { + Vote.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVotesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVotesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votes.push(Vote.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryVotesResponse { + const message = createBaseQueryVotesResponse(); + message.votes = object.votes?.map(e => Vote.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryVotesResponseAmino): QueryVotesResponse { + const message = createBaseQueryVotesResponse(); + message.votes = object.votes?.map(e => Vote.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryVotesResponse): QueryVotesResponseAmino { + const obj: any = {}; + if (message.votes) { + obj.votes = message.votes.map(e => e ? Vote.toAmino(e) : undefined); + } else { + obj.votes = message.votes; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryVotesResponseAminoMsg): QueryVotesResponse { + return QueryVotesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryVotesResponse): QueryVotesResponseAminoMsg { + return { + type: "cosmos-sdk/v1/QueryVotesResponse", + value: QueryVotesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryVotesResponseProtoMsg): QueryVotesResponse { + return QueryVotesResponse.decode(message.value); + }, + toProto(message: QueryVotesResponse): Uint8Array { + return QueryVotesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryVotesResponse): QueryVotesResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryVotesResponse", + value: QueryVotesResponse.encode(message).finish() + }; + } +}; +function createBaseQueryParamsRequest(): QueryParamsRequest { + return { + paramsType: "" + }; +} +export const QueryParamsRequest = { + typeUrl: "/cosmos.gov.v1.QueryParamsRequest", + encode(message: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.paramsType !== "") { + writer.uint32(10).string(message.paramsType); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.paramsType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + message.paramsType = object.paramsType ?? ""; + return message; + }, + fromAmino(object: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + if (object.params_type !== undefined && object.params_type !== null) { + message.paramsType = object.params_type; + } + return message; + }, + toAmino(message: QueryParamsRequest): QueryParamsRequestAmino { + const obj: any = {}; + obj.params_type = message.paramsType === "" ? undefined : message.paramsType; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsRequest): QueryParamsRequestAminoMsg { + return { + type: "cosmos-sdk/v1/QueryParamsRequest", + value: QueryParamsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + votingParams: undefined, + depositParams: undefined, + tallyParams: undefined, + params: undefined + }; +} +export const QueryParamsResponse = { + typeUrl: "/cosmos.gov.v1.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.votingParams !== undefined) { + VotingParams.encode(message.votingParams, writer.uint32(10).fork()).ldelim(); + } + if (message.depositParams !== undefined) { + DepositParams.encode(message.depositParams, writer.uint32(18).fork()).ldelim(); + } + if (message.tallyParams !== undefined) { + TallyParams.encode(message.tallyParams, writer.uint32(26).fork()).ldelim(); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votingParams = VotingParams.decode(reader, reader.uint32()); + break; + case 2: + message.depositParams = DepositParams.decode(reader, reader.uint32()); + break; + case 3: + message.tallyParams = TallyParams.decode(reader, reader.uint32()); + break; + case 4: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.votingParams = object.votingParams !== undefined && object.votingParams !== null ? VotingParams.fromPartial(object.votingParams) : undefined; + message.depositParams = object.depositParams !== undefined && object.depositParams !== null ? DepositParams.fromPartial(object.depositParams) : undefined; + message.tallyParams = object.tallyParams !== undefined && object.tallyParams !== null ? TallyParams.fromPartial(object.tallyParams) : undefined; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.voting_params !== undefined && object.voting_params !== null) { + message.votingParams = VotingParams.fromAmino(object.voting_params); + } + if (object.deposit_params !== undefined && object.deposit_params !== null) { + message.depositParams = DepositParams.fromAmino(object.deposit_params); + } + if (object.tally_params !== undefined && object.tally_params !== null) { + message.tallyParams = TallyParams.fromAmino(object.tally_params); + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { + const obj: any = {}; + obj.voting_params = message.votingParams ? VotingParams.toAmino(message.votingParams) : undefined; + obj.deposit_params = message.depositParams ? DepositParams.toAmino(message.depositParams) : undefined; + obj.tally_params = message.tallyParams ? TallyParams.toAmino(message.tallyParams) : undefined; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsResponse): QueryParamsResponseAminoMsg { + return { + type: "cosmos-sdk/v1/QueryParamsResponse", + value: QueryParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryDepositRequest(): QueryDepositRequest { + return { + proposalId: BigInt(0), + depositor: "" + }; +} +export const QueryDepositRequest = { + typeUrl: "/cosmos.gov.v1.QueryDepositRequest", + encode(message: QueryDepositRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.depositor !== "") { + writer.uint32(18).string(message.depositor); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDepositRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.depositor = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDepositRequest { + const message = createBaseQueryDepositRequest(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.depositor = object.depositor ?? ""; + return message; + }, + fromAmino(object: QueryDepositRequestAmino): QueryDepositRequest { + const message = createBaseQueryDepositRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + return message; + }, + toAmino(message: QueryDepositRequest): QueryDepositRequestAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.depositor = message.depositor === "" ? undefined : message.depositor; + return obj; + }, + fromAminoMsg(object: QueryDepositRequestAminoMsg): QueryDepositRequest { + return QueryDepositRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDepositRequest): QueryDepositRequestAminoMsg { + return { + type: "cosmos-sdk/v1/QueryDepositRequest", + value: QueryDepositRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDepositRequestProtoMsg): QueryDepositRequest { + return QueryDepositRequest.decode(message.value); + }, + toProto(message: QueryDepositRequest): Uint8Array { + return QueryDepositRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDepositRequest): QueryDepositRequestProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryDepositRequest", + value: QueryDepositRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDepositResponse(): QueryDepositResponse { + return { + deposit: undefined + }; +} +export const QueryDepositResponse = { + typeUrl: "/cosmos.gov.v1.QueryDepositResponse", + encode(message: QueryDepositResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.deposit !== undefined) { + Deposit.encode(message.deposit, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDepositResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deposit = Deposit.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDepositResponse { + const message = createBaseQueryDepositResponse(); + message.deposit = object.deposit !== undefined && object.deposit !== null ? Deposit.fromPartial(object.deposit) : undefined; + return message; + }, + fromAmino(object: QueryDepositResponseAmino): QueryDepositResponse { + const message = createBaseQueryDepositResponse(); + if (object.deposit !== undefined && object.deposit !== null) { + message.deposit = Deposit.fromAmino(object.deposit); + } + return message; + }, + toAmino(message: QueryDepositResponse): QueryDepositResponseAmino { + const obj: any = {}; + obj.deposit = message.deposit ? Deposit.toAmino(message.deposit) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDepositResponseAminoMsg): QueryDepositResponse { + return QueryDepositResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDepositResponse): QueryDepositResponseAminoMsg { + return { + type: "cosmos-sdk/v1/QueryDepositResponse", + value: QueryDepositResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDepositResponseProtoMsg): QueryDepositResponse { + return QueryDepositResponse.decode(message.value); + }, + toProto(message: QueryDepositResponse): Uint8Array { + return QueryDepositResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDepositResponse): QueryDepositResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryDepositResponse", + value: QueryDepositResponse.encode(message).finish() + }; + } +}; +function createBaseQueryDepositsRequest(): QueryDepositsRequest { + return { + proposalId: BigInt(0), + pagination: undefined + }; +} +export const QueryDepositsRequest = { + typeUrl: "/cosmos.gov.v1.QueryDepositsRequest", + encode(message: QueryDepositsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDepositsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDepositsRequest { + const message = createBaseQueryDepositsRequest(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDepositsRequestAmino): QueryDepositsRequest { + const message = createBaseQueryDepositsRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDepositsRequest): QueryDepositsRequestAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDepositsRequestAminoMsg): QueryDepositsRequest { + return QueryDepositsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDepositsRequest): QueryDepositsRequestAminoMsg { + return { + type: "cosmos-sdk/v1/QueryDepositsRequest", + value: QueryDepositsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDepositsRequestProtoMsg): QueryDepositsRequest { + return QueryDepositsRequest.decode(message.value); + }, + toProto(message: QueryDepositsRequest): Uint8Array { + return QueryDepositsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDepositsRequest): QueryDepositsRequestProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryDepositsRequest", + value: QueryDepositsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDepositsResponse(): QueryDepositsResponse { + return { + deposits: [], + pagination: undefined + }; +} +export const QueryDepositsResponse = { + typeUrl: "/cosmos.gov.v1.QueryDepositsResponse", + encode(message: QueryDepositsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.deposits) { + Deposit.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDepositsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDepositsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deposits.push(Deposit.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDepositsResponse { + const message = createBaseQueryDepositsResponse(); + message.deposits = object.deposits?.map(e => Deposit.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryDepositsResponseAmino): QueryDepositsResponse { + const message = createBaseQueryDepositsResponse(); + message.deposits = object.deposits?.map(e => Deposit.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryDepositsResponse): QueryDepositsResponseAmino { + const obj: any = {}; + if (message.deposits) { + obj.deposits = message.deposits.map(e => e ? Deposit.toAmino(e) : undefined); + } else { + obj.deposits = message.deposits; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDepositsResponseAminoMsg): QueryDepositsResponse { + return QueryDepositsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDepositsResponse): QueryDepositsResponseAminoMsg { + return { + type: "cosmos-sdk/v1/QueryDepositsResponse", + value: QueryDepositsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDepositsResponseProtoMsg): QueryDepositsResponse { + return QueryDepositsResponse.decode(message.value); + }, + toProto(message: QueryDepositsResponse): Uint8Array { + return QueryDepositsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDepositsResponse): QueryDepositsResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryDepositsResponse", + value: QueryDepositsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryTallyResultRequest(): QueryTallyResultRequest { + return { + proposalId: BigInt(0) + }; +} +export const QueryTallyResultRequest = { + typeUrl: "/cosmos.gov.v1.QueryTallyResultRequest", + encode(message: QueryTallyResultRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTallyResultRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTallyResultRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryTallyResultRequest { + const message = createBaseQueryTallyResultRequest(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryTallyResultRequestAmino): QueryTallyResultRequest { + const message = createBaseQueryTallyResultRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; + }, + toAmino(message: QueryTallyResultRequest): QueryTallyResultRequestAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryTallyResultRequestAminoMsg): QueryTallyResultRequest { + return QueryTallyResultRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryTallyResultRequest): QueryTallyResultRequestAminoMsg { + return { + type: "cosmos-sdk/v1/QueryTallyResultRequest", + value: QueryTallyResultRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryTallyResultRequestProtoMsg): QueryTallyResultRequest { + return QueryTallyResultRequest.decode(message.value); + }, + toProto(message: QueryTallyResultRequest): Uint8Array { + return QueryTallyResultRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryTallyResultRequest): QueryTallyResultRequestProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryTallyResultRequest", + value: QueryTallyResultRequest.encode(message).finish() + }; + } +}; +function createBaseQueryTallyResultResponse(): QueryTallyResultResponse { + return { + tally: undefined + }; +} +export const QueryTallyResultResponse = { + typeUrl: "/cosmos.gov.v1.QueryTallyResultResponse", + encode(message: QueryTallyResultResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tally !== undefined) { + TallyResult.encode(message.tally, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTallyResultResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTallyResultResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tally = TallyResult.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryTallyResultResponse { + const message = createBaseQueryTallyResultResponse(); + message.tally = object.tally !== undefined && object.tally !== null ? TallyResult.fromPartial(object.tally) : undefined; + return message; + }, + fromAmino(object: QueryTallyResultResponseAmino): QueryTallyResultResponse { + const message = createBaseQueryTallyResultResponse(); + if (object.tally !== undefined && object.tally !== null) { + message.tally = TallyResult.fromAmino(object.tally); + } + return message; + }, + toAmino(message: QueryTallyResultResponse): QueryTallyResultResponseAmino { + const obj: any = {}; + obj.tally = message.tally ? TallyResult.toAmino(message.tally) : undefined; + return obj; + }, + fromAminoMsg(object: QueryTallyResultResponseAminoMsg): QueryTallyResultResponse { + return QueryTallyResultResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryTallyResultResponse): QueryTallyResultResponseAminoMsg { + return { + type: "cosmos-sdk/v1/QueryTallyResultResponse", + value: QueryTallyResultResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryTallyResultResponseProtoMsg): QueryTallyResultResponse { + return QueryTallyResultResponse.decode(message.value); + }, + toProto(message: QueryTallyResultResponse): Uint8Array { + return QueryTallyResultResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryTallyResultResponse): QueryTallyResultResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.QueryTallyResultResponse", + value: QueryTallyResultResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/gov/v1/tx.amino.ts b/src/codegen/cosmos/gov/v1/tx.amino.ts new file mode 100644 index 0000000..6b91907 --- /dev/null +++ b/src/codegen/cosmos/gov/v1/tx.amino.ts @@ -0,0 +1,38 @@ +import { MsgSubmitProposal, MsgExecLegacyContent, MsgVote, MsgVoteWeighted, MsgDeposit, MsgUpdateParams, MsgCancelProposal } from "./tx"; +export const AminoConverter = { + "/cosmos.gov.v1.MsgSubmitProposal": { + aminoType: "cosmos-sdk/v1/MsgSubmitProposal", + toAmino: MsgSubmitProposal.toAmino, + fromAmino: MsgSubmitProposal.fromAmino + }, + "/cosmos.gov.v1.MsgExecLegacyContent": { + aminoType: "cosmos-sdk/v1/MsgExecLegacyContent", + toAmino: MsgExecLegacyContent.toAmino, + fromAmino: MsgExecLegacyContent.fromAmino + }, + "/cosmos.gov.v1.MsgVote": { + aminoType: "cosmos-sdk/v1/MsgVote", + toAmino: MsgVote.toAmino, + fromAmino: MsgVote.fromAmino + }, + "/cosmos.gov.v1.MsgVoteWeighted": { + aminoType: "cosmos-sdk/v1/MsgVoteWeighted", + toAmino: MsgVoteWeighted.toAmino, + fromAmino: MsgVoteWeighted.fromAmino + }, + "/cosmos.gov.v1.MsgDeposit": { + aminoType: "cosmos-sdk/v1/MsgDeposit", + toAmino: MsgDeposit.toAmino, + fromAmino: MsgDeposit.fromAmino + }, + "/cosmos.gov.v1.MsgUpdateParams": { + aminoType: "cosmos-sdk/x/gov/v1/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + }, + "/cosmos.gov.v1.MsgCancelProposal": { + aminoType: "cosmos-sdk/v1/MsgCancelProposal", + toAmino: MsgCancelProposal.toAmino, + fromAmino: MsgCancelProposal.fromAmino + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/gov/v1/tx.registry.ts b/src/codegen/cosmos/gov/v1/tx.registry.ts new file mode 100644 index 0000000..3a11d8f --- /dev/null +++ b/src/codegen/cosmos/gov/v1/tx.registry.ts @@ -0,0 +1,142 @@ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgSubmitProposal, MsgExecLegacyContent, MsgVote, MsgVoteWeighted, MsgDeposit, MsgUpdateParams, MsgCancelProposal } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.gov.v1.MsgSubmitProposal", MsgSubmitProposal], ["/cosmos.gov.v1.MsgExecLegacyContent", MsgExecLegacyContent], ["/cosmos.gov.v1.MsgVote", MsgVote], ["/cosmos.gov.v1.MsgVoteWeighted", MsgVoteWeighted], ["/cosmos.gov.v1.MsgDeposit", MsgDeposit], ["/cosmos.gov.v1.MsgUpdateParams", MsgUpdateParams], ["/cosmos.gov.v1.MsgCancelProposal", MsgCancelProposal]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: "/cosmos.gov.v1.MsgSubmitProposal", + value: MsgSubmitProposal.encode(value).finish() + }; + }, + execLegacyContent(value: MsgExecLegacyContent) { + return { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent", + value: MsgExecLegacyContent.encode(value).finish() + }; + }, + vote(value: MsgVote) { + return { + typeUrl: "/cosmos.gov.v1.MsgVote", + value: MsgVote.encode(value).finish() + }; + }, + voteWeighted(value: MsgVoteWeighted) { + return { + typeUrl: "/cosmos.gov.v1.MsgVoteWeighted", + value: MsgVoteWeighted.encode(value).finish() + }; + }, + deposit(value: MsgDeposit) { + return { + typeUrl: "/cosmos.gov.v1.MsgDeposit", + value: MsgDeposit.encode(value).finish() + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.gov.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + }, + cancelProposal(value: MsgCancelProposal) { + return { + typeUrl: "/cosmos.gov.v1.MsgCancelProposal", + value: MsgCancelProposal.encode(value).finish() + }; + } + }, + withTypeUrl: { + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: "/cosmos.gov.v1.MsgSubmitProposal", + value + }; + }, + execLegacyContent(value: MsgExecLegacyContent) { + return { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent", + value + }; + }, + vote(value: MsgVote) { + return { + typeUrl: "/cosmos.gov.v1.MsgVote", + value + }; + }, + voteWeighted(value: MsgVoteWeighted) { + return { + typeUrl: "/cosmos.gov.v1.MsgVoteWeighted", + value + }; + }, + deposit(value: MsgDeposit) { + return { + typeUrl: "/cosmos.gov.v1.MsgDeposit", + value + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.gov.v1.MsgUpdateParams", + value + }; + }, + cancelProposal(value: MsgCancelProposal) { + return { + typeUrl: "/cosmos.gov.v1.MsgCancelProposal", + value + }; + } + }, + fromPartial: { + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: "/cosmos.gov.v1.MsgSubmitProposal", + value: MsgSubmitProposal.fromPartial(value) + }; + }, + execLegacyContent(value: MsgExecLegacyContent) { + return { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent", + value: MsgExecLegacyContent.fromPartial(value) + }; + }, + vote(value: MsgVote) { + return { + typeUrl: "/cosmos.gov.v1.MsgVote", + value: MsgVote.fromPartial(value) + }; + }, + voteWeighted(value: MsgVoteWeighted) { + return { + typeUrl: "/cosmos.gov.v1.MsgVoteWeighted", + value: MsgVoteWeighted.fromPartial(value) + }; + }, + deposit(value: MsgDeposit) { + return { + typeUrl: "/cosmos.gov.v1.MsgDeposit", + value: MsgDeposit.fromPartial(value) + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.gov.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + }, + cancelProposal(value: MsgCancelProposal) { + return { + typeUrl: "/cosmos.gov.v1.MsgCancelProposal", + value: MsgCancelProposal.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/gov/v1/tx.rpc.msg.ts b/src/codegen/cosmos/gov/v1/tx.rpc.msg.ts new file mode 100644 index 0000000..7139eb2 --- /dev/null +++ b/src/codegen/cosmos/gov/v1/tx.rpc.msg.ts @@ -0,0 +1,80 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgSubmitProposal, MsgSubmitProposalResponse, MsgExecLegacyContent, MsgExecLegacyContentResponse, MsgVote, MsgVoteResponse, MsgVoteWeighted, MsgVoteWeightedResponse, MsgDeposit, MsgDepositResponse, MsgUpdateParams, MsgUpdateParamsResponse, MsgCancelProposal, MsgCancelProposalResponse } from "./tx"; +/** Msg defines the gov Msg service. */ +export interface Msg { + /** SubmitProposal defines a method to create new proposal given the messages. */ + submitProposal(request: MsgSubmitProposal): Promise; + /** + * ExecLegacyContent defines a Msg to be in included in a MsgSubmitProposal + * to execute a legacy content-based proposal. + */ + execLegacyContent(request: MsgExecLegacyContent): Promise; + /** Vote defines a method to add a vote on a specific proposal. */ + vote(request: MsgVote): Promise; + /** VoteWeighted defines a method to add a weighted vote on a specific proposal. */ + voteWeighted(request: MsgVoteWeighted): Promise; + /** Deposit defines a method to add deposit on a specific proposal. */ + deposit(request: MsgDeposit): Promise; + /** + * UpdateParams defines a governance operation for updating the x/gov module + * parameters. The authority is defined in the keeper. + * + * Since: cosmos-sdk 0.47 + */ + updateParams(request: MsgUpdateParams): Promise; + /** + * CancelProposal defines a method to cancel governance proposal + * + * Since: cosmos-sdk 0.50 + */ + cancelProposal(request: MsgCancelProposal): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.submitProposal = this.submitProposal.bind(this); + this.execLegacyContent = this.execLegacyContent.bind(this); + this.vote = this.vote.bind(this); + this.voteWeighted = this.voteWeighted.bind(this); + this.deposit = this.deposit.bind(this); + this.updateParams = this.updateParams.bind(this); + this.cancelProposal = this.cancelProposal.bind(this); + } + submitProposal(request: MsgSubmitProposal): Promise { + const data = MsgSubmitProposal.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Msg", "SubmitProposal", data); + return promise.then(data => MsgSubmitProposalResponse.decode(new BinaryReader(data))); + } + execLegacyContent(request: MsgExecLegacyContent): Promise { + const data = MsgExecLegacyContent.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Msg", "ExecLegacyContent", data); + return promise.then(data => MsgExecLegacyContentResponse.decode(new BinaryReader(data))); + } + vote(request: MsgVote): Promise { + const data = MsgVote.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Msg", "Vote", data); + return promise.then(data => MsgVoteResponse.decode(new BinaryReader(data))); + } + voteWeighted(request: MsgVoteWeighted): Promise { + const data = MsgVoteWeighted.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Msg", "VoteWeighted", data); + return promise.then(data => MsgVoteWeightedResponse.decode(new BinaryReader(data))); + } + deposit(request: MsgDeposit): Promise { + const data = MsgDeposit.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Msg", "Deposit", data); + return promise.then(data => MsgDepositResponse.decode(new BinaryReader(data))); + } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } + cancelProposal(request: MsgCancelProposal): Promise { + const data = MsgCancelProposal.encode(request).finish(); + const promise = this.rpc.request("cosmos.gov.v1.Msg", "CancelProposal", data); + return promise.then(data => MsgCancelProposalResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/src/codegen/cosmos/gov/v1/tx.ts b/src/codegen/cosmos/gov/v1/tx.ts new file mode 100644 index 0000000..83a1f23 --- /dev/null +++ b/src/codegen/cosmos/gov/v1/tx.ts @@ -0,0 +1,1610 @@ +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { VoteOption, WeightedVoteOption, WeightedVoteOptionAmino, WeightedVoteOptionSDKType, Params, ParamsAmino, ParamsSDKType } from "./gov"; +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { toTimestamp, fromTimestamp } from "../../../helpers"; +/** + * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary + * proposal Content. + */ +export interface MsgSubmitProposal { + /** messages are the arbitrary messages to be executed if proposal passes. */ + messages: Any[]; + /** initial_deposit is the deposit value that must be paid at proposal submission. */ + initialDeposit: Coin[]; + /** proposer is the account address of the proposer. */ + proposer: string; + /** metadata is any arbitrary metadata attached to the proposal. */ + metadata: string; + /** + * title is the title of the proposal. + * + * Since: cosmos-sdk 0.47 + */ + title: string; + /** + * summary is the summary of the proposal + * + * Since: cosmos-sdk 0.47 + */ + summary: string; + /** + * expedited defines if the proposal is expedited or not + * + * Since: cosmos-sdk 0.50 + */ + expedited: boolean; +} +export interface MsgSubmitProposalProtoMsg { + typeUrl: "/cosmos.gov.v1.MsgSubmitProposal"; + value: Uint8Array; +} +/** + * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary + * proposal Content. + */ +export interface MsgSubmitProposalAmino { + /** messages are the arbitrary messages to be executed if proposal passes. */ + messages?: AnyAmino[]; + /** initial_deposit is the deposit value that must be paid at proposal submission. */ + initial_deposit: CoinAmino[]; + /** proposer is the account address of the proposer. */ + proposer?: string; + /** metadata is any arbitrary metadata attached to the proposal. */ + metadata?: string; + /** + * title is the title of the proposal. + * + * Since: cosmos-sdk 0.47 + */ + title?: string; + /** + * summary is the summary of the proposal + * + * Since: cosmos-sdk 0.47 + */ + summary?: string; + /** + * expedited defines if the proposal is expedited or not + * + * Since: cosmos-sdk 0.50 + */ + expedited?: boolean; +} +export interface MsgSubmitProposalAminoMsg { + type: "cosmos-sdk/v1/MsgSubmitProposal"; + value: MsgSubmitProposalAmino; +} +/** + * MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary + * proposal Content. + */ +export interface MsgSubmitProposalSDKType { + messages: AnySDKType[]; + initial_deposit: CoinSDKType[]; + proposer: string; + metadata: string; + title: string; + summary: string; + expedited: boolean; +} +/** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponse { + /** proposal_id defines the unique id of the proposal. */ + proposalId: bigint; +} +export interface MsgSubmitProposalResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.MsgSubmitProposalResponse"; + value: Uint8Array; +} +/** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponseAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id?: string; +} +export interface MsgSubmitProposalResponseAminoMsg { + type: "cosmos-sdk/v1/MsgSubmitProposalResponse"; + value: MsgSubmitProposalResponseAmino; +} +/** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponseSDKType { + proposal_id: bigint; +} +/** + * MsgExecLegacyContent is used to wrap the legacy content field into a message. + * This ensures backwards compatibility with v1beta1.MsgSubmitProposal. + */ +export interface MsgExecLegacyContent { + /** content is the proposal's content. */ + content?: Any; + /** authority must be the gov module address. */ + authority: string; +} +export interface MsgExecLegacyContentProtoMsg { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent"; + value: Uint8Array; +} +/** + * MsgExecLegacyContent is used to wrap the legacy content field into a message. + * This ensures backwards compatibility with v1beta1.MsgSubmitProposal. + */ +export interface MsgExecLegacyContentAmino { + /** content is the proposal's content. */ + content?: AnyAmino; + /** authority must be the gov module address. */ + authority?: string; +} +export interface MsgExecLegacyContentAminoMsg { + type: "cosmos-sdk/v1/MsgExecLegacyContent"; + value: MsgExecLegacyContentAmino; +} +/** + * MsgExecLegacyContent is used to wrap the legacy content field into a message. + * This ensures backwards compatibility with v1beta1.MsgSubmitProposal. + */ +export interface MsgExecLegacyContentSDKType { + content?: AnySDKType; + authority: string; +} +/** MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. */ +export interface MsgExecLegacyContentResponse {} +export interface MsgExecLegacyContentResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContentResponse"; + value: Uint8Array; +} +/** MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. */ +export interface MsgExecLegacyContentResponseAmino {} +export interface MsgExecLegacyContentResponseAminoMsg { + type: "cosmos-sdk/v1/MsgExecLegacyContentResponse"; + value: MsgExecLegacyContentResponseAmino; +} +/** MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. */ +export interface MsgExecLegacyContentResponseSDKType {} +/** MsgVote defines a message to cast a vote. */ +export interface MsgVote { + /** proposal_id defines the unique id of the proposal. */ + proposalId: bigint; + /** voter is the voter address for the proposal. */ + voter: string; + /** option defines the vote option. */ + option: VoteOption; + /** metadata is any arbitrary metadata attached to the Vote. */ + metadata: string; +} +export interface MsgVoteProtoMsg { + typeUrl: "/cosmos.gov.v1.MsgVote"; + value: Uint8Array; +} +/** MsgVote defines a message to cast a vote. */ +export interface MsgVoteAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id: string; + /** voter is the voter address for the proposal. */ + voter?: string; + /** option defines the vote option. */ + option?: VoteOption; + /** metadata is any arbitrary metadata attached to the Vote. */ + metadata?: string; +} +export interface MsgVoteAminoMsg { + type: "cosmos-sdk/v1/MsgVote"; + value: MsgVoteAmino; +} +/** MsgVote defines a message to cast a vote. */ +export interface MsgVoteSDKType { + proposal_id: bigint; + voter: string; + option: VoteOption; + metadata: string; +} +/** MsgVoteResponse defines the Msg/Vote response type. */ +export interface MsgVoteResponse {} +export interface MsgVoteResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.MsgVoteResponse"; + value: Uint8Array; +} +/** MsgVoteResponse defines the Msg/Vote response type. */ +export interface MsgVoteResponseAmino {} +export interface MsgVoteResponseAminoMsg { + type: "cosmos-sdk/v1/MsgVoteResponse"; + value: MsgVoteResponseAmino; +} +/** MsgVoteResponse defines the Msg/Vote response type. */ +export interface MsgVoteResponseSDKType {} +/** MsgVoteWeighted defines a message to cast a vote. */ +export interface MsgVoteWeighted { + /** proposal_id defines the unique id of the proposal. */ + proposalId: bigint; + /** voter is the voter address for the proposal. */ + voter: string; + /** options defines the weighted vote options. */ + options: WeightedVoteOption[]; + /** metadata is any arbitrary metadata attached to the VoteWeighted. */ + metadata: string; +} +export interface MsgVoteWeightedProtoMsg { + typeUrl: "/cosmos.gov.v1.MsgVoteWeighted"; + value: Uint8Array; +} +/** MsgVoteWeighted defines a message to cast a vote. */ +export interface MsgVoteWeightedAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id: string; + /** voter is the voter address for the proposal. */ + voter?: string; + /** options defines the weighted vote options. */ + options?: WeightedVoteOptionAmino[]; + /** metadata is any arbitrary metadata attached to the VoteWeighted. */ + metadata?: string; +} +export interface MsgVoteWeightedAminoMsg { + type: "cosmos-sdk/v1/MsgVoteWeighted"; + value: MsgVoteWeightedAmino; +} +/** MsgVoteWeighted defines a message to cast a vote. */ +export interface MsgVoteWeightedSDKType { + proposal_id: bigint; + voter: string; + options: WeightedVoteOptionSDKType[]; + metadata: string; +} +/** MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. */ +export interface MsgVoteWeightedResponse {} +export interface MsgVoteWeightedResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.MsgVoteWeightedResponse"; + value: Uint8Array; +} +/** MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. */ +export interface MsgVoteWeightedResponseAmino {} +export interface MsgVoteWeightedResponseAminoMsg { + type: "cosmos-sdk/v1/MsgVoteWeightedResponse"; + value: MsgVoteWeightedResponseAmino; +} +/** MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. */ +export interface MsgVoteWeightedResponseSDKType {} +/** MsgDeposit defines a message to submit a deposit to an existing proposal. */ +export interface MsgDeposit { + /** proposal_id defines the unique id of the proposal. */ + proposalId: bigint; + /** depositor defines the deposit addresses from the proposals. */ + depositor: string; + /** amount to be deposited by depositor. */ + amount: Coin[]; +} +export interface MsgDepositProtoMsg { + typeUrl: "/cosmos.gov.v1.MsgDeposit"; + value: Uint8Array; +} +/** MsgDeposit defines a message to submit a deposit to an existing proposal. */ +export interface MsgDepositAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id: string; + /** depositor defines the deposit addresses from the proposals. */ + depositor?: string; + /** amount to be deposited by depositor. */ + amount: CoinAmino[]; +} +export interface MsgDepositAminoMsg { + type: "cosmos-sdk/v1/MsgDeposit"; + value: MsgDepositAmino; +} +/** MsgDeposit defines a message to submit a deposit to an existing proposal. */ +export interface MsgDepositSDKType { + proposal_id: bigint; + depositor: string; + amount: CoinSDKType[]; +} +/** MsgDepositResponse defines the Msg/Deposit response type. */ +export interface MsgDepositResponse {} +export interface MsgDepositResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.MsgDepositResponse"; + value: Uint8Array; +} +/** MsgDepositResponse defines the Msg/Deposit response type. */ +export interface MsgDepositResponseAmino {} +export interface MsgDepositResponseAminoMsg { + type: "cosmos-sdk/v1/MsgDepositResponse"; + value: MsgDepositResponseAmino; +} +/** MsgDepositResponse defines the Msg/Deposit response type. */ +export interface MsgDepositResponseSDKType {} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** + * params defines the x/gov parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/cosmos.gov.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; + /** + * params defines the x/gov parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/x/gov/v1/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsSDKType; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/v1/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseSDKType {} +/** + * MsgCancelProposal is the Msg/CancelProposal request type. + * + * Since: cosmos-sdk 0.50 + */ +export interface MsgCancelProposal { + /** proposal_id defines the unique id of the proposal. */ + proposalId: bigint; + /** proposer is the account address of the proposer. */ + proposer: string; +} +export interface MsgCancelProposalProtoMsg { + typeUrl: "/cosmos.gov.v1.MsgCancelProposal"; + value: Uint8Array; +} +/** + * MsgCancelProposal is the Msg/CancelProposal request type. + * + * Since: cosmos-sdk 0.50 + */ +export interface MsgCancelProposalAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id: string; + /** proposer is the account address of the proposer. */ + proposer?: string; +} +export interface MsgCancelProposalAminoMsg { + type: "cosmos-sdk/v1/MsgCancelProposal"; + value: MsgCancelProposalAmino; +} +/** + * MsgCancelProposal is the Msg/CancelProposal request type. + * + * Since: cosmos-sdk 0.50 + */ +export interface MsgCancelProposalSDKType { + proposal_id: bigint; + proposer: string; +} +/** + * MsgCancelProposalResponse defines the response structure for executing a + * MsgCancelProposal message. + * + * Since: cosmos-sdk 0.50 + */ +export interface MsgCancelProposalResponse { + /** proposal_id defines the unique id of the proposal. */ + proposalId: bigint; + /** canceled_time is the time when proposal is canceled. */ + canceledTime: Date; + /** canceled_height defines the block height at which the proposal is canceled. */ + canceledHeight: bigint; +} +export interface MsgCancelProposalResponseProtoMsg { + typeUrl: "/cosmos.gov.v1.MsgCancelProposalResponse"; + value: Uint8Array; +} +/** + * MsgCancelProposalResponse defines the response structure for executing a + * MsgCancelProposal message. + * + * Since: cosmos-sdk 0.50 + */ +export interface MsgCancelProposalResponseAmino { + /** proposal_id defines the unique id of the proposal. */ + proposal_id: string; + /** canceled_time is the time when proposal is canceled. */ + canceled_time?: string; + /** canceled_height defines the block height at which the proposal is canceled. */ + canceled_height?: string; +} +export interface MsgCancelProposalResponseAminoMsg { + type: "cosmos-sdk/v1/MsgCancelProposalResponse"; + value: MsgCancelProposalResponseAmino; +} +/** + * MsgCancelProposalResponse defines the response structure for executing a + * MsgCancelProposal message. + * + * Since: cosmos-sdk 0.50 + */ +export interface MsgCancelProposalResponseSDKType { + proposal_id: bigint; + canceled_time: Date; + canceled_height: bigint; +} +function createBaseMsgSubmitProposal(): MsgSubmitProposal { + return { + messages: [], + initialDeposit: [], + proposer: "", + metadata: "", + title: "", + summary: "", + expedited: false + }; +} +export const MsgSubmitProposal = { + typeUrl: "/cosmos.gov.v1.MsgSubmitProposal", + encode(message: MsgSubmitProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.messages) { + Any.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.initialDeposit) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.proposer !== "") { + writer.uint32(26).string(message.proposer); + } + if (message.metadata !== "") { + writer.uint32(34).string(message.metadata); + } + if (message.title !== "") { + writer.uint32(42).string(message.title); + } + if (message.summary !== "") { + writer.uint32(50).string(message.summary); + } + if (message.expedited === true) { + writer.uint32(56).bool(message.expedited); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messages.push(Any.decode(reader, reader.uint32())); + break; + case 2: + message.initialDeposit.push(Coin.decode(reader, reader.uint32())); + break; + case 3: + message.proposer = reader.string(); + break; + case 4: + message.metadata = reader.string(); + break; + case 5: + message.title = reader.string(); + break; + case 6: + message.summary = reader.string(); + break; + case 7: + message.expedited = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSubmitProposal { + const message = createBaseMsgSubmitProposal(); + message.messages = object.messages?.map(e => Any.fromPartial(e)) || []; + message.initialDeposit = object.initialDeposit?.map(e => Coin.fromPartial(e)) || []; + message.proposer = object.proposer ?? ""; + message.metadata = object.metadata ?? ""; + message.title = object.title ?? ""; + message.summary = object.summary ?? ""; + message.expedited = object.expedited ?? false; + return message; + }, + fromAmino(object: MsgSubmitProposalAmino): MsgSubmitProposal { + const message = createBaseMsgSubmitProposal(); + message.messages = object.messages?.map(e => Any.fromAmino(e)) || []; + message.initialDeposit = object.initial_deposit?.map(e => Coin.fromAmino(e)) || []; + if (object.proposer !== undefined && object.proposer !== null) { + message.proposer = object.proposer; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.summary !== undefined && object.summary !== null) { + message.summary = object.summary; + } + if (object.expedited !== undefined && object.expedited !== null) { + message.expedited = object.expedited; + } + return message; + }, + toAmino(message: MsgSubmitProposal): MsgSubmitProposalAmino { + const obj: any = {}; + if (message.messages) { + obj.messages = message.messages.map(e => e ? Any.toAmino(e) : undefined); + } else { + obj.messages = message.messages; + } + if (message.initialDeposit) { + obj.initial_deposit = message.initialDeposit.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.initial_deposit = message.initialDeposit; + } + obj.proposer = message.proposer === "" ? undefined : message.proposer; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + obj.title = message.title === "" ? undefined : message.title; + obj.summary = message.summary === "" ? undefined : message.summary; + obj.expedited = message.expedited === false ? undefined : message.expedited; + return obj; + }, + fromAminoMsg(object: MsgSubmitProposalAminoMsg): MsgSubmitProposal { + return MsgSubmitProposal.fromAmino(object.value); + }, + toAminoMsg(message: MsgSubmitProposal): MsgSubmitProposalAminoMsg { + return { + type: "cosmos-sdk/v1/MsgSubmitProposal", + value: MsgSubmitProposal.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSubmitProposalProtoMsg): MsgSubmitProposal { + return MsgSubmitProposal.decode(message.value); + }, + toProto(message: MsgSubmitProposal): Uint8Array { + return MsgSubmitProposal.encode(message).finish(); + }, + toProtoMsg(message: MsgSubmitProposal): MsgSubmitProposalProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.MsgSubmitProposal", + value: MsgSubmitProposal.encode(message).finish() + }; + } +}; +function createBaseMsgSubmitProposalResponse(): MsgSubmitProposalResponse { + return { + proposalId: BigInt(0) + }; +} +export const MsgSubmitProposalResponse = { + typeUrl: "/cosmos.gov.v1.MsgSubmitProposalResponse", + encode(message: MsgSubmitProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitProposalResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSubmitProposalResponse { + const message = createBaseMsgSubmitProposalResponse(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgSubmitProposalResponseAmino): MsgSubmitProposalResponse { + const message = createBaseMsgSubmitProposalResponse(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; + }, + toAmino(message: MsgSubmitProposalResponse): MsgSubmitProposalResponseAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgSubmitProposalResponseAminoMsg): MsgSubmitProposalResponse { + return MsgSubmitProposalResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSubmitProposalResponse): MsgSubmitProposalResponseAminoMsg { + return { + type: "cosmos-sdk/v1/MsgSubmitProposalResponse", + value: MsgSubmitProposalResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSubmitProposalResponseProtoMsg): MsgSubmitProposalResponse { + return MsgSubmitProposalResponse.decode(message.value); + }, + toProto(message: MsgSubmitProposalResponse): Uint8Array { + return MsgSubmitProposalResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSubmitProposalResponse): MsgSubmitProposalResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.MsgSubmitProposalResponse", + value: MsgSubmitProposalResponse.encode(message).finish() + }; + } +}; +function createBaseMsgExecLegacyContent(): MsgExecLegacyContent { + return { + content: undefined, + authority: "" + }; +} +export const MsgExecLegacyContent = { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent", + encode(message: MsgExecLegacyContent, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.content !== undefined) { + Any.encode(message.content, writer.uint32(10).fork()).ldelim(); + } + if (message.authority !== "") { + writer.uint32(18).string(message.authority); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgExecLegacyContent { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExecLegacyContent(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.content = Any.decode(reader, reader.uint32()); + break; + case 2: + message.authority = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgExecLegacyContent { + const message = createBaseMsgExecLegacyContent(); + message.content = object.content !== undefined && object.content !== null ? Any.fromPartial(object.content) : undefined; + message.authority = object.authority ?? ""; + return message; + }, + fromAmino(object: MsgExecLegacyContentAmino): MsgExecLegacyContent { + const message = createBaseMsgExecLegacyContent(); + if (object.content !== undefined && object.content !== null) { + message.content = Any.fromAmino(object.content); + } + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + return message; + }, + toAmino(message: MsgExecLegacyContent): MsgExecLegacyContentAmino { + const obj: any = {}; + obj.content = message.content ? Any.toAmino(message.content) : undefined; + obj.authority = message.authority === "" ? undefined : message.authority; + return obj; + }, + fromAminoMsg(object: MsgExecLegacyContentAminoMsg): MsgExecLegacyContent { + return MsgExecLegacyContent.fromAmino(object.value); + }, + toAminoMsg(message: MsgExecLegacyContent): MsgExecLegacyContentAminoMsg { + return { + type: "cosmos-sdk/v1/MsgExecLegacyContent", + value: MsgExecLegacyContent.toAmino(message) + }; + }, + fromProtoMsg(message: MsgExecLegacyContentProtoMsg): MsgExecLegacyContent { + return MsgExecLegacyContent.decode(message.value); + }, + toProto(message: MsgExecLegacyContent): Uint8Array { + return MsgExecLegacyContent.encode(message).finish(); + }, + toProtoMsg(message: MsgExecLegacyContent): MsgExecLegacyContentProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContent", + value: MsgExecLegacyContent.encode(message).finish() + }; + } +}; +function createBaseMsgExecLegacyContentResponse(): MsgExecLegacyContentResponse { + return {}; +} +export const MsgExecLegacyContentResponse = { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContentResponse", + encode(_: MsgExecLegacyContentResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgExecLegacyContentResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExecLegacyContentResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgExecLegacyContentResponse { + const message = createBaseMsgExecLegacyContentResponse(); + return message; + }, + fromAmino(_: MsgExecLegacyContentResponseAmino): MsgExecLegacyContentResponse { + const message = createBaseMsgExecLegacyContentResponse(); + return message; + }, + toAmino(_: MsgExecLegacyContentResponse): MsgExecLegacyContentResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgExecLegacyContentResponseAminoMsg): MsgExecLegacyContentResponse { + return MsgExecLegacyContentResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgExecLegacyContentResponse): MsgExecLegacyContentResponseAminoMsg { + return { + type: "cosmos-sdk/v1/MsgExecLegacyContentResponse", + value: MsgExecLegacyContentResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgExecLegacyContentResponseProtoMsg): MsgExecLegacyContentResponse { + return MsgExecLegacyContentResponse.decode(message.value); + }, + toProto(message: MsgExecLegacyContentResponse): Uint8Array { + return MsgExecLegacyContentResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgExecLegacyContentResponse): MsgExecLegacyContentResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.MsgExecLegacyContentResponse", + value: MsgExecLegacyContentResponse.encode(message).finish() + }; + } +}; +function createBaseMsgVote(): MsgVote { + return { + proposalId: BigInt(0), + voter: "", + option: 0, + metadata: "" + }; +} +export const MsgVote = { + typeUrl: "/cosmos.gov.v1.MsgVote", + encode(message: MsgVote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.voter !== "") { + writer.uint32(18).string(message.voter); + } + if (message.option !== 0) { + writer.uint32(24).int32(message.option); + } + if (message.metadata !== "") { + writer.uint32(34).string(message.metadata); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgVote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgVote(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.voter = reader.string(); + break; + case 3: + message.option = (reader.int32() as any); + break; + case 4: + message.metadata = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgVote { + const message = createBaseMsgVote(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.voter = object.voter ?? ""; + message.option = object.option ?? 0; + message.metadata = object.metadata ?? ""; + return message; + }, + fromAmino(object: MsgVoteAmino): MsgVote { + const message = createBaseMsgVote(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + if (object.option !== undefined && object.option !== null) { + message.option = object.option; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + return message; + }, + toAmino(message: MsgVote): MsgVoteAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; + obj.voter = message.voter === "" ? undefined : message.voter; + obj.option = message.option === 0 ? undefined : message.option; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + return obj; + }, + fromAminoMsg(object: MsgVoteAminoMsg): MsgVote { + return MsgVote.fromAmino(object.value); + }, + toAminoMsg(message: MsgVote): MsgVoteAminoMsg { + return { + type: "cosmos-sdk/v1/MsgVote", + value: MsgVote.toAmino(message) + }; + }, + fromProtoMsg(message: MsgVoteProtoMsg): MsgVote { + return MsgVote.decode(message.value); + }, + toProto(message: MsgVote): Uint8Array { + return MsgVote.encode(message).finish(); + }, + toProtoMsg(message: MsgVote): MsgVoteProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.MsgVote", + value: MsgVote.encode(message).finish() + }; + } +}; +function createBaseMsgVoteResponse(): MsgVoteResponse { + return {}; +} +export const MsgVoteResponse = { + typeUrl: "/cosmos.gov.v1.MsgVoteResponse", + encode(_: MsgVoteResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgVoteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgVoteResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgVoteResponse { + const message = createBaseMsgVoteResponse(); + return message; + }, + fromAmino(_: MsgVoteResponseAmino): MsgVoteResponse { + const message = createBaseMsgVoteResponse(); + return message; + }, + toAmino(_: MsgVoteResponse): MsgVoteResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgVoteResponseAminoMsg): MsgVoteResponse { + return MsgVoteResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgVoteResponse): MsgVoteResponseAminoMsg { + return { + type: "cosmos-sdk/v1/MsgVoteResponse", + value: MsgVoteResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgVoteResponseProtoMsg): MsgVoteResponse { + return MsgVoteResponse.decode(message.value); + }, + toProto(message: MsgVoteResponse): Uint8Array { + return MsgVoteResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgVoteResponse): MsgVoteResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.MsgVoteResponse", + value: MsgVoteResponse.encode(message).finish() + }; + } +}; +function createBaseMsgVoteWeighted(): MsgVoteWeighted { + return { + proposalId: BigInt(0), + voter: "", + options: [], + metadata: "" + }; +} +export const MsgVoteWeighted = { + typeUrl: "/cosmos.gov.v1.MsgVoteWeighted", + encode(message: MsgVoteWeighted, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.voter !== "") { + writer.uint32(18).string(message.voter); + } + for (const v of message.options) { + WeightedVoteOption.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.metadata !== "") { + writer.uint32(34).string(message.metadata); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgVoteWeighted { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgVoteWeighted(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.voter = reader.string(); + break; + case 3: + message.options.push(WeightedVoteOption.decode(reader, reader.uint32())); + break; + case 4: + message.metadata = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgVoteWeighted { + const message = createBaseMsgVoteWeighted(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.voter = object.voter ?? ""; + message.options = object.options?.map(e => WeightedVoteOption.fromPartial(e)) || []; + message.metadata = object.metadata ?? ""; + return message; + }, + fromAmino(object: MsgVoteWeightedAmino): MsgVoteWeighted { + const message = createBaseMsgVoteWeighted(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + message.options = object.options?.map(e => WeightedVoteOption.fromAmino(e)) || []; + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + return message; + }, + toAmino(message: MsgVoteWeighted): MsgVoteWeightedAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; + obj.voter = message.voter === "" ? undefined : message.voter; + if (message.options) { + obj.options = message.options.map(e => e ? WeightedVoteOption.toAmino(e) : undefined); + } else { + obj.options = message.options; + } + obj.metadata = message.metadata === "" ? undefined : message.metadata; + return obj; + }, + fromAminoMsg(object: MsgVoteWeightedAminoMsg): MsgVoteWeighted { + return MsgVoteWeighted.fromAmino(object.value); + }, + toAminoMsg(message: MsgVoteWeighted): MsgVoteWeightedAminoMsg { + return { + type: "cosmos-sdk/v1/MsgVoteWeighted", + value: MsgVoteWeighted.toAmino(message) + }; + }, + fromProtoMsg(message: MsgVoteWeightedProtoMsg): MsgVoteWeighted { + return MsgVoteWeighted.decode(message.value); + }, + toProto(message: MsgVoteWeighted): Uint8Array { + return MsgVoteWeighted.encode(message).finish(); + }, + toProtoMsg(message: MsgVoteWeighted): MsgVoteWeightedProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.MsgVoteWeighted", + value: MsgVoteWeighted.encode(message).finish() + }; + } +}; +function createBaseMsgVoteWeightedResponse(): MsgVoteWeightedResponse { + return {}; +} +export const MsgVoteWeightedResponse = { + typeUrl: "/cosmos.gov.v1.MsgVoteWeightedResponse", + encode(_: MsgVoteWeightedResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgVoteWeightedResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgVoteWeightedResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgVoteWeightedResponse { + const message = createBaseMsgVoteWeightedResponse(); + return message; + }, + fromAmino(_: MsgVoteWeightedResponseAmino): MsgVoteWeightedResponse { + const message = createBaseMsgVoteWeightedResponse(); + return message; + }, + toAmino(_: MsgVoteWeightedResponse): MsgVoteWeightedResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgVoteWeightedResponseAminoMsg): MsgVoteWeightedResponse { + return MsgVoteWeightedResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgVoteWeightedResponse): MsgVoteWeightedResponseAminoMsg { + return { + type: "cosmos-sdk/v1/MsgVoteWeightedResponse", + value: MsgVoteWeightedResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgVoteWeightedResponseProtoMsg): MsgVoteWeightedResponse { + return MsgVoteWeightedResponse.decode(message.value); + }, + toProto(message: MsgVoteWeightedResponse): Uint8Array { + return MsgVoteWeightedResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgVoteWeightedResponse): MsgVoteWeightedResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.MsgVoteWeightedResponse", + value: MsgVoteWeightedResponse.encode(message).finish() + }; + } +}; +function createBaseMsgDeposit(): MsgDeposit { + return { + proposalId: BigInt(0), + depositor: "", + amount: [] + }; +} +export const MsgDeposit = { + typeUrl: "/cosmos.gov.v1.MsgDeposit", + encode(message: MsgDeposit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.depositor !== "") { + writer.uint32(18).string(message.depositor); + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDeposit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDeposit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.depositor = reader.string(); + break; + case 3: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgDeposit { + const message = createBaseMsgDeposit(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.depositor = object.depositor ?? ""; + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgDepositAmino): MsgDeposit { + const message = createBaseMsgDeposit(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.depositor !== undefined && object.depositor !== null) { + message.depositor = object.depositor; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgDeposit): MsgDepositAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; + obj.depositor = message.depositor === "" ? undefined : message.depositor; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = message.amount; + } + return obj; + }, + fromAminoMsg(object: MsgDepositAminoMsg): MsgDeposit { + return MsgDeposit.fromAmino(object.value); + }, + toAminoMsg(message: MsgDeposit): MsgDepositAminoMsg { + return { + type: "cosmos-sdk/v1/MsgDeposit", + value: MsgDeposit.toAmino(message) + }; + }, + fromProtoMsg(message: MsgDepositProtoMsg): MsgDeposit { + return MsgDeposit.decode(message.value); + }, + toProto(message: MsgDeposit): Uint8Array { + return MsgDeposit.encode(message).finish(); + }, + toProtoMsg(message: MsgDeposit): MsgDepositProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.MsgDeposit", + value: MsgDeposit.encode(message).finish() + }; + } +}; +function createBaseMsgDepositResponse(): MsgDepositResponse { + return {}; +} +export const MsgDepositResponse = { + typeUrl: "/cosmos.gov.v1.MsgDepositResponse", + encode(_: MsgDepositResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgDepositResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgDepositResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgDepositResponse { + const message = createBaseMsgDepositResponse(); + return message; + }, + fromAmino(_: MsgDepositResponseAmino): MsgDepositResponse { + const message = createBaseMsgDepositResponse(); + return message; + }, + toAmino(_: MsgDepositResponse): MsgDepositResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgDepositResponseAminoMsg): MsgDepositResponse { + return MsgDepositResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgDepositResponse): MsgDepositResponseAminoMsg { + return { + type: "cosmos-sdk/v1/MsgDepositResponse", + value: MsgDepositResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgDepositResponseProtoMsg): MsgDepositResponse { + return MsgDepositResponse.decode(message.value); + }, + toProto(message: MsgDepositResponse): Uint8Array { + return MsgDepositResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgDepositResponse): MsgDepositResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.MsgDepositResponse", + value: MsgDepositResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/cosmos.gov.v1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.params = message.params ? Params.toAmino(message.params) : Params.toAmino(Params.fromPartial({})); + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/x/gov/v1/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/cosmos.gov.v1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/v1/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +function createBaseMsgCancelProposal(): MsgCancelProposal { + return { + proposalId: BigInt(0), + proposer: "" + }; +} +export const MsgCancelProposal = { + typeUrl: "/cosmos.gov.v1.MsgCancelProposal", + encode(message: MsgCancelProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.proposer !== "") { + writer.uint32(18).string(message.proposer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.proposer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCancelProposal { + const message = createBaseMsgCancelProposal(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.proposer = object.proposer ?? ""; + return message; + }, + fromAmino(object: MsgCancelProposalAmino): MsgCancelProposal { + const message = createBaseMsgCancelProposal(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.proposer !== undefined && object.proposer !== null) { + message.proposer = object.proposer; + } + return message; + }, + toAmino(message: MsgCancelProposal): MsgCancelProposalAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; + obj.proposer = message.proposer === "" ? undefined : message.proposer; + return obj; + }, + fromAminoMsg(object: MsgCancelProposalAminoMsg): MsgCancelProposal { + return MsgCancelProposal.fromAmino(object.value); + }, + toAminoMsg(message: MsgCancelProposal): MsgCancelProposalAminoMsg { + return { + type: "cosmos-sdk/v1/MsgCancelProposal", + value: MsgCancelProposal.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCancelProposalProtoMsg): MsgCancelProposal { + return MsgCancelProposal.decode(message.value); + }, + toProto(message: MsgCancelProposal): Uint8Array { + return MsgCancelProposal.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelProposal): MsgCancelProposalProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.MsgCancelProposal", + value: MsgCancelProposal.encode(message).finish() + }; + } +}; +function createBaseMsgCancelProposalResponse(): MsgCancelProposalResponse { + return { + proposalId: BigInt(0), + canceledTime: new Date(), + canceledHeight: BigInt(0) + }; +} +export const MsgCancelProposalResponse = { + typeUrl: "/cosmos.gov.v1.MsgCancelProposalResponse", + encode(message: MsgCancelProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.canceledTime !== undefined) { + Timestamp.encode(toTimestamp(message.canceledTime), writer.uint32(18).fork()).ldelim(); + } + if (message.canceledHeight !== BigInt(0)) { + writer.uint32(24).uint64(message.canceledHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelProposalResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.canceledTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 3: + message.canceledHeight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCancelProposalResponse { + const message = createBaseMsgCancelProposalResponse(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.canceledTime = object.canceledTime ?? undefined; + message.canceledHeight = object.canceledHeight !== undefined && object.canceledHeight !== null ? BigInt(object.canceledHeight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgCancelProposalResponseAmino): MsgCancelProposalResponse { + const message = createBaseMsgCancelProposalResponse(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.canceled_time !== undefined && object.canceled_time !== null) { + message.canceledTime = fromTimestamp(Timestamp.fromAmino(object.canceled_time)); + } + if (object.canceled_height !== undefined && object.canceled_height !== null) { + message.canceledHeight = BigInt(object.canceled_height); + } + return message; + }, + toAmino(message: MsgCancelProposalResponse): MsgCancelProposalResponseAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; + obj.canceled_time = message.canceledTime ? Timestamp.toAmino(toTimestamp(message.canceledTime)) : undefined; + obj.canceled_height = message.canceledHeight !== BigInt(0) ? message.canceledHeight.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgCancelProposalResponseAminoMsg): MsgCancelProposalResponse { + return MsgCancelProposalResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCancelProposalResponse): MsgCancelProposalResponseAminoMsg { + return { + type: "cosmos-sdk/v1/MsgCancelProposalResponse", + value: MsgCancelProposalResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCancelProposalResponseProtoMsg): MsgCancelProposalResponse { + return MsgCancelProposalResponse.decode(message.value); + }, + toProto(message: MsgCancelProposalResponse): Uint8Array { + return MsgCancelProposalResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelProposalResponse): MsgCancelProposalResponseProtoMsg { + return { + typeUrl: "/cosmos.gov.v1.MsgCancelProposalResponse", + value: MsgCancelProposalResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/gov/v1beta1/genesis.ts b/src/codegen/cosmos/gov/v1beta1/genesis.ts index d4c8845..11728e2 100644 --- a/src/codegen/cosmos/gov/v1beta1/genesis.ts +++ b/src/codegen/cosmos/gov/v1beta1/genesis.ts @@ -10,11 +10,11 @@ export interface GenesisState { votes: Vote[]; /** proposals defines all the proposals present at genesis. */ proposals: Proposal[]; - /** params defines all the paramaters of related to deposit. */ + /** deposit_params defines all the parameters related to deposit. */ depositParams: DepositParams; - /** params defines all the paramaters of related to voting. */ + /** voting_params defines all the parameters related to voting. */ votingParams: VotingParams; - /** params defines all the paramaters of related to tally. */ + /** tally_params defines all the parameters related to tally. */ tallyParams: TallyParams; } export interface GenesisStateProtoMsg { @@ -26,17 +26,17 @@ export interface GenesisStateAmino { /** starting_proposal_id is the ID of the starting proposal. */ starting_proposal_id?: string; /** deposits defines all the deposits present at genesis. */ - deposits?: DepositAmino[]; + deposits: DepositAmino[]; /** votes defines all the votes present at genesis. */ - votes?: VoteAmino[]; + votes: VoteAmino[]; /** proposals defines all the proposals present at genesis. */ - proposals?: ProposalAmino[]; - /** params defines all the paramaters of related to deposit. */ - deposit_params?: DepositParamsAmino; - /** params defines all the paramaters of related to voting. */ - voting_params?: VotingParamsAmino; - /** params defines all the paramaters of related to tally. */ - tally_params?: TallyParamsAmino; + proposals: ProposalAmino[]; + /** deposit_params defines all the parameters related to deposit. */ + deposit_params: DepositParamsAmino; + /** voting_params defines all the parameters related to voting. */ + voting_params: VotingParamsAmino; + /** tally_params defines all the parameters related to tally. */ + tally_params: TallyParamsAmino; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -172,9 +172,9 @@ export const GenesisState = { } else { obj.proposals = message.proposals; } - obj.deposit_params = message.depositParams ? DepositParams.toAmino(message.depositParams) : undefined; - obj.voting_params = message.votingParams ? VotingParams.toAmino(message.votingParams) : undefined; - obj.tally_params = message.tallyParams ? TallyParams.toAmino(message.tallyParams) : undefined; + obj.deposit_params = message.depositParams ? DepositParams.toAmino(message.depositParams) : DepositParams.toAmino(DepositParams.fromPartial({})); + obj.voting_params = message.votingParams ? VotingParams.toAmino(message.votingParams) : VotingParams.toAmino(VotingParams.fromPartial({})); + obj.tally_params = message.tallyParams ? TallyParams.toAmino(message.tallyParams) : TallyParams.toAmino(TallyParams.fromPartial({})); return obj; }, fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { diff --git a/src/codegen/cosmos/gov/v1beta1/gov.ts b/src/codegen/cosmos/gov/v1beta1/gov.ts index cf2c676..79f9bc8 100644 --- a/src/codegen/cosmos/gov/v1beta1/gov.ts +++ b/src/codegen/cosmos/gov/v1beta1/gov.ts @@ -63,7 +63,7 @@ export function voteOptionToJSON(object: VoteOption): string { } /** ProposalStatus enumerates the valid statuses of a proposal. */ export enum ProposalStatus { - /** PROPOSAL_STATUS_UNSPECIFIED - PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. */ + /** PROPOSAL_STATUS_UNSPECIFIED - PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. */ PROPOSAL_STATUS_UNSPECIFIED = 0, /** * PROPOSAL_STATUS_DEPOSIT_PERIOD - PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit @@ -145,7 +145,9 @@ export function proposalStatusToJSON(object: ProposalStatus): string { * Since: cosmos-sdk 0.43 */ export interface WeightedVoteOption { + /** option defines the valid vote options, it must not contain duplicate vote options. */ option: VoteOption; + /** weight is the vote weight associated with the vote option. */ weight: string; } export interface WeightedVoteOptionProtoMsg { @@ -158,8 +160,10 @@ export interface WeightedVoteOptionProtoMsg { * Since: cosmos-sdk 0.43 */ export interface WeightedVoteOptionAmino { + /** option defines the valid vote options, it must not contain duplicate vote options. */ option?: VoteOption; - weight?: string; + /** weight is the vote weight associated with the vote option. */ + weight: string; } export interface WeightedVoteOptionAminoMsg { type: "cosmos-sdk/WeightedVoteOption"; @@ -179,7 +183,9 @@ export interface WeightedVoteOptionSDKType { * manually updated in case of approval. */ export interface TextProposal { + /** title of the proposal. */ title: string; + /** description associated with the proposal. */ description: string; } export interface TextProposalProtoMsg { @@ -191,7 +197,9 @@ export interface TextProposalProtoMsg { * manually updated in case of approval. */ export interface TextProposalAmino { + /** title of the proposal. */ title?: string; + /** description associated with the proposal. */ description?: string; } export interface TextProposalAminoMsg { @@ -211,8 +219,11 @@ export interface TextProposalSDKType { * proposal. */ export interface Deposit { + /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; + /** depositor defines the deposit addresses from the proposals. */ depositor: string; + /** amount to be deposited by depositor. */ amount: Coin[]; } export interface DepositProtoMsg { @@ -224,9 +235,12 @@ export interface DepositProtoMsg { * proposal. */ export interface DepositAmino { + /** proposal_id defines the unique id of the proposal. */ proposal_id?: string; + /** depositor defines the deposit addresses from the proposals. */ depositor?: string; - amount?: CoinAmino[]; + /** amount to be deposited by depositor. */ + amount: CoinAmino[]; } export interface DepositAminoMsg { type: "cosmos-sdk/Deposit"; @@ -243,14 +257,27 @@ export interface DepositSDKType { } /** Proposal defines the core field members of a governance proposal. */ export interface Proposal { + /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; + /** content is the proposal's content. */ content?: Any; + /** status defines the proposal status. */ status: ProposalStatus; + /** + * final_tally_result is the final tally result of the proposal. When + * querying a proposal via gRPC, this field is not populated until the + * proposal's voting period has ended. + */ finalTallyResult: TallyResult; + /** submit_time is the time of proposal submission. */ submitTime: Date; + /** deposit_end_time is the end time for deposition. */ depositEndTime: Date; + /** total_deposit is the total deposit on the proposal. */ totalDeposit: Coin[]; + /** voting_start_time is the starting time to vote on a proposal. */ votingStartTime: Date; + /** voting_end_time is the end time of voting on a proposal. */ votingEndTime: Date; } export interface ProposalProtoMsg { @@ -259,15 +286,28 @@ export interface ProposalProtoMsg { } /** Proposal defines the core field members of a governance proposal. */ export interface ProposalAmino { - proposal_id: string; + /** proposal_id defines the unique id of the proposal. */ + proposal_id?: string; + /** content is the proposal's content. */ content?: AnyAmino; + /** status defines the proposal status. */ status?: ProposalStatus; - final_tally_result?: TallyResultAmino; - submit_time?: string; - deposit_end_time?: string; - total_deposit?: CoinAmino[]; - voting_start_time?: string; - voting_end_time?: string; + /** + * final_tally_result is the final tally result of the proposal. When + * querying a proposal via gRPC, this field is not populated until the + * proposal's voting period has ended. + */ + final_tally_result: TallyResultAmino; + /** submit_time is the time of proposal submission. */ + submit_time: string; + /** deposit_end_time is the end time for deposition. */ + deposit_end_time: string; + /** total_deposit is the total deposit on the proposal. */ + total_deposit: CoinAmino[]; + /** voting_start_time is the starting time to vote on a proposal. */ + voting_start_time: string; + /** voting_end_time is the end time of voting on a proposal. */ + voting_end_time: string; } export interface ProposalAminoMsg { type: "cosmos-sdk/Proposal"; @@ -287,9 +327,13 @@ export interface ProposalSDKType { } /** TallyResult defines a standard tally for a governance proposal. */ export interface TallyResult { + /** yes is the number of yes votes on a proposal. */ yes: string; + /** abstain is the number of abstain votes on a proposal. */ abstain: string; + /** no is the number of no votes on a proposal. */ no: string; + /** no_with_veto is the number of no with veto votes on a proposal. */ noWithVeto: string; } export interface TallyResultProtoMsg { @@ -298,9 +342,13 @@ export interface TallyResultProtoMsg { } /** TallyResult defines a standard tally for a governance proposal. */ export interface TallyResultAmino { + /** yes is the number of yes votes on a proposal. */ yes?: string; + /** abstain is the number of abstain votes on a proposal. */ abstain?: string; + /** no is the number of no votes on a proposal. */ no?: string; + /** no_with_veto is the number of no with veto votes on a proposal. */ no_with_veto?: string; } export interface TallyResultAminoMsg { @@ -319,7 +367,9 @@ export interface TallyResultSDKType { * A Vote consists of a proposal ID, the voter, and the vote option. */ export interface Vote { + /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; + /** voter is the voter address of the proposal. */ voter: string; /** * Deprecated: Prefer to use `options` instead. This field is set in queries @@ -328,7 +378,11 @@ export interface Vote { */ /** @deprecated */ option: VoteOption; - /** Since: cosmos-sdk 0.43 */ + /** + * options is the weighted vote options. + * + * Since: cosmos-sdk 0.43 + */ options: WeightedVoteOption[]; } export interface VoteProtoMsg { @@ -340,7 +394,9 @@ export interface VoteProtoMsg { * A Vote consists of a proposal ID, the voter, and the vote option. */ export interface VoteAmino { - proposal_id?: string; + /** proposal_id defines the unique id of the proposal. */ + proposal_id: string; + /** voter is the voter address of the proposal. */ voter?: string; /** * Deprecated: Prefer to use `options` instead. This field is set in queries @@ -349,8 +405,12 @@ export interface VoteAmino { */ /** @deprecated */ option?: VoteOption; - /** Since: cosmos-sdk 0.43 */ - options?: WeightedVoteOptionAmino[]; + /** + * options is the weighted vote options. + * + * Since: cosmos-sdk 0.43 + */ + options: WeightedVoteOptionAmino[]; } export interface VoteAminoMsg { type: "cosmos-sdk/Vote"; @@ -373,7 +433,7 @@ export interface DepositParams { minDeposit: Coin[]; /** * Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - * months. + * months. */ maxDepositPeriod: Duration; } @@ -387,7 +447,7 @@ export interface DepositParamsAmino { min_deposit?: CoinAmino[]; /** * Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - * months. + * months. */ max_deposit_period?: DurationAmino; } @@ -402,7 +462,7 @@ export interface DepositParamsSDKType { } /** VotingParams defines the params for voting on governance proposals. */ export interface VotingParams { - /** Length of the voting period. */ + /** Duration of the voting period. */ votingPeriod: Duration; } export interface VotingParamsProtoMsg { @@ -411,7 +471,7 @@ export interface VotingParamsProtoMsg { } /** VotingParams defines the params for voting on governance proposals. */ export interface VotingParamsAmino { - /** Length of the voting period. */ + /** Duration of the voting period. */ voting_period?: DurationAmino; } export interface VotingParamsAminoMsg { @@ -426,14 +486,14 @@ export interface VotingParamsSDKType { export interface TallyParams { /** * Minimum percentage of total stake needed to vote for a result to be - * considered valid. + * considered valid. */ quorum: Uint8Array; /** Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. */ threshold: Uint8Array; /** * Minimum value of Veto votes to Total votes ratio for proposal to be - * vetoed. Default value: 1/3. + * vetoed. Default value: 1/3. */ vetoThreshold: Uint8Array; } @@ -445,14 +505,14 @@ export interface TallyParamsProtoMsg { export interface TallyParamsAmino { /** * Minimum percentage of total stake needed to vote for a result to be - * considered valid. + * considered valid. */ quorum?: string; /** Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. */ threshold?: string; /** * Minimum value of Veto votes to Total votes ratio for proposal to be - * vetoed. Default value: 1/3. + * vetoed. Default value: 1/3. */ veto_threshold?: string; } @@ -522,7 +582,7 @@ export const WeightedVoteOption = { toAmino(message: WeightedVoteOption): WeightedVoteOptionAmino { const obj: any = {}; obj.option = message.option === 0 ? undefined : message.option; - obj.weight = message.weight === "" ? undefined : message.weight; + obj.weight = message.weight ?? ""; return obj; }, fromAminoMsg(object: WeightedVoteOptionAminoMsg): WeightedVoteOption { @@ -853,19 +913,19 @@ export const Proposal = { }, toAmino(message: Proposal): ProposalAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; obj.content = message.content ? Any.toAmino(message.content) : undefined; obj.status = message.status === 0 ? undefined : message.status; - obj.final_tally_result = message.finalTallyResult ? TallyResult.toAmino(message.finalTallyResult) : undefined; - obj.submit_time = message.submitTime ? Timestamp.toAmino(toTimestamp(message.submitTime)) : undefined; - obj.deposit_end_time = message.depositEndTime ? Timestamp.toAmino(toTimestamp(message.depositEndTime)) : undefined; + obj.final_tally_result = message.finalTallyResult ? TallyResult.toAmino(message.finalTallyResult) : TallyResult.toAmino(TallyResult.fromPartial({})); + obj.submit_time = message.submitTime ? Timestamp.toAmino(toTimestamp(message.submitTime)) : new Date(); + obj.deposit_end_time = message.depositEndTime ? Timestamp.toAmino(toTimestamp(message.depositEndTime)) : new Date(); if (message.totalDeposit) { obj.total_deposit = message.totalDeposit.map(e => e ? Coin.toAmino(e) : undefined); } else { obj.total_deposit = message.totalDeposit; } - obj.voting_start_time = message.votingStartTime ? Timestamp.toAmino(toTimestamp(message.votingStartTime)) : undefined; - obj.voting_end_time = message.votingEndTime ? Timestamp.toAmino(toTimestamp(message.votingEndTime)) : undefined; + obj.voting_start_time = message.votingStartTime ? Timestamp.toAmino(toTimestamp(message.votingStartTime)) : new Date(); + obj.voting_end_time = message.votingEndTime ? Timestamp.toAmino(toTimestamp(message.votingEndTime)) : new Date(); return obj; }, fromAminoMsg(object: ProposalAminoMsg): Proposal { @@ -1070,7 +1130,7 @@ export const Vote = { }, toAmino(message: Vote): VoteAmino { const obj: any = {}; - obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; obj.voter = message.voter === "" ? undefined : message.voter; obj.option = message.option === 0 ? undefined : message.option; if (message.options) { diff --git a/src/codegen/cosmos/gov/v1beta1/query.lcd.ts b/src/codegen/cosmos/gov/v1beta1/query.lcd.ts index eeaf06a..1a04b05 100644 --- a/src/codegen/cosmos/gov/v1beta1/query.lcd.ts +++ b/src/codegen/cosmos/gov/v1beta1/query.lcd.ts @@ -64,7 +64,7 @@ export class LCDQueryClient { const endpoint = `cosmos/gov/v1beta1/params/${params.paramsType}`; return await this.req.get(endpoint); } - /* Deposit queries single deposit information based proposalID, depositAddr. */ + /* Deposit queries single deposit information based on proposalID, depositor address. */ async deposit(params: QueryDepositRequest): Promise { const endpoint = `cosmos/gov/v1beta1/proposals/${params.proposalId}/deposits/${params.depositor}`; return await this.req.get(endpoint); diff --git a/src/codegen/cosmos/gov/v1beta1/query.rpc.Query.ts b/src/codegen/cosmos/gov/v1beta1/query.rpc.Query.ts index ead5910..1082910 100644 --- a/src/codegen/cosmos/gov/v1beta1/query.rpc.Query.ts +++ b/src/codegen/cosmos/gov/v1beta1/query.rpc.Query.ts @@ -14,7 +14,7 @@ export interface Query { votes(request: QueryVotesRequest): Promise; /** Params queries all parameters of the gov module. */ params(request: QueryParamsRequest): Promise; - /** Deposit queries single deposit information based proposalID, depositAddr. */ + /** Deposit queries single deposit information based on proposalID, depositor address. */ deposit(request: QueryDepositRequest): Promise; /** Deposits queries all deposits of a single proposal. */ deposits(request: QueryDepositsRequest): Promise; diff --git a/src/codegen/cosmos/gov/v1beta1/query.ts b/src/codegen/cosmos/gov/v1beta1/query.ts index 3006f45..29e2bb0 100644 --- a/src/codegen/cosmos/gov/v1beta1/query.ts +++ b/src/codegen/cosmos/gov/v1beta1/query.ts @@ -33,7 +33,7 @@ export interface QueryProposalResponseProtoMsg { } /** QueryProposalResponse is the response type for the Query/Proposal RPC method. */ export interface QueryProposalResponseAmino { - proposal?: ProposalAmino; + proposal: ProposalAmino; } export interface QueryProposalResponseAminoMsg { type: "cosmos-sdk/QueryProposalResponse"; @@ -85,6 +85,7 @@ export interface QueryProposalsRequestSDKType { * method. */ export interface QueryProposalsResponse { + /** proposals defines all the requested governance proposals. */ proposals: Proposal[]; /** pagination defines the pagination in the response. */ pagination?: PageResponse; @@ -98,7 +99,8 @@ export interface QueryProposalsResponseProtoMsg { * method. */ export interface QueryProposalsResponseAmino { - proposals?: ProposalAmino[]; + /** proposals defines all the requested governance proposals. */ + proposals: ProposalAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -118,7 +120,7 @@ export interface QueryProposalsResponseSDKType { export interface QueryVoteRequest { /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; - /** voter defines the oter address for the proposals. */ + /** voter defines the voter address for the proposals. */ voter: string; } export interface QueryVoteRequestProtoMsg { @@ -129,7 +131,7 @@ export interface QueryVoteRequestProtoMsg { export interface QueryVoteRequestAmino { /** proposal_id defines the unique id of the proposal. */ proposal_id?: string; - /** voter defines the oter address for the proposals. */ + /** voter defines the voter address for the proposals. */ voter?: string; } export interface QueryVoteRequestAminoMsg { @@ -143,7 +145,7 @@ export interface QueryVoteRequestSDKType { } /** QueryVoteResponse is the response type for the Query/Vote RPC method. */ export interface QueryVoteResponse { - /** vote defined the queried vote. */ + /** vote defines the queried vote. */ vote: Vote; } export interface QueryVoteResponseProtoMsg { @@ -152,8 +154,8 @@ export interface QueryVoteResponseProtoMsg { } /** QueryVoteResponse is the response type for the Query/Vote RPC method. */ export interface QueryVoteResponseAmino { - /** vote defined the queried vote. */ - vote?: VoteAmino; + /** vote defines the queried vote. */ + vote: VoteAmino; } export interface QueryVoteResponseAminoMsg { type: "cosmos-sdk/QueryVoteResponse"; @@ -192,7 +194,7 @@ export interface QueryVotesRequestSDKType { } /** QueryVotesResponse is the response type for the Query/Votes RPC method. */ export interface QueryVotesResponse { - /** votes defined the queried votes. */ + /** votes defines the queried votes. */ votes: Vote[]; /** pagination defines the pagination in the response. */ pagination?: PageResponse; @@ -203,8 +205,8 @@ export interface QueryVotesResponseProtoMsg { } /** QueryVotesResponse is the response type for the Query/Votes RPC method. */ export interface QueryVotesResponseAmino { - /** votes defined the queried votes. */ - votes?: VoteAmino[]; + /** votes defines the queried votes. */ + votes: VoteAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -261,11 +263,11 @@ export interface QueryParamsResponseProtoMsg { /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseAmino { /** voting_params defines the parameters related to voting. */ - voting_params?: VotingParamsAmino; + voting_params: VotingParamsAmino; /** deposit_params defines the parameters related to deposit. */ - deposit_params?: DepositParamsAmino; + deposit_params: DepositParamsAmino; /** tally_params defines the parameters related to tally. */ - tally_params?: TallyParamsAmino; + tally_params: TallyParamsAmino; } export interface QueryParamsResponseAminoMsg { type: "cosmos-sdk/QueryParamsResponse"; @@ -316,7 +318,7 @@ export interface QueryDepositResponseProtoMsg { /** QueryDepositResponse is the response type for the Query/Deposit RPC method. */ export interface QueryDepositResponseAmino { /** deposit defines the requested deposit. */ - deposit?: DepositAmino; + deposit: DepositAmino; } export interface QueryDepositResponseAminoMsg { type: "cosmos-sdk/QueryDepositResponse"; @@ -355,6 +357,7 @@ export interface QueryDepositsRequestSDKType { } /** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ export interface QueryDepositsResponse { + /** deposits defines the requested deposits. */ deposits: Deposit[]; /** pagination defines the pagination in the response. */ pagination?: PageResponse; @@ -365,7 +368,8 @@ export interface QueryDepositsResponseProtoMsg { } /** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ export interface QueryDepositsResponseAmino { - deposits?: DepositAmino[]; + /** deposits defines the requested deposits. */ + deposits: DepositAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -412,7 +416,7 @@ export interface QueryTallyResultResponseProtoMsg { /** QueryTallyResultResponse is the response type for the Query/Tally RPC method. */ export interface QueryTallyResultResponseAmino { /** tally defines the requested tally. */ - tally?: TallyResultAmino; + tally: TallyResultAmino; } export interface QueryTallyResultResponseAminoMsg { type: "cosmos-sdk/QueryTallyResultResponse"; @@ -535,7 +539,7 @@ export const QueryProposalResponse = { }, toAmino(message: QueryProposalResponse): QueryProposalResponseAmino { const obj: any = {}; - obj.proposal = message.proposal ? Proposal.toAmino(message.proposal) : undefined; + obj.proposal = message.proposal ? Proposal.toAmino(message.proposal) : Proposal.toAmino(Proposal.fromPartial({})); return obj; }, fromAminoMsg(object: QueryProposalResponseAminoMsg): QueryProposalResponse { @@ -873,7 +877,7 @@ export const QueryVoteResponse = { }, toAmino(message: QueryVoteResponse): QueryVoteResponseAmino { const obj: any = {}; - obj.vote = message.vote ? Vote.toAmino(message.vote) : undefined; + obj.vote = message.vote ? Vote.toAmino(message.vote) : Vote.toAmino(Vote.fromPartial({})); return obj; }, fromAminoMsg(object: QueryVoteResponseAminoMsg): QueryVoteResponse { @@ -1197,9 +1201,9 @@ export const QueryParamsResponse = { }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; - obj.voting_params = message.votingParams ? VotingParams.toAmino(message.votingParams) : undefined; - obj.deposit_params = message.depositParams ? DepositParams.toAmino(message.depositParams) : undefined; - obj.tally_params = message.tallyParams ? TallyParams.toAmino(message.tallyParams) : undefined; + obj.voting_params = message.votingParams ? VotingParams.toAmino(message.votingParams) : VotingParams.toAmino(VotingParams.fromPartial({})); + obj.deposit_params = message.depositParams ? DepositParams.toAmino(message.depositParams) : DepositParams.toAmino(DepositParams.fromPartial({})); + obj.tally_params = message.tallyParams ? TallyParams.toAmino(message.tallyParams) : TallyParams.toAmino(TallyParams.fromPartial({})); return obj; }, fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { @@ -1349,7 +1353,7 @@ export const QueryDepositResponse = { }, toAmino(message: QueryDepositResponse): QueryDepositResponseAmino { const obj: any = {}; - obj.deposit = message.deposit ? Deposit.toAmino(message.deposit) : undefined; + obj.deposit = message.deposit ? Deposit.toAmino(message.deposit) : Deposit.toAmino(Deposit.fromPartial({})); return obj; }, fromAminoMsg(object: QueryDepositResponseAminoMsg): QueryDepositResponse { @@ -1651,7 +1655,7 @@ export const QueryTallyResultResponse = { }, toAmino(message: QueryTallyResultResponse): QueryTallyResultResponseAmino { const obj: any = {}; - obj.tally = message.tally ? TallyResult.toAmino(message.tally) : undefined; + obj.tally = message.tally ? TallyResult.toAmino(message.tally) : TallyResult.toAmino(TallyResult.fromPartial({})); return obj; }, fromAminoMsg(object: QueryTallyResultResponseAminoMsg): QueryTallyResultResponse { diff --git a/src/codegen/cosmos/gov/v1beta1/tx.rpc.msg.ts b/src/codegen/cosmos/gov/v1beta1/tx.rpc.msg.ts index 9298288..92d6ce8 100644 --- a/src/codegen/cosmos/gov/v1beta1/tx.rpc.msg.ts +++ b/src/codegen/cosmos/gov/v1beta1/tx.rpc.msg.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; import { MsgSubmitProposal, MsgSubmitProposalResponse, MsgVote, MsgVoteResponse, MsgVoteWeighted, MsgVoteWeightedResponse, MsgDeposit, MsgDepositResponse } from "./tx"; -/** Msg defines the bank Msg service. */ +/** Msg defines the gov Msg service. */ export interface Msg { /** SubmitProposal defines a method to create new proposal given a content. */ submitProposal(request: MsgSubmitProposal): Promise; diff --git a/src/codegen/cosmos/gov/v1beta1/tx.ts b/src/codegen/cosmos/gov/v1beta1/tx.ts index 644b36d..0bde14a 100644 --- a/src/codegen/cosmos/gov/v1beta1/tx.ts +++ b/src/codegen/cosmos/gov/v1beta1/tx.ts @@ -7,8 +7,11 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; * proposal Content. */ export interface MsgSubmitProposal { + /** content is the proposal's content. */ content?: Any; + /** initial_deposit is the deposit value that must be paid at proposal submission. */ initialDeposit: Coin[]; + /** proposer is the account address of the proposer. */ proposer: string; } export interface MsgSubmitProposalProtoMsg { @@ -20,8 +23,11 @@ export interface MsgSubmitProposalProtoMsg { * proposal Content. */ export interface MsgSubmitProposalAmino { + /** content is the proposal's content. */ content?: AnyAmino; - initial_deposit?: CoinAmino[]; + /** initial_deposit is the deposit value that must be paid at proposal submission. */ + initial_deposit: CoinAmino[]; + /** proposer is the account address of the proposer. */ proposer?: string; } export interface MsgSubmitProposalAminoMsg { @@ -39,6 +45,7 @@ export interface MsgSubmitProposalSDKType { } /** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ export interface MsgSubmitProposalResponse { + /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; } export interface MsgSubmitProposalResponseProtoMsg { @@ -47,6 +54,7 @@ export interface MsgSubmitProposalResponseProtoMsg { } /** MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. */ export interface MsgSubmitProposalResponseAmino { + /** proposal_id defines the unique id of the proposal. */ proposal_id: string; } export interface MsgSubmitProposalResponseAminoMsg { @@ -59,8 +67,11 @@ export interface MsgSubmitProposalResponseSDKType { } /** MsgVote defines a message to cast a vote. */ export interface MsgVote { + /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; + /** voter is the voter address for the proposal. */ voter: string; + /** option defines the vote option. */ option: VoteOption; } export interface MsgVoteProtoMsg { @@ -69,8 +80,11 @@ export interface MsgVoteProtoMsg { } /** MsgVote defines a message to cast a vote. */ export interface MsgVoteAmino { - proposal_id: string; + /** proposal_id defines the unique id of the proposal. */ + proposal_id?: string; + /** voter is the voter address for the proposal. */ voter?: string; + /** option defines the vote option. */ option?: VoteOption; } export interface MsgVoteAminoMsg { @@ -103,8 +117,11 @@ export interface MsgVoteResponseSDKType {} * Since: cosmos-sdk 0.43 */ export interface MsgVoteWeighted { + /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; + /** voter is the voter address for the proposal. */ voter: string; + /** options defines the weighted vote options. */ options: WeightedVoteOption[]; } export interface MsgVoteWeightedProtoMsg { @@ -117,9 +134,12 @@ export interface MsgVoteWeightedProtoMsg { * Since: cosmos-sdk 0.43 */ export interface MsgVoteWeightedAmino { - proposal_id?: string; + /** proposal_id defines the unique id of the proposal. */ + proposal_id: string; + /** voter is the voter address for the proposal. */ voter?: string; - options?: WeightedVoteOptionAmino[]; + /** options defines the weighted vote options. */ + options: WeightedVoteOptionAmino[]; } export interface MsgVoteWeightedAminoMsg { type: "cosmos-sdk/MsgVoteWeighted"; @@ -163,8 +183,11 @@ export interface MsgVoteWeightedResponseAminoMsg { export interface MsgVoteWeightedResponseSDKType {} /** MsgDeposit defines a message to submit a deposit to an existing proposal. */ export interface MsgDeposit { + /** proposal_id defines the unique id of the proposal. */ proposalId: bigint; + /** depositor defines the deposit addresses from the proposals. */ depositor: string; + /** amount to be deposited by depositor. */ amount: Coin[]; } export interface MsgDepositProtoMsg { @@ -173,9 +196,12 @@ export interface MsgDepositProtoMsg { } /** MsgDeposit defines a message to submit a deposit to an existing proposal. */ export interface MsgDepositAmino { + /** proposal_id defines the unique id of the proposal. */ proposal_id: string; + /** depositor defines the deposit addresses from the proposals. */ depositor?: string; - amount?: CoinAmino[]; + /** amount to be deposited by depositor. */ + amount: CoinAmino[]; } export interface MsgDepositAminoMsg { type: "cosmos-sdk/MsgDeposit"; @@ -431,7 +457,7 @@ export const MsgVote = { }, toAmino(message: MsgVote): MsgVoteAmino { const obj: any = {}; - obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; obj.voter = message.voter === "" ? undefined : message.voter; obj.option = message.option === 0 ? undefined : message.option; return obj; @@ -578,7 +604,7 @@ export const MsgVoteWeighted = { }, toAmino(message: MsgVoteWeighted): MsgVoteWeightedAmino { const obj: any = {}; - obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.proposal_id = message.proposalId ? message.proposalId.toString() : "0"; obj.voter = message.voter === "" ? undefined : message.voter; if (message.options) { obj.options = message.options.map(e => e ? WeightedVoteOption.toAmino(e) : undefined); diff --git a/src/codegen/cosmos/group/v1/events.ts b/src/codegen/cosmos/group/v1/events.ts new file mode 100644 index 0000000..f61f5ab --- /dev/null +++ b/src/codegen/cosmos/group/v1/events.ts @@ -0,0 +1,997 @@ +import { ProposalExecutorResult, ProposalStatus, TallyResult, TallyResultAmino, TallyResultSDKType } from "./types"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** EventCreateGroup is an event emitted when a group is created. */ +export interface EventCreateGroup { + /** group_id is the unique ID of the group. */ + groupId: bigint; +} +export interface EventCreateGroupProtoMsg { + typeUrl: "/cosmos.group.v1.EventCreateGroup"; + value: Uint8Array; +} +/** EventCreateGroup is an event emitted when a group is created. */ +export interface EventCreateGroupAmino { + /** group_id is the unique ID of the group. */ + group_id?: string; +} +export interface EventCreateGroupAminoMsg { + type: "cosmos-sdk/EventCreateGroup"; + value: EventCreateGroupAmino; +} +/** EventCreateGroup is an event emitted when a group is created. */ +export interface EventCreateGroupSDKType { + group_id: bigint; +} +/** EventUpdateGroup is an event emitted when a group is updated. */ +export interface EventUpdateGroup { + /** group_id is the unique ID of the group. */ + groupId: bigint; +} +export interface EventUpdateGroupProtoMsg { + typeUrl: "/cosmos.group.v1.EventUpdateGroup"; + value: Uint8Array; +} +/** EventUpdateGroup is an event emitted when a group is updated. */ +export interface EventUpdateGroupAmino { + /** group_id is the unique ID of the group. */ + group_id?: string; +} +export interface EventUpdateGroupAminoMsg { + type: "cosmos-sdk/EventUpdateGroup"; + value: EventUpdateGroupAmino; +} +/** EventUpdateGroup is an event emitted when a group is updated. */ +export interface EventUpdateGroupSDKType { + group_id: bigint; +} +/** EventCreateGroupPolicy is an event emitted when a group policy is created. */ +export interface EventCreateGroupPolicy { + /** address is the account address of the group policy. */ + address: string; +} +export interface EventCreateGroupPolicyProtoMsg { + typeUrl: "/cosmos.group.v1.EventCreateGroupPolicy"; + value: Uint8Array; +} +/** EventCreateGroupPolicy is an event emitted when a group policy is created. */ +export interface EventCreateGroupPolicyAmino { + /** address is the account address of the group policy. */ + address?: string; +} +export interface EventCreateGroupPolicyAminoMsg { + type: "cosmos-sdk/EventCreateGroupPolicy"; + value: EventCreateGroupPolicyAmino; +} +/** EventCreateGroupPolicy is an event emitted when a group policy is created. */ +export interface EventCreateGroupPolicySDKType { + address: string; +} +/** EventUpdateGroupPolicy is an event emitted when a group policy is updated. */ +export interface EventUpdateGroupPolicy { + /** address is the account address of the group policy. */ + address: string; +} +export interface EventUpdateGroupPolicyProtoMsg { + typeUrl: "/cosmos.group.v1.EventUpdateGroupPolicy"; + value: Uint8Array; +} +/** EventUpdateGroupPolicy is an event emitted when a group policy is updated. */ +export interface EventUpdateGroupPolicyAmino { + /** address is the account address of the group policy. */ + address?: string; +} +export interface EventUpdateGroupPolicyAminoMsg { + type: "cosmos-sdk/EventUpdateGroupPolicy"; + value: EventUpdateGroupPolicyAmino; +} +/** EventUpdateGroupPolicy is an event emitted when a group policy is updated. */ +export interface EventUpdateGroupPolicySDKType { + address: string; +} +/** EventSubmitProposal is an event emitted when a proposal is created. */ +export interface EventSubmitProposal { + /** proposal_id is the unique ID of the proposal. */ + proposalId: bigint; +} +export interface EventSubmitProposalProtoMsg { + typeUrl: "/cosmos.group.v1.EventSubmitProposal"; + value: Uint8Array; +} +/** EventSubmitProposal is an event emitted when a proposal is created. */ +export interface EventSubmitProposalAmino { + /** proposal_id is the unique ID of the proposal. */ + proposal_id?: string; +} +export interface EventSubmitProposalAminoMsg { + type: "cosmos-sdk/EventSubmitProposal"; + value: EventSubmitProposalAmino; +} +/** EventSubmitProposal is an event emitted when a proposal is created. */ +export interface EventSubmitProposalSDKType { + proposal_id: bigint; +} +/** EventWithdrawProposal is an event emitted when a proposal is withdrawn. */ +export interface EventWithdrawProposal { + /** proposal_id is the unique ID of the proposal. */ + proposalId: bigint; +} +export interface EventWithdrawProposalProtoMsg { + typeUrl: "/cosmos.group.v1.EventWithdrawProposal"; + value: Uint8Array; +} +/** EventWithdrawProposal is an event emitted when a proposal is withdrawn. */ +export interface EventWithdrawProposalAmino { + /** proposal_id is the unique ID of the proposal. */ + proposal_id?: string; +} +export interface EventWithdrawProposalAminoMsg { + type: "cosmos-sdk/EventWithdrawProposal"; + value: EventWithdrawProposalAmino; +} +/** EventWithdrawProposal is an event emitted when a proposal is withdrawn. */ +export interface EventWithdrawProposalSDKType { + proposal_id: bigint; +} +/** EventVote is an event emitted when a voter votes on a proposal. */ +export interface EventVote { + /** proposal_id is the unique ID of the proposal. */ + proposalId: bigint; +} +export interface EventVoteProtoMsg { + typeUrl: "/cosmos.group.v1.EventVote"; + value: Uint8Array; +} +/** EventVote is an event emitted when a voter votes on a proposal. */ +export interface EventVoteAmino { + /** proposal_id is the unique ID of the proposal. */ + proposal_id?: string; +} +export interface EventVoteAminoMsg { + type: "cosmos-sdk/EventVote"; + value: EventVoteAmino; +} +/** EventVote is an event emitted when a voter votes on a proposal. */ +export interface EventVoteSDKType { + proposal_id: bigint; +} +/** EventExec is an event emitted when a proposal is executed. */ +export interface EventExec { + /** proposal_id is the unique ID of the proposal. */ + proposalId: bigint; + /** result is the proposal execution result. */ + result: ProposalExecutorResult; + /** logs contains error logs in case the execution result is FAILURE. */ + logs: string; +} +export interface EventExecProtoMsg { + typeUrl: "/cosmos.group.v1.EventExec"; + value: Uint8Array; +} +/** EventExec is an event emitted when a proposal is executed. */ +export interface EventExecAmino { + /** proposal_id is the unique ID of the proposal. */ + proposal_id?: string; + /** result is the proposal execution result. */ + result?: ProposalExecutorResult; + /** logs contains error logs in case the execution result is FAILURE. */ + logs?: string; +} +export interface EventExecAminoMsg { + type: "cosmos-sdk/EventExec"; + value: EventExecAmino; +} +/** EventExec is an event emitted when a proposal is executed. */ +export interface EventExecSDKType { + proposal_id: bigint; + result: ProposalExecutorResult; + logs: string; +} +/** EventLeaveGroup is an event emitted when group member leaves the group. */ +export interface EventLeaveGroup { + /** group_id is the unique ID of the group. */ + groupId: bigint; + /** address is the account address of the group member. */ + address: string; +} +export interface EventLeaveGroupProtoMsg { + typeUrl: "/cosmos.group.v1.EventLeaveGroup"; + value: Uint8Array; +} +/** EventLeaveGroup is an event emitted when group member leaves the group. */ +export interface EventLeaveGroupAmino { + /** group_id is the unique ID of the group. */ + group_id?: string; + /** address is the account address of the group member. */ + address?: string; +} +export interface EventLeaveGroupAminoMsg { + type: "cosmos-sdk/EventLeaveGroup"; + value: EventLeaveGroupAmino; +} +/** EventLeaveGroup is an event emitted when group member leaves the group. */ +export interface EventLeaveGroupSDKType { + group_id: bigint; + address: string; +} +/** EventProposalPruned is an event emitted when a proposal is pruned. */ +export interface EventProposalPruned { + /** proposal_id is the unique ID of the proposal. */ + proposalId: bigint; + /** status is the proposal status (UNSPECIFIED, SUBMITTED, ACCEPTED, REJECTED, ABORTED, WITHDRAWN). */ + status: ProposalStatus; + /** tally_result is the proposal tally result (when applicable). */ + tallyResult?: TallyResult; +} +export interface EventProposalPrunedProtoMsg { + typeUrl: "/cosmos.group.v1.EventProposalPruned"; + value: Uint8Array; +} +/** EventProposalPruned is an event emitted when a proposal is pruned. */ +export interface EventProposalPrunedAmino { + /** proposal_id is the unique ID of the proposal. */ + proposal_id?: string; + /** status is the proposal status (UNSPECIFIED, SUBMITTED, ACCEPTED, REJECTED, ABORTED, WITHDRAWN). */ + status?: ProposalStatus; + /** tally_result is the proposal tally result (when applicable). */ + tally_result?: TallyResultAmino; +} +export interface EventProposalPrunedAminoMsg { + type: "cosmos-sdk/EventProposalPruned"; + value: EventProposalPrunedAmino; +} +/** EventProposalPruned is an event emitted when a proposal is pruned. */ +export interface EventProposalPrunedSDKType { + proposal_id: bigint; + status: ProposalStatus; + tally_result?: TallyResultSDKType; +} +function createBaseEventCreateGroup(): EventCreateGroup { + return { + groupId: BigInt(0) + }; +} +export const EventCreateGroup = { + typeUrl: "/cosmos.group.v1.EventCreateGroup", + encode(message: EventCreateGroup, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { + writer.uint32(8).uint64(message.groupId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventCreateGroup { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventCreateGroup(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EventCreateGroup { + const message = createBaseEventCreateGroup(); + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EventCreateGroupAmino): EventCreateGroup { + const message = createBaseEventCreateGroup(); + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + return message; + }, + toAmino(message: EventCreateGroup): EventCreateGroupAmino { + const obj: any = {}; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EventCreateGroupAminoMsg): EventCreateGroup { + return EventCreateGroup.fromAmino(object.value); + }, + toAminoMsg(message: EventCreateGroup): EventCreateGroupAminoMsg { + return { + type: "cosmos-sdk/EventCreateGroup", + value: EventCreateGroup.toAmino(message) + }; + }, + fromProtoMsg(message: EventCreateGroupProtoMsg): EventCreateGroup { + return EventCreateGroup.decode(message.value); + }, + toProto(message: EventCreateGroup): Uint8Array { + return EventCreateGroup.encode(message).finish(); + }, + toProtoMsg(message: EventCreateGroup): EventCreateGroupProtoMsg { + return { + typeUrl: "/cosmos.group.v1.EventCreateGroup", + value: EventCreateGroup.encode(message).finish() + }; + } +}; +function createBaseEventUpdateGroup(): EventUpdateGroup { + return { + groupId: BigInt(0) + }; +} +export const EventUpdateGroup = { + typeUrl: "/cosmos.group.v1.EventUpdateGroup", + encode(message: EventUpdateGroup, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { + writer.uint32(8).uint64(message.groupId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventUpdateGroup { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventUpdateGroup(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EventUpdateGroup { + const message = createBaseEventUpdateGroup(); + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EventUpdateGroupAmino): EventUpdateGroup { + const message = createBaseEventUpdateGroup(); + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + return message; + }, + toAmino(message: EventUpdateGroup): EventUpdateGroupAmino { + const obj: any = {}; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EventUpdateGroupAminoMsg): EventUpdateGroup { + return EventUpdateGroup.fromAmino(object.value); + }, + toAminoMsg(message: EventUpdateGroup): EventUpdateGroupAminoMsg { + return { + type: "cosmos-sdk/EventUpdateGroup", + value: EventUpdateGroup.toAmino(message) + }; + }, + fromProtoMsg(message: EventUpdateGroupProtoMsg): EventUpdateGroup { + return EventUpdateGroup.decode(message.value); + }, + toProto(message: EventUpdateGroup): Uint8Array { + return EventUpdateGroup.encode(message).finish(); + }, + toProtoMsg(message: EventUpdateGroup): EventUpdateGroupProtoMsg { + return { + typeUrl: "/cosmos.group.v1.EventUpdateGroup", + value: EventUpdateGroup.encode(message).finish() + }; + } +}; +function createBaseEventCreateGroupPolicy(): EventCreateGroupPolicy { + return { + address: "" + }; +} +export const EventCreateGroupPolicy = { + typeUrl: "/cosmos.group.v1.EventCreateGroupPolicy", + encode(message: EventCreateGroupPolicy, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventCreateGroupPolicy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventCreateGroupPolicy(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EventCreateGroupPolicy { + const message = createBaseEventCreateGroupPolicy(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: EventCreateGroupPolicyAmino): EventCreateGroupPolicy { + const message = createBaseEventCreateGroupPolicy(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: EventCreateGroupPolicy): EventCreateGroupPolicyAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: EventCreateGroupPolicyAminoMsg): EventCreateGroupPolicy { + return EventCreateGroupPolicy.fromAmino(object.value); + }, + toAminoMsg(message: EventCreateGroupPolicy): EventCreateGroupPolicyAminoMsg { + return { + type: "cosmos-sdk/EventCreateGroupPolicy", + value: EventCreateGroupPolicy.toAmino(message) + }; + }, + fromProtoMsg(message: EventCreateGroupPolicyProtoMsg): EventCreateGroupPolicy { + return EventCreateGroupPolicy.decode(message.value); + }, + toProto(message: EventCreateGroupPolicy): Uint8Array { + return EventCreateGroupPolicy.encode(message).finish(); + }, + toProtoMsg(message: EventCreateGroupPolicy): EventCreateGroupPolicyProtoMsg { + return { + typeUrl: "/cosmos.group.v1.EventCreateGroupPolicy", + value: EventCreateGroupPolicy.encode(message).finish() + }; + } +}; +function createBaseEventUpdateGroupPolicy(): EventUpdateGroupPolicy { + return { + address: "" + }; +} +export const EventUpdateGroupPolicy = { + typeUrl: "/cosmos.group.v1.EventUpdateGroupPolicy", + encode(message: EventUpdateGroupPolicy, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventUpdateGroupPolicy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventUpdateGroupPolicy(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EventUpdateGroupPolicy { + const message = createBaseEventUpdateGroupPolicy(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: EventUpdateGroupPolicyAmino): EventUpdateGroupPolicy { + const message = createBaseEventUpdateGroupPolicy(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: EventUpdateGroupPolicy): EventUpdateGroupPolicyAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: EventUpdateGroupPolicyAminoMsg): EventUpdateGroupPolicy { + return EventUpdateGroupPolicy.fromAmino(object.value); + }, + toAminoMsg(message: EventUpdateGroupPolicy): EventUpdateGroupPolicyAminoMsg { + return { + type: "cosmos-sdk/EventUpdateGroupPolicy", + value: EventUpdateGroupPolicy.toAmino(message) + }; + }, + fromProtoMsg(message: EventUpdateGroupPolicyProtoMsg): EventUpdateGroupPolicy { + return EventUpdateGroupPolicy.decode(message.value); + }, + toProto(message: EventUpdateGroupPolicy): Uint8Array { + return EventUpdateGroupPolicy.encode(message).finish(); + }, + toProtoMsg(message: EventUpdateGroupPolicy): EventUpdateGroupPolicyProtoMsg { + return { + typeUrl: "/cosmos.group.v1.EventUpdateGroupPolicy", + value: EventUpdateGroupPolicy.encode(message).finish() + }; + } +}; +function createBaseEventSubmitProposal(): EventSubmitProposal { + return { + proposalId: BigInt(0) + }; +} +export const EventSubmitProposal = { + typeUrl: "/cosmos.group.v1.EventSubmitProposal", + encode(message: EventSubmitProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventSubmitProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventSubmitProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EventSubmitProposal { + const message = createBaseEventSubmitProposal(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EventSubmitProposalAmino): EventSubmitProposal { + const message = createBaseEventSubmitProposal(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; + }, + toAmino(message: EventSubmitProposal): EventSubmitProposalAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EventSubmitProposalAminoMsg): EventSubmitProposal { + return EventSubmitProposal.fromAmino(object.value); + }, + toAminoMsg(message: EventSubmitProposal): EventSubmitProposalAminoMsg { + return { + type: "cosmos-sdk/EventSubmitProposal", + value: EventSubmitProposal.toAmino(message) + }; + }, + fromProtoMsg(message: EventSubmitProposalProtoMsg): EventSubmitProposal { + return EventSubmitProposal.decode(message.value); + }, + toProto(message: EventSubmitProposal): Uint8Array { + return EventSubmitProposal.encode(message).finish(); + }, + toProtoMsg(message: EventSubmitProposal): EventSubmitProposalProtoMsg { + return { + typeUrl: "/cosmos.group.v1.EventSubmitProposal", + value: EventSubmitProposal.encode(message).finish() + }; + } +}; +function createBaseEventWithdrawProposal(): EventWithdrawProposal { + return { + proposalId: BigInt(0) + }; +} +export const EventWithdrawProposal = { + typeUrl: "/cosmos.group.v1.EventWithdrawProposal", + encode(message: EventWithdrawProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventWithdrawProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventWithdrawProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EventWithdrawProposal { + const message = createBaseEventWithdrawProposal(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EventWithdrawProposalAmino): EventWithdrawProposal { + const message = createBaseEventWithdrawProposal(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; + }, + toAmino(message: EventWithdrawProposal): EventWithdrawProposalAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EventWithdrawProposalAminoMsg): EventWithdrawProposal { + return EventWithdrawProposal.fromAmino(object.value); + }, + toAminoMsg(message: EventWithdrawProposal): EventWithdrawProposalAminoMsg { + return { + type: "cosmos-sdk/EventWithdrawProposal", + value: EventWithdrawProposal.toAmino(message) + }; + }, + fromProtoMsg(message: EventWithdrawProposalProtoMsg): EventWithdrawProposal { + return EventWithdrawProposal.decode(message.value); + }, + toProto(message: EventWithdrawProposal): Uint8Array { + return EventWithdrawProposal.encode(message).finish(); + }, + toProtoMsg(message: EventWithdrawProposal): EventWithdrawProposalProtoMsg { + return { + typeUrl: "/cosmos.group.v1.EventWithdrawProposal", + value: EventWithdrawProposal.encode(message).finish() + }; + } +}; +function createBaseEventVote(): EventVote { + return { + proposalId: BigInt(0) + }; +} +export const EventVote = { + typeUrl: "/cosmos.group.v1.EventVote", + encode(message: EventVote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventVote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventVote(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EventVote { + const message = createBaseEventVote(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: EventVoteAmino): EventVote { + const message = createBaseEventVote(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; + }, + toAmino(message: EventVote): EventVoteAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: EventVoteAminoMsg): EventVote { + return EventVote.fromAmino(object.value); + }, + toAminoMsg(message: EventVote): EventVoteAminoMsg { + return { + type: "cosmos-sdk/EventVote", + value: EventVote.toAmino(message) + }; + }, + fromProtoMsg(message: EventVoteProtoMsg): EventVote { + return EventVote.decode(message.value); + }, + toProto(message: EventVote): Uint8Array { + return EventVote.encode(message).finish(); + }, + toProtoMsg(message: EventVote): EventVoteProtoMsg { + return { + typeUrl: "/cosmos.group.v1.EventVote", + value: EventVote.encode(message).finish() + }; + } +}; +function createBaseEventExec(): EventExec { + return { + proposalId: BigInt(0), + result: 0, + logs: "" + }; +} +export const EventExec = { + typeUrl: "/cosmos.group.v1.EventExec", + encode(message: EventExec, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.result !== 0) { + writer.uint32(16).int32(message.result); + } + if (message.logs !== "") { + writer.uint32(26).string(message.logs); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventExec { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventExec(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.result = (reader.int32() as any); + break; + case 3: + message.logs = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EventExec { + const message = createBaseEventExec(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.result = object.result ?? 0; + message.logs = object.logs ?? ""; + return message; + }, + fromAmino(object: EventExecAmino): EventExec { + const message = createBaseEventExec(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.result !== undefined && object.result !== null) { + message.result = object.result; + } + if (object.logs !== undefined && object.logs !== null) { + message.logs = object.logs; + } + return message; + }, + toAmino(message: EventExec): EventExecAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.result = message.result === 0 ? undefined : message.result; + obj.logs = message.logs === "" ? undefined : message.logs; + return obj; + }, + fromAminoMsg(object: EventExecAminoMsg): EventExec { + return EventExec.fromAmino(object.value); + }, + toAminoMsg(message: EventExec): EventExecAminoMsg { + return { + type: "cosmos-sdk/EventExec", + value: EventExec.toAmino(message) + }; + }, + fromProtoMsg(message: EventExecProtoMsg): EventExec { + return EventExec.decode(message.value); + }, + toProto(message: EventExec): Uint8Array { + return EventExec.encode(message).finish(); + }, + toProtoMsg(message: EventExec): EventExecProtoMsg { + return { + typeUrl: "/cosmos.group.v1.EventExec", + value: EventExec.encode(message).finish() + }; + } +}; +function createBaseEventLeaveGroup(): EventLeaveGroup { + return { + groupId: BigInt(0), + address: "" + }; +} +export const EventLeaveGroup = { + typeUrl: "/cosmos.group.v1.EventLeaveGroup", + encode(message: EventLeaveGroup, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { + writer.uint32(8).uint64(message.groupId); + } + if (message.address !== "") { + writer.uint32(18).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventLeaveGroup { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventLeaveGroup(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupId = reader.uint64(); + break; + case 2: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EventLeaveGroup { + const message = createBaseEventLeaveGroup(); + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: EventLeaveGroupAmino): EventLeaveGroup { + const message = createBaseEventLeaveGroup(); + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: EventLeaveGroup): EventLeaveGroupAmino { + const obj: any = {}; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: EventLeaveGroupAminoMsg): EventLeaveGroup { + return EventLeaveGroup.fromAmino(object.value); + }, + toAminoMsg(message: EventLeaveGroup): EventLeaveGroupAminoMsg { + return { + type: "cosmos-sdk/EventLeaveGroup", + value: EventLeaveGroup.toAmino(message) + }; + }, + fromProtoMsg(message: EventLeaveGroupProtoMsg): EventLeaveGroup { + return EventLeaveGroup.decode(message.value); + }, + toProto(message: EventLeaveGroup): Uint8Array { + return EventLeaveGroup.encode(message).finish(); + }, + toProtoMsg(message: EventLeaveGroup): EventLeaveGroupProtoMsg { + return { + typeUrl: "/cosmos.group.v1.EventLeaveGroup", + value: EventLeaveGroup.encode(message).finish() + }; + } +}; +function createBaseEventProposalPruned(): EventProposalPruned { + return { + proposalId: BigInt(0), + status: 0, + tallyResult: undefined + }; +} +export const EventProposalPruned = { + typeUrl: "/cosmos.group.v1.EventProposalPruned", + encode(message: EventProposalPruned, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.status !== 0) { + writer.uint32(16).int32(message.status); + } + if (message.tallyResult !== undefined) { + TallyResult.encode(message.tallyResult, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventProposalPruned { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventProposalPruned(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.status = (reader.int32() as any); + break; + case 3: + message.tallyResult = TallyResult.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EventProposalPruned { + const message = createBaseEventProposalPruned(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.status = object.status ?? 0; + message.tallyResult = object.tallyResult !== undefined && object.tallyResult !== null ? TallyResult.fromPartial(object.tallyResult) : undefined; + return message; + }, + fromAmino(object: EventProposalPrunedAmino): EventProposalPruned { + const message = createBaseEventProposalPruned(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.tally_result !== undefined && object.tally_result !== null) { + message.tallyResult = TallyResult.fromAmino(object.tally_result); + } + return message; + }, + toAmino(message: EventProposalPruned): EventProposalPrunedAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.status = message.status === 0 ? undefined : message.status; + obj.tally_result = message.tallyResult ? TallyResult.toAmino(message.tallyResult) : undefined; + return obj; + }, + fromAminoMsg(object: EventProposalPrunedAminoMsg): EventProposalPruned { + return EventProposalPruned.fromAmino(object.value); + }, + toAminoMsg(message: EventProposalPruned): EventProposalPrunedAminoMsg { + return { + type: "cosmos-sdk/EventProposalPruned", + value: EventProposalPruned.toAmino(message) + }; + }, + fromProtoMsg(message: EventProposalPrunedProtoMsg): EventProposalPruned { + return EventProposalPruned.decode(message.value); + }, + toProto(message: EventProposalPruned): Uint8Array { + return EventProposalPruned.encode(message).finish(); + }, + toProtoMsg(message: EventProposalPruned): EventProposalPrunedProtoMsg { + return { + typeUrl: "/cosmos.group.v1.EventProposalPruned", + value: EventProposalPruned.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/group/v1/genesis.ts b/src/codegen/cosmos/group/v1/genesis.ts new file mode 100644 index 0000000..4089a1b --- /dev/null +++ b/src/codegen/cosmos/group/v1/genesis.ts @@ -0,0 +1,240 @@ +import { GroupInfo, GroupInfoAmino, GroupInfoSDKType, GroupMember, GroupMemberAmino, GroupMemberSDKType, GroupPolicyInfo, GroupPolicyInfoAmino, GroupPolicyInfoSDKType, Proposal, ProposalAmino, ProposalSDKType, Vote, VoteAmino, VoteSDKType } from "./types"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** GenesisState defines the group module's genesis state. */ +export interface GenesisState { + /** + * group_seq is the group table orm.Sequence, + * it is used to get the next group ID. + */ + groupSeq: bigint; + /** groups is the list of groups info. */ + groups: GroupInfo[]; + /** group_members is the list of groups members. */ + groupMembers: GroupMember[]; + /** + * group_policy_seq is the group policy table orm.Sequence, + * it is used to generate the next group policy account address. + */ + groupPolicySeq: bigint; + /** group_policies is the list of group policies info. */ + groupPolicies: GroupPolicyInfo[]; + /** + * proposal_seq is the proposal table orm.Sequence, + * it is used to get the next proposal ID. + */ + proposalSeq: bigint; + /** proposals is the list of proposals. */ + proposals: Proposal[]; + /** votes is the list of votes. */ + votes: Vote[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmos.group.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the group module's genesis state. */ +export interface GenesisStateAmino { + /** + * group_seq is the group table orm.Sequence, + * it is used to get the next group ID. + */ + group_seq?: string; + /** groups is the list of groups info. */ + groups?: GroupInfoAmino[]; + /** group_members is the list of groups members. */ + group_members?: GroupMemberAmino[]; + /** + * group_policy_seq is the group policy table orm.Sequence, + * it is used to generate the next group policy account address. + */ + group_policy_seq?: string; + /** group_policies is the list of group policies info. */ + group_policies?: GroupPolicyInfoAmino[]; + /** + * proposal_seq is the proposal table orm.Sequence, + * it is used to get the next proposal ID. + */ + proposal_seq?: string; + /** proposals is the list of proposals. */ + proposals?: ProposalAmino[]; + /** votes is the list of votes. */ + votes?: VoteAmino[]; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the group module's genesis state. */ +export interface GenesisStateSDKType { + group_seq: bigint; + groups: GroupInfoSDKType[]; + group_members: GroupMemberSDKType[]; + group_policy_seq: bigint; + group_policies: GroupPolicyInfoSDKType[]; + proposal_seq: bigint; + proposals: ProposalSDKType[]; + votes: VoteSDKType[]; +} +function createBaseGenesisState(): GenesisState { + return { + groupSeq: BigInt(0), + groups: [], + groupMembers: [], + groupPolicySeq: BigInt(0), + groupPolicies: [], + proposalSeq: BigInt(0), + proposals: [], + votes: [] + }; +} +export const GenesisState = { + typeUrl: "/cosmos.group.v1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupSeq !== BigInt(0)) { + writer.uint32(8).uint64(message.groupSeq); + } + for (const v of message.groups) { + GroupInfo.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.groupMembers) { + GroupMember.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.groupPolicySeq !== BigInt(0)) { + writer.uint32(32).uint64(message.groupPolicySeq); + } + for (const v of message.groupPolicies) { + GroupPolicyInfo.encode(v!, writer.uint32(42).fork()).ldelim(); + } + if (message.proposalSeq !== BigInt(0)) { + writer.uint32(48).uint64(message.proposalSeq); + } + for (const v of message.proposals) { + Proposal.encode(v!, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.votes) { + Vote.encode(v!, writer.uint32(66).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupSeq = reader.uint64(); + break; + case 2: + message.groups.push(GroupInfo.decode(reader, reader.uint32())); + break; + case 3: + message.groupMembers.push(GroupMember.decode(reader, reader.uint32())); + break; + case 4: + message.groupPolicySeq = reader.uint64(); + break; + case 5: + message.groupPolicies.push(GroupPolicyInfo.decode(reader, reader.uint32())); + break; + case 6: + message.proposalSeq = reader.uint64(); + break; + case 7: + message.proposals.push(Proposal.decode(reader, reader.uint32())); + break; + case 8: + message.votes.push(Vote.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.groupSeq = object.groupSeq !== undefined && object.groupSeq !== null ? BigInt(object.groupSeq.toString()) : BigInt(0); + message.groups = object.groups?.map(e => GroupInfo.fromPartial(e)) || []; + message.groupMembers = object.groupMembers?.map(e => GroupMember.fromPartial(e)) || []; + message.groupPolicySeq = object.groupPolicySeq !== undefined && object.groupPolicySeq !== null ? BigInt(object.groupPolicySeq.toString()) : BigInt(0); + message.groupPolicies = object.groupPolicies?.map(e => GroupPolicyInfo.fromPartial(e)) || []; + message.proposalSeq = object.proposalSeq !== undefined && object.proposalSeq !== null ? BigInt(object.proposalSeq.toString()) : BigInt(0); + message.proposals = object.proposals?.map(e => Proposal.fromPartial(e)) || []; + message.votes = object.votes?.map(e => Vote.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.group_seq !== undefined && object.group_seq !== null) { + message.groupSeq = BigInt(object.group_seq); + } + message.groups = object.groups?.map(e => GroupInfo.fromAmino(e)) || []; + message.groupMembers = object.group_members?.map(e => GroupMember.fromAmino(e)) || []; + if (object.group_policy_seq !== undefined && object.group_policy_seq !== null) { + message.groupPolicySeq = BigInt(object.group_policy_seq); + } + message.groupPolicies = object.group_policies?.map(e => GroupPolicyInfo.fromAmino(e)) || []; + if (object.proposal_seq !== undefined && object.proposal_seq !== null) { + message.proposalSeq = BigInt(object.proposal_seq); + } + message.proposals = object.proposals?.map(e => Proposal.fromAmino(e)) || []; + message.votes = object.votes?.map(e => Vote.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.group_seq = message.groupSeq !== BigInt(0) ? message.groupSeq.toString() : undefined; + if (message.groups) { + obj.groups = message.groups.map(e => e ? GroupInfo.toAmino(e) : undefined); + } else { + obj.groups = message.groups; + } + if (message.groupMembers) { + obj.group_members = message.groupMembers.map(e => e ? GroupMember.toAmino(e) : undefined); + } else { + obj.group_members = message.groupMembers; + } + obj.group_policy_seq = message.groupPolicySeq !== BigInt(0) ? message.groupPolicySeq.toString() : undefined; + if (message.groupPolicies) { + obj.group_policies = message.groupPolicies.map(e => e ? GroupPolicyInfo.toAmino(e) : undefined); + } else { + obj.group_policies = message.groupPolicies; + } + obj.proposal_seq = message.proposalSeq !== BigInt(0) ? message.proposalSeq.toString() : undefined; + if (message.proposals) { + obj.proposals = message.proposals.map(e => e ? Proposal.toAmino(e) : undefined); + } else { + obj.proposals = message.proposals; + } + if (message.votes) { + obj.votes = message.votes.map(e => e ? Vote.toAmino(e) : undefined); + } else { + obj.votes = message.votes; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: "cosmos-sdk/GenesisState", + value: GenesisState.toAmino(message) + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/cosmos.group.v1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/group/v1/query.lcd.ts b/src/codegen/cosmos/group/v1/query.lcd.ts new file mode 100644 index 0000000..ffda1dc --- /dev/null +++ b/src/codegen/cosmos/group/v1/query.lcd.ts @@ -0,0 +1,159 @@ +import { setPaginationParams } from "../../../helpers"; +import { LCDClient } from "@cosmology/lcd"; +import { QueryGroupInfoRequest, QueryGroupInfoResponseSDKType, QueryGroupPolicyInfoRequest, QueryGroupPolicyInfoResponseSDKType, QueryGroupMembersRequest, QueryGroupMembersResponseSDKType, QueryGroupsByAdminRequest, QueryGroupsByAdminResponseSDKType, QueryGroupPoliciesByGroupRequest, QueryGroupPoliciesByGroupResponseSDKType, QueryGroupPoliciesByAdminRequest, QueryGroupPoliciesByAdminResponseSDKType, QueryProposalRequest, QueryProposalResponseSDKType, QueryProposalsByGroupPolicyRequest, QueryProposalsByGroupPolicyResponseSDKType, QueryVoteByProposalVoterRequest, QueryVoteByProposalVoterResponseSDKType, QueryVotesByProposalRequest, QueryVotesByProposalResponseSDKType, QueryVotesByVoterRequest, QueryVotesByVoterResponseSDKType, QueryGroupsByMemberRequest, QueryGroupsByMemberResponseSDKType, QueryTallyResultRequest, QueryTallyResultResponseSDKType, QueryGroupsRequest, QueryGroupsResponseSDKType } from "./query"; +export class LCDQueryClient { + req: LCDClient; + constructor({ + requestClient + }: { + requestClient: LCDClient; + }) { + this.req = requestClient; + this.groupInfo = this.groupInfo.bind(this); + this.groupPolicyInfo = this.groupPolicyInfo.bind(this); + this.groupMembers = this.groupMembers.bind(this); + this.groupsByAdmin = this.groupsByAdmin.bind(this); + this.groupPoliciesByGroup = this.groupPoliciesByGroup.bind(this); + this.groupPoliciesByAdmin = this.groupPoliciesByAdmin.bind(this); + this.proposal = this.proposal.bind(this); + this.proposalsByGroupPolicy = this.proposalsByGroupPolicy.bind(this); + this.voteByProposalVoter = this.voteByProposalVoter.bind(this); + this.votesByProposal = this.votesByProposal.bind(this); + this.votesByVoter = this.votesByVoter.bind(this); + this.groupsByMember = this.groupsByMember.bind(this); + this.tallyResult = this.tallyResult.bind(this); + this.groups = this.groups.bind(this); + } + /* GroupInfo queries group info based on group id. */ + async groupInfo(params: QueryGroupInfoRequest): Promise { + const endpoint = `cosmos/group/v1/group_info/${params.groupId}`; + return await this.req.get(endpoint); + } + /* GroupPolicyInfo queries group policy info based on account address of group policy. */ + async groupPolicyInfo(params: QueryGroupPolicyInfoRequest): Promise { + const endpoint = `cosmos/group/v1/group_policy_info/${params.address}`; + return await this.req.get(endpoint); + } + /* GroupMembers queries members of a group by group id. */ + async groupMembers(params: QueryGroupMembersRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + const endpoint = `cosmos/group/v1/group_members/${params.groupId}`; + return await this.req.get(endpoint, options); + } + /* GroupsByAdmin queries groups by admin address. */ + async groupsByAdmin(params: QueryGroupsByAdminRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + const endpoint = `cosmos/group/v1/groups_by_admin/${params.admin}`; + return await this.req.get(endpoint, options); + } + /* GroupPoliciesByGroup queries group policies by group id. */ + async groupPoliciesByGroup(params: QueryGroupPoliciesByGroupRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + const endpoint = `cosmos/group/v1/group_policies_by_group/${params.groupId}`; + return await this.req.get(endpoint, options); + } + /* GroupPoliciesByAdmin queries group policies by admin address. */ + async groupPoliciesByAdmin(params: QueryGroupPoliciesByAdminRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + const endpoint = `cosmos/group/v1/group_policies_by_admin/${params.admin}`; + return await this.req.get(endpoint, options); + } + /* Proposal queries a proposal based on proposal id. */ + async proposal(params: QueryProposalRequest): Promise { + const endpoint = `cosmos/group/v1/proposal/${params.proposalId}`; + return await this.req.get(endpoint); + } + /* ProposalsByGroupPolicy queries proposals based on account address of group policy. */ + async proposalsByGroupPolicy(params: QueryProposalsByGroupPolicyRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + const endpoint = `cosmos/group/v1/proposals_by_group_policy/${params.address}`; + return await this.req.get(endpoint, options); + } + /* VoteByProposalVoter queries a vote by proposal id and voter. */ + async voteByProposalVoter(params: QueryVoteByProposalVoterRequest): Promise { + const endpoint = `cosmos/group/v1/vote_by_proposal_voter/${params.proposalId}/${params.voter}`; + return await this.req.get(endpoint); + } + /* VotesByProposal queries a vote by proposal id. */ + async votesByProposal(params: QueryVotesByProposalRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + const endpoint = `cosmos/group/v1/votes_by_proposal/${params.proposalId}`; + return await this.req.get(endpoint, options); + } + /* VotesByVoter queries a vote by voter. */ + async votesByVoter(params: QueryVotesByVoterRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + const endpoint = `cosmos/group/v1/votes_by_voter/${params.voter}`; + return await this.req.get(endpoint, options); + } + /* GroupsByMember queries groups by member address. */ + async groupsByMember(params: QueryGroupsByMemberRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + const endpoint = `cosmos/group/v1/groups_by_member/${params.address}`; + return await this.req.get(endpoint, options); + } + /* TallyResult returns the tally result of a proposal. If the proposal is + still in voting period, then this query computes the current tally state, + which might not be final. On the other hand, if the proposal is final, + then it simply returns the `final_tally_result` state stored in the + proposal itself. */ + async tallyResult(params: QueryTallyResultRequest): Promise { + const endpoint = `cosmos/group/v1/proposals/${params.proposalId}/tally`; + return await this.req.get(endpoint); + } + /* Groups queries all groups in state. + + Since: cosmos-sdk 0.47.1 */ + async groups(params: QueryGroupsRequest = { + pagination: undefined + }): Promise { + const options: any = { + params: {} + }; + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + const endpoint = `cosmos/group/v1/groups`; + return await this.req.get(endpoint, options); + } +} \ No newline at end of file diff --git a/src/codegen/cosmos/group/v1/query.rpc.Query.ts b/src/codegen/cosmos/group/v1/query.rpc.Query.ts new file mode 100644 index 0000000..34121b2 --- /dev/null +++ b/src/codegen/cosmos/group/v1/query.rpc.Query.ts @@ -0,0 +1,185 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryGroupInfoRequest, QueryGroupInfoResponse, QueryGroupPolicyInfoRequest, QueryGroupPolicyInfoResponse, QueryGroupMembersRequest, QueryGroupMembersResponse, QueryGroupsByAdminRequest, QueryGroupsByAdminResponse, QueryGroupPoliciesByGroupRequest, QueryGroupPoliciesByGroupResponse, QueryGroupPoliciesByAdminRequest, QueryGroupPoliciesByAdminResponse, QueryProposalRequest, QueryProposalResponse, QueryProposalsByGroupPolicyRequest, QueryProposalsByGroupPolicyResponse, QueryVoteByProposalVoterRequest, QueryVoteByProposalVoterResponse, QueryVotesByProposalRequest, QueryVotesByProposalResponse, QueryVotesByVoterRequest, QueryVotesByVoterResponse, QueryGroupsByMemberRequest, QueryGroupsByMemberResponse, QueryTallyResultRequest, QueryTallyResultResponse, QueryGroupsRequest, QueryGroupsResponse } from "./query"; +/** Query is the cosmos.group.v1 Query service. */ +export interface Query { + /** GroupInfo queries group info based on group id. */ + groupInfo(request: QueryGroupInfoRequest): Promise; + /** GroupPolicyInfo queries group policy info based on account address of group policy. */ + groupPolicyInfo(request: QueryGroupPolicyInfoRequest): Promise; + /** GroupMembers queries members of a group by group id. */ + groupMembers(request: QueryGroupMembersRequest): Promise; + /** GroupsByAdmin queries groups by admin address. */ + groupsByAdmin(request: QueryGroupsByAdminRequest): Promise; + /** GroupPoliciesByGroup queries group policies by group id. */ + groupPoliciesByGroup(request: QueryGroupPoliciesByGroupRequest): Promise; + /** GroupPoliciesByAdmin queries group policies by admin address. */ + groupPoliciesByAdmin(request: QueryGroupPoliciesByAdminRequest): Promise; + /** Proposal queries a proposal based on proposal id. */ + proposal(request: QueryProposalRequest): Promise; + /** ProposalsByGroupPolicy queries proposals based on account address of group policy. */ + proposalsByGroupPolicy(request: QueryProposalsByGroupPolicyRequest): Promise; + /** VoteByProposalVoter queries a vote by proposal id and voter. */ + voteByProposalVoter(request: QueryVoteByProposalVoterRequest): Promise; + /** VotesByProposal queries a vote by proposal id. */ + votesByProposal(request: QueryVotesByProposalRequest): Promise; + /** VotesByVoter queries a vote by voter. */ + votesByVoter(request: QueryVotesByVoterRequest): Promise; + /** GroupsByMember queries groups by member address. */ + groupsByMember(request: QueryGroupsByMemberRequest): Promise; + /** + * TallyResult returns the tally result of a proposal. If the proposal is + * still in voting period, then this query computes the current tally state, + * which might not be final. On the other hand, if the proposal is final, + * then it simply returns the `final_tally_result` state stored in the + * proposal itself. + */ + tallyResult(request: QueryTallyResultRequest): Promise; + /** + * Groups queries all groups in state. + * + * Since: cosmos-sdk 0.47.1 + */ + groups(request?: QueryGroupsRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.groupInfo = this.groupInfo.bind(this); + this.groupPolicyInfo = this.groupPolicyInfo.bind(this); + this.groupMembers = this.groupMembers.bind(this); + this.groupsByAdmin = this.groupsByAdmin.bind(this); + this.groupPoliciesByGroup = this.groupPoliciesByGroup.bind(this); + this.groupPoliciesByAdmin = this.groupPoliciesByAdmin.bind(this); + this.proposal = this.proposal.bind(this); + this.proposalsByGroupPolicy = this.proposalsByGroupPolicy.bind(this); + this.voteByProposalVoter = this.voteByProposalVoter.bind(this); + this.votesByProposal = this.votesByProposal.bind(this); + this.votesByVoter = this.votesByVoter.bind(this); + this.groupsByMember = this.groupsByMember.bind(this); + this.tallyResult = this.tallyResult.bind(this); + this.groups = this.groups.bind(this); + } + groupInfo(request: QueryGroupInfoRequest): Promise { + const data = QueryGroupInfoRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Query", "GroupInfo", data); + return promise.then(data => QueryGroupInfoResponse.decode(new BinaryReader(data))); + } + groupPolicyInfo(request: QueryGroupPolicyInfoRequest): Promise { + const data = QueryGroupPolicyInfoRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Query", "GroupPolicyInfo", data); + return promise.then(data => QueryGroupPolicyInfoResponse.decode(new BinaryReader(data))); + } + groupMembers(request: QueryGroupMembersRequest): Promise { + const data = QueryGroupMembersRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Query", "GroupMembers", data); + return promise.then(data => QueryGroupMembersResponse.decode(new BinaryReader(data))); + } + groupsByAdmin(request: QueryGroupsByAdminRequest): Promise { + const data = QueryGroupsByAdminRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Query", "GroupsByAdmin", data); + return promise.then(data => QueryGroupsByAdminResponse.decode(new BinaryReader(data))); + } + groupPoliciesByGroup(request: QueryGroupPoliciesByGroupRequest): Promise { + const data = QueryGroupPoliciesByGroupRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Query", "GroupPoliciesByGroup", data); + return promise.then(data => QueryGroupPoliciesByGroupResponse.decode(new BinaryReader(data))); + } + groupPoliciesByAdmin(request: QueryGroupPoliciesByAdminRequest): Promise { + const data = QueryGroupPoliciesByAdminRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Query", "GroupPoliciesByAdmin", data); + return promise.then(data => QueryGroupPoliciesByAdminResponse.decode(new BinaryReader(data))); + } + proposal(request: QueryProposalRequest): Promise { + const data = QueryProposalRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Query", "Proposal", data); + return promise.then(data => QueryProposalResponse.decode(new BinaryReader(data))); + } + proposalsByGroupPolicy(request: QueryProposalsByGroupPolicyRequest): Promise { + const data = QueryProposalsByGroupPolicyRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Query", "ProposalsByGroupPolicy", data); + return promise.then(data => QueryProposalsByGroupPolicyResponse.decode(new BinaryReader(data))); + } + voteByProposalVoter(request: QueryVoteByProposalVoterRequest): Promise { + const data = QueryVoteByProposalVoterRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Query", "VoteByProposalVoter", data); + return promise.then(data => QueryVoteByProposalVoterResponse.decode(new BinaryReader(data))); + } + votesByProposal(request: QueryVotesByProposalRequest): Promise { + const data = QueryVotesByProposalRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Query", "VotesByProposal", data); + return promise.then(data => QueryVotesByProposalResponse.decode(new BinaryReader(data))); + } + votesByVoter(request: QueryVotesByVoterRequest): Promise { + const data = QueryVotesByVoterRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Query", "VotesByVoter", data); + return promise.then(data => QueryVotesByVoterResponse.decode(new BinaryReader(data))); + } + groupsByMember(request: QueryGroupsByMemberRequest): Promise { + const data = QueryGroupsByMemberRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Query", "GroupsByMember", data); + return promise.then(data => QueryGroupsByMemberResponse.decode(new BinaryReader(data))); + } + tallyResult(request: QueryTallyResultRequest): Promise { + const data = QueryTallyResultRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Query", "TallyResult", data); + return promise.then(data => QueryTallyResultResponse.decode(new BinaryReader(data))); + } + groups(request: QueryGroupsRequest = { + pagination: undefined + }): Promise { + const data = QueryGroupsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Query", "Groups", data); + return promise.then(data => QueryGroupsResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + groupInfo(request: QueryGroupInfoRequest): Promise { + return queryService.groupInfo(request); + }, + groupPolicyInfo(request: QueryGroupPolicyInfoRequest): Promise { + return queryService.groupPolicyInfo(request); + }, + groupMembers(request: QueryGroupMembersRequest): Promise { + return queryService.groupMembers(request); + }, + groupsByAdmin(request: QueryGroupsByAdminRequest): Promise { + return queryService.groupsByAdmin(request); + }, + groupPoliciesByGroup(request: QueryGroupPoliciesByGroupRequest): Promise { + return queryService.groupPoliciesByGroup(request); + }, + groupPoliciesByAdmin(request: QueryGroupPoliciesByAdminRequest): Promise { + return queryService.groupPoliciesByAdmin(request); + }, + proposal(request: QueryProposalRequest): Promise { + return queryService.proposal(request); + }, + proposalsByGroupPolicy(request: QueryProposalsByGroupPolicyRequest): Promise { + return queryService.proposalsByGroupPolicy(request); + }, + voteByProposalVoter(request: QueryVoteByProposalVoterRequest): Promise { + return queryService.voteByProposalVoter(request); + }, + votesByProposal(request: QueryVotesByProposalRequest): Promise { + return queryService.votesByProposal(request); + }, + votesByVoter(request: QueryVotesByVoterRequest): Promise { + return queryService.votesByVoter(request); + }, + groupsByMember(request: QueryGroupsByMemberRequest): Promise { + return queryService.groupsByMember(request); + }, + tallyResult(request: QueryTallyResultRequest): Promise { + return queryService.tallyResult(request); + }, + groups(request?: QueryGroupsRequest): Promise { + return queryService.groups(request); + } + }; +}; \ No newline at end of file diff --git a/src/codegen/cosmos/group/v1/query.ts b/src/codegen/cosmos/group/v1/query.ts new file mode 100644 index 0000000..f2f5e40 --- /dev/null +++ b/src/codegen/cosmos/group/v1/query.ts @@ -0,0 +1,2899 @@ +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; +import { GroupInfo, GroupInfoAmino, GroupInfoSDKType, GroupPolicyInfo, GroupPolicyInfoAmino, GroupPolicyInfoSDKType, GroupMember, GroupMemberAmino, GroupMemberSDKType, Proposal, ProposalAmino, ProposalSDKType, Vote, VoteAmino, VoteSDKType, TallyResult, TallyResultAmino, TallyResultSDKType } from "./types"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** QueryGroupInfoRequest is the Query/GroupInfo request type. */ +export interface QueryGroupInfoRequest { + /** group_id is the unique ID of the group. */ + groupId: bigint; +} +export interface QueryGroupInfoRequestProtoMsg { + typeUrl: "/cosmos.group.v1.QueryGroupInfoRequest"; + value: Uint8Array; +} +/** QueryGroupInfoRequest is the Query/GroupInfo request type. */ +export interface QueryGroupInfoRequestAmino { + /** group_id is the unique ID of the group. */ + group_id?: string; +} +export interface QueryGroupInfoRequestAminoMsg { + type: "cosmos-sdk/QueryGroupInfoRequest"; + value: QueryGroupInfoRequestAmino; +} +/** QueryGroupInfoRequest is the Query/GroupInfo request type. */ +export interface QueryGroupInfoRequestSDKType { + group_id: bigint; +} +/** QueryGroupInfoResponse is the Query/GroupInfo response type. */ +export interface QueryGroupInfoResponse { + /** info is the GroupInfo of the group. */ + info?: GroupInfo; +} +export interface QueryGroupInfoResponseProtoMsg { + typeUrl: "/cosmos.group.v1.QueryGroupInfoResponse"; + value: Uint8Array; +} +/** QueryGroupInfoResponse is the Query/GroupInfo response type. */ +export interface QueryGroupInfoResponseAmino { + /** info is the GroupInfo of the group. */ + info?: GroupInfoAmino; +} +export interface QueryGroupInfoResponseAminoMsg { + type: "cosmos-sdk/QueryGroupInfoResponse"; + value: QueryGroupInfoResponseAmino; +} +/** QueryGroupInfoResponse is the Query/GroupInfo response type. */ +export interface QueryGroupInfoResponseSDKType { + info?: GroupInfoSDKType; +} +/** QueryGroupPolicyInfoRequest is the Query/GroupPolicyInfo request type. */ +export interface QueryGroupPolicyInfoRequest { + /** address is the account address of the group policy. */ + address: string; +} +export interface QueryGroupPolicyInfoRequestProtoMsg { + typeUrl: "/cosmos.group.v1.QueryGroupPolicyInfoRequest"; + value: Uint8Array; +} +/** QueryGroupPolicyInfoRequest is the Query/GroupPolicyInfo request type. */ +export interface QueryGroupPolicyInfoRequestAmino { + /** address is the account address of the group policy. */ + address?: string; +} +export interface QueryGroupPolicyInfoRequestAminoMsg { + type: "cosmos-sdk/QueryGroupPolicyInfoRequest"; + value: QueryGroupPolicyInfoRequestAmino; +} +/** QueryGroupPolicyInfoRequest is the Query/GroupPolicyInfo request type. */ +export interface QueryGroupPolicyInfoRequestSDKType { + address: string; +} +/** QueryGroupPolicyInfoResponse is the Query/GroupPolicyInfo response type. */ +export interface QueryGroupPolicyInfoResponse { + /** info is the GroupPolicyInfo of the group policy. */ + info?: GroupPolicyInfo; +} +export interface QueryGroupPolicyInfoResponseProtoMsg { + typeUrl: "/cosmos.group.v1.QueryGroupPolicyInfoResponse"; + value: Uint8Array; +} +/** QueryGroupPolicyInfoResponse is the Query/GroupPolicyInfo response type. */ +export interface QueryGroupPolicyInfoResponseAmino { + /** info is the GroupPolicyInfo of the group policy. */ + info?: GroupPolicyInfoAmino; +} +export interface QueryGroupPolicyInfoResponseAminoMsg { + type: "cosmos-sdk/QueryGroupPolicyInfoResponse"; + value: QueryGroupPolicyInfoResponseAmino; +} +/** QueryGroupPolicyInfoResponse is the Query/GroupPolicyInfo response type. */ +export interface QueryGroupPolicyInfoResponseSDKType { + info?: GroupPolicyInfoSDKType; +} +/** QueryGroupMembersRequest is the Query/GroupMembers request type. */ +export interface QueryGroupMembersRequest { + /** group_id is the unique ID of the group. */ + groupId: bigint; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryGroupMembersRequestProtoMsg { + typeUrl: "/cosmos.group.v1.QueryGroupMembersRequest"; + value: Uint8Array; +} +/** QueryGroupMembersRequest is the Query/GroupMembers request type. */ +export interface QueryGroupMembersRequestAmino { + /** group_id is the unique ID of the group. */ + group_id?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryGroupMembersRequestAminoMsg { + type: "cosmos-sdk/QueryGroupMembersRequest"; + value: QueryGroupMembersRequestAmino; +} +/** QueryGroupMembersRequest is the Query/GroupMembers request type. */ +export interface QueryGroupMembersRequestSDKType { + group_id: bigint; + pagination?: PageRequestSDKType; +} +/** QueryGroupMembersResponse is the Query/GroupMembersResponse response type. */ +export interface QueryGroupMembersResponse { + /** members are the members of the group with given group_id. */ + members: GroupMember[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryGroupMembersResponseProtoMsg { + typeUrl: "/cosmos.group.v1.QueryGroupMembersResponse"; + value: Uint8Array; +} +/** QueryGroupMembersResponse is the Query/GroupMembersResponse response type. */ +export interface QueryGroupMembersResponseAmino { + /** members are the members of the group with given group_id. */ + members?: GroupMemberAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryGroupMembersResponseAminoMsg { + type: "cosmos-sdk/QueryGroupMembersResponse"; + value: QueryGroupMembersResponseAmino; +} +/** QueryGroupMembersResponse is the Query/GroupMembersResponse response type. */ +export interface QueryGroupMembersResponseSDKType { + members: GroupMemberSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryGroupsByAdminRequest is the Query/GroupsByAdmin request type. */ +export interface QueryGroupsByAdminRequest { + /** admin is the account address of a group's admin. */ + admin: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryGroupsByAdminRequestProtoMsg { + typeUrl: "/cosmos.group.v1.QueryGroupsByAdminRequest"; + value: Uint8Array; +} +/** QueryGroupsByAdminRequest is the Query/GroupsByAdmin request type. */ +export interface QueryGroupsByAdminRequestAmino { + /** admin is the account address of a group's admin. */ + admin?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryGroupsByAdminRequestAminoMsg { + type: "cosmos-sdk/QueryGroupsByAdminRequest"; + value: QueryGroupsByAdminRequestAmino; +} +/** QueryGroupsByAdminRequest is the Query/GroupsByAdmin request type. */ +export interface QueryGroupsByAdminRequestSDKType { + admin: string; + pagination?: PageRequestSDKType; +} +/** QueryGroupsByAdminResponse is the Query/GroupsByAdminResponse response type. */ +export interface QueryGroupsByAdminResponse { + /** groups are the groups info with the provided admin. */ + groups: GroupInfo[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryGroupsByAdminResponseProtoMsg { + typeUrl: "/cosmos.group.v1.QueryGroupsByAdminResponse"; + value: Uint8Array; +} +/** QueryGroupsByAdminResponse is the Query/GroupsByAdminResponse response type. */ +export interface QueryGroupsByAdminResponseAmino { + /** groups are the groups info with the provided admin. */ + groups?: GroupInfoAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryGroupsByAdminResponseAminoMsg { + type: "cosmos-sdk/QueryGroupsByAdminResponse"; + value: QueryGroupsByAdminResponseAmino; +} +/** QueryGroupsByAdminResponse is the Query/GroupsByAdminResponse response type. */ +export interface QueryGroupsByAdminResponseSDKType { + groups: GroupInfoSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryGroupPoliciesByGroupRequest is the Query/GroupPoliciesByGroup request type. */ +export interface QueryGroupPoliciesByGroupRequest { + /** group_id is the unique ID of the group policy's group. */ + groupId: bigint; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryGroupPoliciesByGroupRequestProtoMsg { + typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByGroupRequest"; + value: Uint8Array; +} +/** QueryGroupPoliciesByGroupRequest is the Query/GroupPoliciesByGroup request type. */ +export interface QueryGroupPoliciesByGroupRequestAmino { + /** group_id is the unique ID of the group policy's group. */ + group_id?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryGroupPoliciesByGroupRequestAminoMsg { + type: "cosmos-sdk/QueryGroupPoliciesByGroupRequest"; + value: QueryGroupPoliciesByGroupRequestAmino; +} +/** QueryGroupPoliciesByGroupRequest is the Query/GroupPoliciesByGroup request type. */ +export interface QueryGroupPoliciesByGroupRequestSDKType { + group_id: bigint; + pagination?: PageRequestSDKType; +} +/** QueryGroupPoliciesByGroupResponse is the Query/GroupPoliciesByGroup response type. */ +export interface QueryGroupPoliciesByGroupResponse { + /** group_policies are the group policies info associated with the provided group. */ + groupPolicies: GroupPolicyInfo[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryGroupPoliciesByGroupResponseProtoMsg { + typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByGroupResponse"; + value: Uint8Array; +} +/** QueryGroupPoliciesByGroupResponse is the Query/GroupPoliciesByGroup response type. */ +export interface QueryGroupPoliciesByGroupResponseAmino { + /** group_policies are the group policies info associated with the provided group. */ + group_policies?: GroupPolicyInfoAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryGroupPoliciesByGroupResponseAminoMsg { + type: "cosmos-sdk/QueryGroupPoliciesByGroupResponse"; + value: QueryGroupPoliciesByGroupResponseAmino; +} +/** QueryGroupPoliciesByGroupResponse is the Query/GroupPoliciesByGroup response type. */ +export interface QueryGroupPoliciesByGroupResponseSDKType { + group_policies: GroupPolicyInfoSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryGroupPoliciesByAdminRequest is the Query/GroupPoliciesByAdmin request type. */ +export interface QueryGroupPoliciesByAdminRequest { + /** admin is the admin address of the group policy. */ + admin: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryGroupPoliciesByAdminRequestProtoMsg { + typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByAdminRequest"; + value: Uint8Array; +} +/** QueryGroupPoliciesByAdminRequest is the Query/GroupPoliciesByAdmin request type. */ +export interface QueryGroupPoliciesByAdminRequestAmino { + /** admin is the admin address of the group policy. */ + admin?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryGroupPoliciesByAdminRequestAminoMsg { + type: "cosmos-sdk/QueryGroupPoliciesByAdminRequest"; + value: QueryGroupPoliciesByAdminRequestAmino; +} +/** QueryGroupPoliciesByAdminRequest is the Query/GroupPoliciesByAdmin request type. */ +export interface QueryGroupPoliciesByAdminRequestSDKType { + admin: string; + pagination?: PageRequestSDKType; +} +/** QueryGroupPoliciesByAdminResponse is the Query/GroupPoliciesByAdmin response type. */ +export interface QueryGroupPoliciesByAdminResponse { + /** group_policies are the group policies info with provided admin. */ + groupPolicies: GroupPolicyInfo[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryGroupPoliciesByAdminResponseProtoMsg { + typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByAdminResponse"; + value: Uint8Array; +} +/** QueryGroupPoliciesByAdminResponse is the Query/GroupPoliciesByAdmin response type. */ +export interface QueryGroupPoliciesByAdminResponseAmino { + /** group_policies are the group policies info with provided admin. */ + group_policies?: GroupPolicyInfoAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryGroupPoliciesByAdminResponseAminoMsg { + type: "cosmos-sdk/QueryGroupPoliciesByAdminResponse"; + value: QueryGroupPoliciesByAdminResponseAmino; +} +/** QueryGroupPoliciesByAdminResponse is the Query/GroupPoliciesByAdmin response type. */ +export interface QueryGroupPoliciesByAdminResponseSDKType { + group_policies: GroupPolicyInfoSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryProposalRequest is the Query/Proposal request type. */ +export interface QueryProposalRequest { + /** proposal_id is the unique ID of a proposal. */ + proposalId: bigint; +} +export interface QueryProposalRequestProtoMsg { + typeUrl: "/cosmos.group.v1.QueryProposalRequest"; + value: Uint8Array; +} +/** QueryProposalRequest is the Query/Proposal request type. */ +export interface QueryProposalRequestAmino { + /** proposal_id is the unique ID of a proposal. */ + proposal_id?: string; +} +export interface QueryProposalRequestAminoMsg { + type: "cosmos-sdk/QueryProposalRequest"; + value: QueryProposalRequestAmino; +} +/** QueryProposalRequest is the Query/Proposal request type. */ +export interface QueryProposalRequestSDKType { + proposal_id: bigint; +} +/** QueryProposalResponse is the Query/Proposal response type. */ +export interface QueryProposalResponse { + /** proposal is the proposal info. */ + proposal?: Proposal; +} +export interface QueryProposalResponseProtoMsg { + typeUrl: "/cosmos.group.v1.QueryProposalResponse"; + value: Uint8Array; +} +/** QueryProposalResponse is the Query/Proposal response type. */ +export interface QueryProposalResponseAmino { + /** proposal is the proposal info. */ + proposal?: ProposalAmino; +} +export interface QueryProposalResponseAminoMsg { + type: "cosmos-sdk/QueryProposalResponse"; + value: QueryProposalResponseAmino; +} +/** QueryProposalResponse is the Query/Proposal response type. */ +export interface QueryProposalResponseSDKType { + proposal?: ProposalSDKType; +} +/** QueryProposalsByGroupPolicyRequest is the Query/ProposalByGroupPolicy request type. */ +export interface QueryProposalsByGroupPolicyRequest { + /** address is the account address of the group policy related to proposals. */ + address: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryProposalsByGroupPolicyRequestProtoMsg { + typeUrl: "/cosmos.group.v1.QueryProposalsByGroupPolicyRequest"; + value: Uint8Array; +} +/** QueryProposalsByGroupPolicyRequest is the Query/ProposalByGroupPolicy request type. */ +export interface QueryProposalsByGroupPolicyRequestAmino { + /** address is the account address of the group policy related to proposals. */ + address?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryProposalsByGroupPolicyRequestAminoMsg { + type: "cosmos-sdk/QueryProposalsByGroupPolicyRequest"; + value: QueryProposalsByGroupPolicyRequestAmino; +} +/** QueryProposalsByGroupPolicyRequest is the Query/ProposalByGroupPolicy request type. */ +export interface QueryProposalsByGroupPolicyRequestSDKType { + address: string; + pagination?: PageRequestSDKType; +} +/** QueryProposalsByGroupPolicyResponse is the Query/ProposalByGroupPolicy response type. */ +export interface QueryProposalsByGroupPolicyResponse { + /** proposals are the proposals with given group policy. */ + proposals: Proposal[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryProposalsByGroupPolicyResponseProtoMsg { + typeUrl: "/cosmos.group.v1.QueryProposalsByGroupPolicyResponse"; + value: Uint8Array; +} +/** QueryProposalsByGroupPolicyResponse is the Query/ProposalByGroupPolicy response type. */ +export interface QueryProposalsByGroupPolicyResponseAmino { + /** proposals are the proposals with given group policy. */ + proposals?: ProposalAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryProposalsByGroupPolicyResponseAminoMsg { + type: "cosmos-sdk/QueryProposalsByGroupPolicyResponse"; + value: QueryProposalsByGroupPolicyResponseAmino; +} +/** QueryProposalsByGroupPolicyResponse is the Query/ProposalByGroupPolicy response type. */ +export interface QueryProposalsByGroupPolicyResponseSDKType { + proposals: ProposalSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryVoteByProposalVoterRequest is the Query/VoteByProposalVoter request type. */ +export interface QueryVoteByProposalVoterRequest { + /** proposal_id is the unique ID of a proposal. */ + proposalId: bigint; + /** voter is a proposal voter account address. */ + voter: string; +} +export interface QueryVoteByProposalVoterRequestProtoMsg { + typeUrl: "/cosmos.group.v1.QueryVoteByProposalVoterRequest"; + value: Uint8Array; +} +/** QueryVoteByProposalVoterRequest is the Query/VoteByProposalVoter request type. */ +export interface QueryVoteByProposalVoterRequestAmino { + /** proposal_id is the unique ID of a proposal. */ + proposal_id?: string; + /** voter is a proposal voter account address. */ + voter?: string; +} +export interface QueryVoteByProposalVoterRequestAminoMsg { + type: "cosmos-sdk/QueryVoteByProposalVoterRequest"; + value: QueryVoteByProposalVoterRequestAmino; +} +/** QueryVoteByProposalVoterRequest is the Query/VoteByProposalVoter request type. */ +export interface QueryVoteByProposalVoterRequestSDKType { + proposal_id: bigint; + voter: string; +} +/** QueryVoteByProposalVoterResponse is the Query/VoteByProposalVoter response type. */ +export interface QueryVoteByProposalVoterResponse { + /** vote is the vote with given proposal_id and voter. */ + vote?: Vote; +} +export interface QueryVoteByProposalVoterResponseProtoMsg { + typeUrl: "/cosmos.group.v1.QueryVoteByProposalVoterResponse"; + value: Uint8Array; +} +/** QueryVoteByProposalVoterResponse is the Query/VoteByProposalVoter response type. */ +export interface QueryVoteByProposalVoterResponseAmino { + /** vote is the vote with given proposal_id and voter. */ + vote?: VoteAmino; +} +export interface QueryVoteByProposalVoterResponseAminoMsg { + type: "cosmos-sdk/QueryVoteByProposalVoterResponse"; + value: QueryVoteByProposalVoterResponseAmino; +} +/** QueryVoteByProposalVoterResponse is the Query/VoteByProposalVoter response type. */ +export interface QueryVoteByProposalVoterResponseSDKType { + vote?: VoteSDKType; +} +/** QueryVotesByProposalRequest is the Query/VotesByProposal request type. */ +export interface QueryVotesByProposalRequest { + /** proposal_id is the unique ID of a proposal. */ + proposalId: bigint; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryVotesByProposalRequestProtoMsg { + typeUrl: "/cosmos.group.v1.QueryVotesByProposalRequest"; + value: Uint8Array; +} +/** QueryVotesByProposalRequest is the Query/VotesByProposal request type. */ +export interface QueryVotesByProposalRequestAmino { + /** proposal_id is the unique ID of a proposal. */ + proposal_id?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryVotesByProposalRequestAminoMsg { + type: "cosmos-sdk/QueryVotesByProposalRequest"; + value: QueryVotesByProposalRequestAmino; +} +/** QueryVotesByProposalRequest is the Query/VotesByProposal request type. */ +export interface QueryVotesByProposalRequestSDKType { + proposal_id: bigint; + pagination?: PageRequestSDKType; +} +/** QueryVotesByProposalResponse is the Query/VotesByProposal response type. */ +export interface QueryVotesByProposalResponse { + /** votes are the list of votes for given proposal_id. */ + votes: Vote[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryVotesByProposalResponseProtoMsg { + typeUrl: "/cosmos.group.v1.QueryVotesByProposalResponse"; + value: Uint8Array; +} +/** QueryVotesByProposalResponse is the Query/VotesByProposal response type. */ +export interface QueryVotesByProposalResponseAmino { + /** votes are the list of votes for given proposal_id. */ + votes?: VoteAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryVotesByProposalResponseAminoMsg { + type: "cosmos-sdk/QueryVotesByProposalResponse"; + value: QueryVotesByProposalResponseAmino; +} +/** QueryVotesByProposalResponse is the Query/VotesByProposal response type. */ +export interface QueryVotesByProposalResponseSDKType { + votes: VoteSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryVotesByVoterRequest is the Query/VotesByVoter request type. */ +export interface QueryVotesByVoterRequest { + /** voter is a proposal voter account address. */ + voter: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryVotesByVoterRequestProtoMsg { + typeUrl: "/cosmos.group.v1.QueryVotesByVoterRequest"; + value: Uint8Array; +} +/** QueryVotesByVoterRequest is the Query/VotesByVoter request type. */ +export interface QueryVotesByVoterRequestAmino { + /** voter is a proposal voter account address. */ + voter?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryVotesByVoterRequestAminoMsg { + type: "cosmos-sdk/QueryVotesByVoterRequest"; + value: QueryVotesByVoterRequestAmino; +} +/** QueryVotesByVoterRequest is the Query/VotesByVoter request type. */ +export interface QueryVotesByVoterRequestSDKType { + voter: string; + pagination?: PageRequestSDKType; +} +/** QueryVotesByVoterResponse is the Query/VotesByVoter response type. */ +export interface QueryVotesByVoterResponse { + /** votes are the list of votes by given voter. */ + votes: Vote[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryVotesByVoterResponseProtoMsg { + typeUrl: "/cosmos.group.v1.QueryVotesByVoterResponse"; + value: Uint8Array; +} +/** QueryVotesByVoterResponse is the Query/VotesByVoter response type. */ +export interface QueryVotesByVoterResponseAmino { + /** votes are the list of votes by given voter. */ + votes?: VoteAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryVotesByVoterResponseAminoMsg { + type: "cosmos-sdk/QueryVotesByVoterResponse"; + value: QueryVotesByVoterResponseAmino; +} +/** QueryVotesByVoterResponse is the Query/VotesByVoter response type. */ +export interface QueryVotesByVoterResponseSDKType { + votes: VoteSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryGroupsByMemberRequest is the Query/GroupsByMember request type. */ +export interface QueryGroupsByMemberRequest { + /** address is the group member address. */ + address: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryGroupsByMemberRequestProtoMsg { + typeUrl: "/cosmos.group.v1.QueryGroupsByMemberRequest"; + value: Uint8Array; +} +/** QueryGroupsByMemberRequest is the Query/GroupsByMember request type. */ +export interface QueryGroupsByMemberRequestAmino { + /** address is the group member address. */ + address?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryGroupsByMemberRequestAminoMsg { + type: "cosmos-sdk/QueryGroupsByMemberRequest"; + value: QueryGroupsByMemberRequestAmino; +} +/** QueryGroupsByMemberRequest is the Query/GroupsByMember request type. */ +export interface QueryGroupsByMemberRequestSDKType { + address: string; + pagination?: PageRequestSDKType; +} +/** QueryGroupsByMemberResponse is the Query/GroupsByMember response type. */ +export interface QueryGroupsByMemberResponse { + /** groups are the groups info with the provided group member. */ + groups: GroupInfo[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryGroupsByMemberResponseProtoMsg { + typeUrl: "/cosmos.group.v1.QueryGroupsByMemberResponse"; + value: Uint8Array; +} +/** QueryGroupsByMemberResponse is the Query/GroupsByMember response type. */ +export interface QueryGroupsByMemberResponseAmino { + /** groups are the groups info with the provided group member. */ + groups?: GroupInfoAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryGroupsByMemberResponseAminoMsg { + type: "cosmos-sdk/QueryGroupsByMemberResponse"; + value: QueryGroupsByMemberResponseAmino; +} +/** QueryGroupsByMemberResponse is the Query/GroupsByMember response type. */ +export interface QueryGroupsByMemberResponseSDKType { + groups: GroupInfoSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryTallyResultRequest is the Query/TallyResult request type. */ +export interface QueryTallyResultRequest { + /** proposal_id is the unique id of a proposal. */ + proposalId: bigint; +} +export interface QueryTallyResultRequestProtoMsg { + typeUrl: "/cosmos.group.v1.QueryTallyResultRequest"; + value: Uint8Array; +} +/** QueryTallyResultRequest is the Query/TallyResult request type. */ +export interface QueryTallyResultRequestAmino { + /** proposal_id is the unique id of a proposal. */ + proposal_id?: string; +} +export interface QueryTallyResultRequestAminoMsg { + type: "cosmos-sdk/QueryTallyResultRequest"; + value: QueryTallyResultRequestAmino; +} +/** QueryTallyResultRequest is the Query/TallyResult request type. */ +export interface QueryTallyResultRequestSDKType { + proposal_id: bigint; +} +/** QueryTallyResultResponse is the Query/TallyResult response type. */ +export interface QueryTallyResultResponse { + /** tally defines the requested tally. */ + tally: TallyResult; +} +export interface QueryTallyResultResponseProtoMsg { + typeUrl: "/cosmos.group.v1.QueryTallyResultResponse"; + value: Uint8Array; +} +/** QueryTallyResultResponse is the Query/TallyResult response type. */ +export interface QueryTallyResultResponseAmino { + /** tally defines the requested tally. */ + tally: TallyResultAmino; +} +export interface QueryTallyResultResponseAminoMsg { + type: "cosmos-sdk/QueryTallyResultResponse"; + value: QueryTallyResultResponseAmino; +} +/** QueryTallyResultResponse is the Query/TallyResult response type. */ +export interface QueryTallyResultResponseSDKType { + tally: TallyResultSDKType; +} +/** + * QueryGroupsRequest is the Query/Groups request type. + * + * Since: cosmos-sdk 0.47.1 + */ +export interface QueryGroupsRequest { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryGroupsRequestProtoMsg { + typeUrl: "/cosmos.group.v1.QueryGroupsRequest"; + value: Uint8Array; +} +/** + * QueryGroupsRequest is the Query/Groups request type. + * + * Since: cosmos-sdk 0.47.1 + */ +export interface QueryGroupsRequestAmino { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryGroupsRequestAminoMsg { + type: "cosmos-sdk/QueryGroupsRequest"; + value: QueryGroupsRequestAmino; +} +/** + * QueryGroupsRequest is the Query/Groups request type. + * + * Since: cosmos-sdk 0.47.1 + */ +export interface QueryGroupsRequestSDKType { + pagination?: PageRequestSDKType; +} +/** + * QueryGroupsResponse is the Query/Groups response type. + * + * Since: cosmos-sdk 0.47.1 + */ +export interface QueryGroupsResponse { + /** `groups` is all the groups present in state. */ + groups: GroupInfo[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryGroupsResponseProtoMsg { + typeUrl: "/cosmos.group.v1.QueryGroupsResponse"; + value: Uint8Array; +} +/** + * QueryGroupsResponse is the Query/Groups response type. + * + * Since: cosmos-sdk 0.47.1 + */ +export interface QueryGroupsResponseAmino { + /** `groups` is all the groups present in state. */ + groups?: GroupInfoAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryGroupsResponseAminoMsg { + type: "cosmos-sdk/QueryGroupsResponse"; + value: QueryGroupsResponseAmino; +} +/** + * QueryGroupsResponse is the Query/Groups response type. + * + * Since: cosmos-sdk 0.47.1 + */ +export interface QueryGroupsResponseSDKType { + groups: GroupInfoSDKType[]; + pagination?: PageResponseSDKType; +} +function createBaseQueryGroupInfoRequest(): QueryGroupInfoRequest { + return { + groupId: BigInt(0) + }; +} +export const QueryGroupInfoRequest = { + typeUrl: "/cosmos.group.v1.QueryGroupInfoRequest", + encode(message: QueryGroupInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { + writer.uint32(8).uint64(message.groupId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGroupInfoRequest { + const message = createBaseQueryGroupInfoRequest(); + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryGroupInfoRequestAmino): QueryGroupInfoRequest { + const message = createBaseQueryGroupInfoRequest(); + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + return message; + }, + toAmino(message: QueryGroupInfoRequest): QueryGroupInfoRequestAmino { + const obj: any = {}; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryGroupInfoRequestAminoMsg): QueryGroupInfoRequest { + return QueryGroupInfoRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupInfoRequest): QueryGroupInfoRequestAminoMsg { + return { + type: "cosmos-sdk/QueryGroupInfoRequest", + value: QueryGroupInfoRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupInfoRequestProtoMsg): QueryGroupInfoRequest { + return QueryGroupInfoRequest.decode(message.value); + }, + toProto(message: QueryGroupInfoRequest): Uint8Array { + return QueryGroupInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupInfoRequest): QueryGroupInfoRequestProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryGroupInfoRequest", + value: QueryGroupInfoRequest.encode(message).finish() + }; + } +}; +function createBaseQueryGroupInfoResponse(): QueryGroupInfoResponse { + return { + info: undefined + }; +} +export const QueryGroupInfoResponse = { + typeUrl: "/cosmos.group.v1.QueryGroupInfoResponse", + encode(message: QueryGroupInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.info !== undefined) { + GroupInfo.encode(message.info, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.info = GroupInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGroupInfoResponse { + const message = createBaseQueryGroupInfoResponse(); + message.info = object.info !== undefined && object.info !== null ? GroupInfo.fromPartial(object.info) : undefined; + return message; + }, + fromAmino(object: QueryGroupInfoResponseAmino): QueryGroupInfoResponse { + const message = createBaseQueryGroupInfoResponse(); + if (object.info !== undefined && object.info !== null) { + message.info = GroupInfo.fromAmino(object.info); + } + return message; + }, + toAmino(message: QueryGroupInfoResponse): QueryGroupInfoResponseAmino { + const obj: any = {}; + obj.info = message.info ? GroupInfo.toAmino(message.info) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGroupInfoResponseAminoMsg): QueryGroupInfoResponse { + return QueryGroupInfoResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupInfoResponse): QueryGroupInfoResponseAminoMsg { + return { + type: "cosmos-sdk/QueryGroupInfoResponse", + value: QueryGroupInfoResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupInfoResponseProtoMsg): QueryGroupInfoResponse { + return QueryGroupInfoResponse.decode(message.value); + }, + toProto(message: QueryGroupInfoResponse): Uint8Array { + return QueryGroupInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupInfoResponse): QueryGroupInfoResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryGroupInfoResponse", + value: QueryGroupInfoResponse.encode(message).finish() + }; + } +}; +function createBaseQueryGroupPolicyInfoRequest(): QueryGroupPolicyInfoRequest { + return { + address: "" + }; +} +export const QueryGroupPolicyInfoRequest = { + typeUrl: "/cosmos.group.v1.QueryGroupPolicyInfoRequest", + encode(message: QueryGroupPolicyInfoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupPolicyInfoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupPolicyInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGroupPolicyInfoRequest { + const message = createBaseQueryGroupPolicyInfoRequest(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryGroupPolicyInfoRequestAmino): QueryGroupPolicyInfoRequest { + const message = createBaseQueryGroupPolicyInfoRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryGroupPolicyInfoRequest): QueryGroupPolicyInfoRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: QueryGroupPolicyInfoRequestAminoMsg): QueryGroupPolicyInfoRequest { + return QueryGroupPolicyInfoRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupPolicyInfoRequest): QueryGroupPolicyInfoRequestAminoMsg { + return { + type: "cosmos-sdk/QueryGroupPolicyInfoRequest", + value: QueryGroupPolicyInfoRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupPolicyInfoRequestProtoMsg): QueryGroupPolicyInfoRequest { + return QueryGroupPolicyInfoRequest.decode(message.value); + }, + toProto(message: QueryGroupPolicyInfoRequest): Uint8Array { + return QueryGroupPolicyInfoRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupPolicyInfoRequest): QueryGroupPolicyInfoRequestProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryGroupPolicyInfoRequest", + value: QueryGroupPolicyInfoRequest.encode(message).finish() + }; + } +}; +function createBaseQueryGroupPolicyInfoResponse(): QueryGroupPolicyInfoResponse { + return { + info: undefined + }; +} +export const QueryGroupPolicyInfoResponse = { + typeUrl: "/cosmos.group.v1.QueryGroupPolicyInfoResponse", + encode(message: QueryGroupPolicyInfoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.info !== undefined) { + GroupPolicyInfo.encode(message.info, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupPolicyInfoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupPolicyInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.info = GroupPolicyInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGroupPolicyInfoResponse { + const message = createBaseQueryGroupPolicyInfoResponse(); + message.info = object.info !== undefined && object.info !== null ? GroupPolicyInfo.fromPartial(object.info) : undefined; + return message; + }, + fromAmino(object: QueryGroupPolicyInfoResponseAmino): QueryGroupPolicyInfoResponse { + const message = createBaseQueryGroupPolicyInfoResponse(); + if (object.info !== undefined && object.info !== null) { + message.info = GroupPolicyInfo.fromAmino(object.info); + } + return message; + }, + toAmino(message: QueryGroupPolicyInfoResponse): QueryGroupPolicyInfoResponseAmino { + const obj: any = {}; + obj.info = message.info ? GroupPolicyInfo.toAmino(message.info) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGroupPolicyInfoResponseAminoMsg): QueryGroupPolicyInfoResponse { + return QueryGroupPolicyInfoResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupPolicyInfoResponse): QueryGroupPolicyInfoResponseAminoMsg { + return { + type: "cosmos-sdk/QueryGroupPolicyInfoResponse", + value: QueryGroupPolicyInfoResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupPolicyInfoResponseProtoMsg): QueryGroupPolicyInfoResponse { + return QueryGroupPolicyInfoResponse.decode(message.value); + }, + toProto(message: QueryGroupPolicyInfoResponse): Uint8Array { + return QueryGroupPolicyInfoResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupPolicyInfoResponse): QueryGroupPolicyInfoResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryGroupPolicyInfoResponse", + value: QueryGroupPolicyInfoResponse.encode(message).finish() + }; + } +}; +function createBaseQueryGroupMembersRequest(): QueryGroupMembersRequest { + return { + groupId: BigInt(0), + pagination: undefined + }; +} +export const QueryGroupMembersRequest = { + typeUrl: "/cosmos.group.v1.QueryGroupMembersRequest", + encode(message: QueryGroupMembersRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { + writer.uint32(8).uint64(message.groupId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupMembersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupMembersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupId = reader.uint64(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGroupMembersRequest { + const message = createBaseQueryGroupMembersRequest(); + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryGroupMembersRequestAmino): QueryGroupMembersRequest { + const message = createBaseQueryGroupMembersRequest(); + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryGroupMembersRequest): QueryGroupMembersRequestAmino { + const obj: any = {}; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGroupMembersRequestAminoMsg): QueryGroupMembersRequest { + return QueryGroupMembersRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupMembersRequest): QueryGroupMembersRequestAminoMsg { + return { + type: "cosmos-sdk/QueryGroupMembersRequest", + value: QueryGroupMembersRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupMembersRequestProtoMsg): QueryGroupMembersRequest { + return QueryGroupMembersRequest.decode(message.value); + }, + toProto(message: QueryGroupMembersRequest): Uint8Array { + return QueryGroupMembersRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupMembersRequest): QueryGroupMembersRequestProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryGroupMembersRequest", + value: QueryGroupMembersRequest.encode(message).finish() + }; + } +}; +function createBaseQueryGroupMembersResponse(): QueryGroupMembersResponse { + return { + members: [], + pagination: undefined + }; +} +export const QueryGroupMembersResponse = { + typeUrl: "/cosmos.group.v1.QueryGroupMembersResponse", + encode(message: QueryGroupMembersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.members) { + GroupMember.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupMembersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupMembersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.members.push(GroupMember.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGroupMembersResponse { + const message = createBaseQueryGroupMembersResponse(); + message.members = object.members?.map(e => GroupMember.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryGroupMembersResponseAmino): QueryGroupMembersResponse { + const message = createBaseQueryGroupMembersResponse(); + message.members = object.members?.map(e => GroupMember.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryGroupMembersResponse): QueryGroupMembersResponseAmino { + const obj: any = {}; + if (message.members) { + obj.members = message.members.map(e => e ? GroupMember.toAmino(e) : undefined); + } else { + obj.members = message.members; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGroupMembersResponseAminoMsg): QueryGroupMembersResponse { + return QueryGroupMembersResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupMembersResponse): QueryGroupMembersResponseAminoMsg { + return { + type: "cosmos-sdk/QueryGroupMembersResponse", + value: QueryGroupMembersResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupMembersResponseProtoMsg): QueryGroupMembersResponse { + return QueryGroupMembersResponse.decode(message.value); + }, + toProto(message: QueryGroupMembersResponse): Uint8Array { + return QueryGroupMembersResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupMembersResponse): QueryGroupMembersResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryGroupMembersResponse", + value: QueryGroupMembersResponse.encode(message).finish() + }; + } +}; +function createBaseQueryGroupsByAdminRequest(): QueryGroupsByAdminRequest { + return { + admin: "", + pagination: undefined + }; +} +export const QueryGroupsByAdminRequest = { + typeUrl: "/cosmos.group.v1.QueryGroupsByAdminRequest", + encode(message: QueryGroupsByAdminRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.admin !== "") { + writer.uint32(10).string(message.admin); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupsByAdminRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupsByAdminRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGroupsByAdminRequest { + const message = createBaseQueryGroupsByAdminRequest(); + message.admin = object.admin ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryGroupsByAdminRequestAmino): QueryGroupsByAdminRequest { + const message = createBaseQueryGroupsByAdminRequest(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryGroupsByAdminRequest): QueryGroupsByAdminRequestAmino { + const obj: any = {}; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGroupsByAdminRequestAminoMsg): QueryGroupsByAdminRequest { + return QueryGroupsByAdminRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupsByAdminRequest): QueryGroupsByAdminRequestAminoMsg { + return { + type: "cosmos-sdk/QueryGroupsByAdminRequest", + value: QueryGroupsByAdminRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupsByAdminRequestProtoMsg): QueryGroupsByAdminRequest { + return QueryGroupsByAdminRequest.decode(message.value); + }, + toProto(message: QueryGroupsByAdminRequest): Uint8Array { + return QueryGroupsByAdminRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupsByAdminRequest): QueryGroupsByAdminRequestProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryGroupsByAdminRequest", + value: QueryGroupsByAdminRequest.encode(message).finish() + }; + } +}; +function createBaseQueryGroupsByAdminResponse(): QueryGroupsByAdminResponse { + return { + groups: [], + pagination: undefined + }; +} +export const QueryGroupsByAdminResponse = { + typeUrl: "/cosmos.group.v1.QueryGroupsByAdminResponse", + encode(message: QueryGroupsByAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.groups) { + GroupInfo.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupsByAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupsByAdminResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groups.push(GroupInfo.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGroupsByAdminResponse { + const message = createBaseQueryGroupsByAdminResponse(); + message.groups = object.groups?.map(e => GroupInfo.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryGroupsByAdminResponseAmino): QueryGroupsByAdminResponse { + const message = createBaseQueryGroupsByAdminResponse(); + message.groups = object.groups?.map(e => GroupInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryGroupsByAdminResponse): QueryGroupsByAdminResponseAmino { + const obj: any = {}; + if (message.groups) { + obj.groups = message.groups.map(e => e ? GroupInfo.toAmino(e) : undefined); + } else { + obj.groups = message.groups; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGroupsByAdminResponseAminoMsg): QueryGroupsByAdminResponse { + return QueryGroupsByAdminResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupsByAdminResponse): QueryGroupsByAdminResponseAminoMsg { + return { + type: "cosmos-sdk/QueryGroupsByAdminResponse", + value: QueryGroupsByAdminResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupsByAdminResponseProtoMsg): QueryGroupsByAdminResponse { + return QueryGroupsByAdminResponse.decode(message.value); + }, + toProto(message: QueryGroupsByAdminResponse): Uint8Array { + return QueryGroupsByAdminResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupsByAdminResponse): QueryGroupsByAdminResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryGroupsByAdminResponse", + value: QueryGroupsByAdminResponse.encode(message).finish() + }; + } +}; +function createBaseQueryGroupPoliciesByGroupRequest(): QueryGroupPoliciesByGroupRequest { + return { + groupId: BigInt(0), + pagination: undefined + }; +} +export const QueryGroupPoliciesByGroupRequest = { + typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByGroupRequest", + encode(message: QueryGroupPoliciesByGroupRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { + writer.uint32(8).uint64(message.groupId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupPoliciesByGroupRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupPoliciesByGroupRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupId = reader.uint64(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGroupPoliciesByGroupRequest { + const message = createBaseQueryGroupPoliciesByGroupRequest(); + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryGroupPoliciesByGroupRequestAmino): QueryGroupPoliciesByGroupRequest { + const message = createBaseQueryGroupPoliciesByGroupRequest(); + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryGroupPoliciesByGroupRequest): QueryGroupPoliciesByGroupRequestAmino { + const obj: any = {}; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGroupPoliciesByGroupRequestAminoMsg): QueryGroupPoliciesByGroupRequest { + return QueryGroupPoliciesByGroupRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupPoliciesByGroupRequest): QueryGroupPoliciesByGroupRequestAminoMsg { + return { + type: "cosmos-sdk/QueryGroupPoliciesByGroupRequest", + value: QueryGroupPoliciesByGroupRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupPoliciesByGroupRequestProtoMsg): QueryGroupPoliciesByGroupRequest { + return QueryGroupPoliciesByGroupRequest.decode(message.value); + }, + toProto(message: QueryGroupPoliciesByGroupRequest): Uint8Array { + return QueryGroupPoliciesByGroupRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupPoliciesByGroupRequest): QueryGroupPoliciesByGroupRequestProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByGroupRequest", + value: QueryGroupPoliciesByGroupRequest.encode(message).finish() + }; + } +}; +function createBaseQueryGroupPoliciesByGroupResponse(): QueryGroupPoliciesByGroupResponse { + return { + groupPolicies: [], + pagination: undefined + }; +} +export const QueryGroupPoliciesByGroupResponse = { + typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByGroupResponse", + encode(message: QueryGroupPoliciesByGroupResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.groupPolicies) { + GroupPolicyInfo.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupPoliciesByGroupResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupPoliciesByGroupResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupPolicies.push(GroupPolicyInfo.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGroupPoliciesByGroupResponse { + const message = createBaseQueryGroupPoliciesByGroupResponse(); + message.groupPolicies = object.groupPolicies?.map(e => GroupPolicyInfo.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryGroupPoliciesByGroupResponseAmino): QueryGroupPoliciesByGroupResponse { + const message = createBaseQueryGroupPoliciesByGroupResponse(); + message.groupPolicies = object.group_policies?.map(e => GroupPolicyInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryGroupPoliciesByGroupResponse): QueryGroupPoliciesByGroupResponseAmino { + const obj: any = {}; + if (message.groupPolicies) { + obj.group_policies = message.groupPolicies.map(e => e ? GroupPolicyInfo.toAmino(e) : undefined); + } else { + obj.group_policies = message.groupPolicies; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGroupPoliciesByGroupResponseAminoMsg): QueryGroupPoliciesByGroupResponse { + return QueryGroupPoliciesByGroupResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupPoliciesByGroupResponse): QueryGroupPoliciesByGroupResponseAminoMsg { + return { + type: "cosmos-sdk/QueryGroupPoliciesByGroupResponse", + value: QueryGroupPoliciesByGroupResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupPoliciesByGroupResponseProtoMsg): QueryGroupPoliciesByGroupResponse { + return QueryGroupPoliciesByGroupResponse.decode(message.value); + }, + toProto(message: QueryGroupPoliciesByGroupResponse): Uint8Array { + return QueryGroupPoliciesByGroupResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupPoliciesByGroupResponse): QueryGroupPoliciesByGroupResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByGroupResponse", + value: QueryGroupPoliciesByGroupResponse.encode(message).finish() + }; + } +}; +function createBaseQueryGroupPoliciesByAdminRequest(): QueryGroupPoliciesByAdminRequest { + return { + admin: "", + pagination: undefined + }; +} +export const QueryGroupPoliciesByAdminRequest = { + typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByAdminRequest", + encode(message: QueryGroupPoliciesByAdminRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.admin !== "") { + writer.uint32(10).string(message.admin); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupPoliciesByAdminRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupPoliciesByAdminRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGroupPoliciesByAdminRequest { + const message = createBaseQueryGroupPoliciesByAdminRequest(); + message.admin = object.admin ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryGroupPoliciesByAdminRequestAmino): QueryGroupPoliciesByAdminRequest { + const message = createBaseQueryGroupPoliciesByAdminRequest(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryGroupPoliciesByAdminRequest): QueryGroupPoliciesByAdminRequestAmino { + const obj: any = {}; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGroupPoliciesByAdminRequestAminoMsg): QueryGroupPoliciesByAdminRequest { + return QueryGroupPoliciesByAdminRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupPoliciesByAdminRequest): QueryGroupPoliciesByAdminRequestAminoMsg { + return { + type: "cosmos-sdk/QueryGroupPoliciesByAdminRequest", + value: QueryGroupPoliciesByAdminRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupPoliciesByAdminRequestProtoMsg): QueryGroupPoliciesByAdminRequest { + return QueryGroupPoliciesByAdminRequest.decode(message.value); + }, + toProto(message: QueryGroupPoliciesByAdminRequest): Uint8Array { + return QueryGroupPoliciesByAdminRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupPoliciesByAdminRequest): QueryGroupPoliciesByAdminRequestProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByAdminRequest", + value: QueryGroupPoliciesByAdminRequest.encode(message).finish() + }; + } +}; +function createBaseQueryGroupPoliciesByAdminResponse(): QueryGroupPoliciesByAdminResponse { + return { + groupPolicies: [], + pagination: undefined + }; +} +export const QueryGroupPoliciesByAdminResponse = { + typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByAdminResponse", + encode(message: QueryGroupPoliciesByAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.groupPolicies) { + GroupPolicyInfo.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupPoliciesByAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupPoliciesByAdminResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupPolicies.push(GroupPolicyInfo.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGroupPoliciesByAdminResponse { + const message = createBaseQueryGroupPoliciesByAdminResponse(); + message.groupPolicies = object.groupPolicies?.map(e => GroupPolicyInfo.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryGroupPoliciesByAdminResponseAmino): QueryGroupPoliciesByAdminResponse { + const message = createBaseQueryGroupPoliciesByAdminResponse(); + message.groupPolicies = object.group_policies?.map(e => GroupPolicyInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryGroupPoliciesByAdminResponse): QueryGroupPoliciesByAdminResponseAmino { + const obj: any = {}; + if (message.groupPolicies) { + obj.group_policies = message.groupPolicies.map(e => e ? GroupPolicyInfo.toAmino(e) : undefined); + } else { + obj.group_policies = message.groupPolicies; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGroupPoliciesByAdminResponseAminoMsg): QueryGroupPoliciesByAdminResponse { + return QueryGroupPoliciesByAdminResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupPoliciesByAdminResponse): QueryGroupPoliciesByAdminResponseAminoMsg { + return { + type: "cosmos-sdk/QueryGroupPoliciesByAdminResponse", + value: QueryGroupPoliciesByAdminResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupPoliciesByAdminResponseProtoMsg): QueryGroupPoliciesByAdminResponse { + return QueryGroupPoliciesByAdminResponse.decode(message.value); + }, + toProto(message: QueryGroupPoliciesByAdminResponse): Uint8Array { + return QueryGroupPoliciesByAdminResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupPoliciesByAdminResponse): QueryGroupPoliciesByAdminResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryGroupPoliciesByAdminResponse", + value: QueryGroupPoliciesByAdminResponse.encode(message).finish() + }; + } +}; +function createBaseQueryProposalRequest(): QueryProposalRequest { + return { + proposalId: BigInt(0) + }; +} +export const QueryProposalRequest = { + typeUrl: "/cosmos.group.v1.QueryProposalRequest", + encode(message: QueryProposalRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProposalRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryProposalRequest { + const message = createBaseQueryProposalRequest(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryProposalRequestAmino): QueryProposalRequest { + const message = createBaseQueryProposalRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; + }, + toAmino(message: QueryProposalRequest): QueryProposalRequestAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryProposalRequestAminoMsg): QueryProposalRequest { + return QueryProposalRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryProposalRequest): QueryProposalRequestAminoMsg { + return { + type: "cosmos-sdk/QueryProposalRequest", + value: QueryProposalRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryProposalRequestProtoMsg): QueryProposalRequest { + return QueryProposalRequest.decode(message.value); + }, + toProto(message: QueryProposalRequest): Uint8Array { + return QueryProposalRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryProposalRequest): QueryProposalRequestProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryProposalRequest", + value: QueryProposalRequest.encode(message).finish() + }; + } +}; +function createBaseQueryProposalResponse(): QueryProposalResponse { + return { + proposal: undefined + }; +} +export const QueryProposalResponse = { + typeUrl: "/cosmos.group.v1.QueryProposalResponse", + encode(message: QueryProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposal !== undefined) { + Proposal.encode(message.proposal, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProposalResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposal = Proposal.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryProposalResponse { + const message = createBaseQueryProposalResponse(); + message.proposal = object.proposal !== undefined && object.proposal !== null ? Proposal.fromPartial(object.proposal) : undefined; + return message; + }, + fromAmino(object: QueryProposalResponseAmino): QueryProposalResponse { + const message = createBaseQueryProposalResponse(); + if (object.proposal !== undefined && object.proposal !== null) { + message.proposal = Proposal.fromAmino(object.proposal); + } + return message; + }, + toAmino(message: QueryProposalResponse): QueryProposalResponseAmino { + const obj: any = {}; + obj.proposal = message.proposal ? Proposal.toAmino(message.proposal) : undefined; + return obj; + }, + fromAminoMsg(object: QueryProposalResponseAminoMsg): QueryProposalResponse { + return QueryProposalResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryProposalResponse): QueryProposalResponseAminoMsg { + return { + type: "cosmos-sdk/QueryProposalResponse", + value: QueryProposalResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryProposalResponseProtoMsg): QueryProposalResponse { + return QueryProposalResponse.decode(message.value); + }, + toProto(message: QueryProposalResponse): Uint8Array { + return QueryProposalResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryProposalResponse): QueryProposalResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryProposalResponse", + value: QueryProposalResponse.encode(message).finish() + }; + } +}; +function createBaseQueryProposalsByGroupPolicyRequest(): QueryProposalsByGroupPolicyRequest { + return { + address: "", + pagination: undefined + }; +} +export const QueryProposalsByGroupPolicyRequest = { + typeUrl: "/cosmos.group.v1.QueryProposalsByGroupPolicyRequest", + encode(message: QueryProposalsByGroupPolicyRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalsByGroupPolicyRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProposalsByGroupPolicyRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryProposalsByGroupPolicyRequest { + const message = createBaseQueryProposalsByGroupPolicyRequest(); + message.address = object.address ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryProposalsByGroupPolicyRequestAmino): QueryProposalsByGroupPolicyRequest { + const message = createBaseQueryProposalsByGroupPolicyRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryProposalsByGroupPolicyRequest): QueryProposalsByGroupPolicyRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryProposalsByGroupPolicyRequestAminoMsg): QueryProposalsByGroupPolicyRequest { + return QueryProposalsByGroupPolicyRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryProposalsByGroupPolicyRequest): QueryProposalsByGroupPolicyRequestAminoMsg { + return { + type: "cosmos-sdk/QueryProposalsByGroupPolicyRequest", + value: QueryProposalsByGroupPolicyRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryProposalsByGroupPolicyRequestProtoMsg): QueryProposalsByGroupPolicyRequest { + return QueryProposalsByGroupPolicyRequest.decode(message.value); + }, + toProto(message: QueryProposalsByGroupPolicyRequest): Uint8Array { + return QueryProposalsByGroupPolicyRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryProposalsByGroupPolicyRequest): QueryProposalsByGroupPolicyRequestProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryProposalsByGroupPolicyRequest", + value: QueryProposalsByGroupPolicyRequest.encode(message).finish() + }; + } +}; +function createBaseQueryProposalsByGroupPolicyResponse(): QueryProposalsByGroupPolicyResponse { + return { + proposals: [], + pagination: undefined + }; +} +export const QueryProposalsByGroupPolicyResponse = { + typeUrl: "/cosmos.group.v1.QueryProposalsByGroupPolicyResponse", + encode(message: QueryProposalsByGroupPolicyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.proposals) { + Proposal.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryProposalsByGroupPolicyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryProposalsByGroupPolicyResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposals.push(Proposal.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryProposalsByGroupPolicyResponse { + const message = createBaseQueryProposalsByGroupPolicyResponse(); + message.proposals = object.proposals?.map(e => Proposal.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryProposalsByGroupPolicyResponseAmino): QueryProposalsByGroupPolicyResponse { + const message = createBaseQueryProposalsByGroupPolicyResponse(); + message.proposals = object.proposals?.map(e => Proposal.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryProposalsByGroupPolicyResponse): QueryProposalsByGroupPolicyResponseAmino { + const obj: any = {}; + if (message.proposals) { + obj.proposals = message.proposals.map(e => e ? Proposal.toAmino(e) : undefined); + } else { + obj.proposals = message.proposals; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryProposalsByGroupPolicyResponseAminoMsg): QueryProposalsByGroupPolicyResponse { + return QueryProposalsByGroupPolicyResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryProposalsByGroupPolicyResponse): QueryProposalsByGroupPolicyResponseAminoMsg { + return { + type: "cosmos-sdk/QueryProposalsByGroupPolicyResponse", + value: QueryProposalsByGroupPolicyResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryProposalsByGroupPolicyResponseProtoMsg): QueryProposalsByGroupPolicyResponse { + return QueryProposalsByGroupPolicyResponse.decode(message.value); + }, + toProto(message: QueryProposalsByGroupPolicyResponse): Uint8Array { + return QueryProposalsByGroupPolicyResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryProposalsByGroupPolicyResponse): QueryProposalsByGroupPolicyResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryProposalsByGroupPolicyResponse", + value: QueryProposalsByGroupPolicyResponse.encode(message).finish() + }; + } +}; +function createBaseQueryVoteByProposalVoterRequest(): QueryVoteByProposalVoterRequest { + return { + proposalId: BigInt(0), + voter: "" + }; +} +export const QueryVoteByProposalVoterRequest = { + typeUrl: "/cosmos.group.v1.QueryVoteByProposalVoterRequest", + encode(message: QueryVoteByProposalVoterRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.voter !== "") { + writer.uint32(18).string(message.voter); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVoteByProposalVoterRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVoteByProposalVoterRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.voter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryVoteByProposalVoterRequest { + const message = createBaseQueryVoteByProposalVoterRequest(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.voter = object.voter ?? ""; + return message; + }, + fromAmino(object: QueryVoteByProposalVoterRequestAmino): QueryVoteByProposalVoterRequest { + const message = createBaseQueryVoteByProposalVoterRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + return message; + }, + toAmino(message: QueryVoteByProposalVoterRequest): QueryVoteByProposalVoterRequestAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.voter = message.voter === "" ? undefined : message.voter; + return obj; + }, + fromAminoMsg(object: QueryVoteByProposalVoterRequestAminoMsg): QueryVoteByProposalVoterRequest { + return QueryVoteByProposalVoterRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryVoteByProposalVoterRequest): QueryVoteByProposalVoterRequestAminoMsg { + return { + type: "cosmos-sdk/QueryVoteByProposalVoterRequest", + value: QueryVoteByProposalVoterRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryVoteByProposalVoterRequestProtoMsg): QueryVoteByProposalVoterRequest { + return QueryVoteByProposalVoterRequest.decode(message.value); + }, + toProto(message: QueryVoteByProposalVoterRequest): Uint8Array { + return QueryVoteByProposalVoterRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryVoteByProposalVoterRequest): QueryVoteByProposalVoterRequestProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryVoteByProposalVoterRequest", + value: QueryVoteByProposalVoterRequest.encode(message).finish() + }; + } +}; +function createBaseQueryVoteByProposalVoterResponse(): QueryVoteByProposalVoterResponse { + return { + vote: undefined + }; +} +export const QueryVoteByProposalVoterResponse = { + typeUrl: "/cosmos.group.v1.QueryVoteByProposalVoterResponse", + encode(message: QueryVoteByProposalVoterResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.vote !== undefined) { + Vote.encode(message.vote, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVoteByProposalVoterResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVoteByProposalVoterResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.vote = Vote.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryVoteByProposalVoterResponse { + const message = createBaseQueryVoteByProposalVoterResponse(); + message.vote = object.vote !== undefined && object.vote !== null ? Vote.fromPartial(object.vote) : undefined; + return message; + }, + fromAmino(object: QueryVoteByProposalVoterResponseAmino): QueryVoteByProposalVoterResponse { + const message = createBaseQueryVoteByProposalVoterResponse(); + if (object.vote !== undefined && object.vote !== null) { + message.vote = Vote.fromAmino(object.vote); + } + return message; + }, + toAmino(message: QueryVoteByProposalVoterResponse): QueryVoteByProposalVoterResponseAmino { + const obj: any = {}; + obj.vote = message.vote ? Vote.toAmino(message.vote) : undefined; + return obj; + }, + fromAminoMsg(object: QueryVoteByProposalVoterResponseAminoMsg): QueryVoteByProposalVoterResponse { + return QueryVoteByProposalVoterResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryVoteByProposalVoterResponse): QueryVoteByProposalVoterResponseAminoMsg { + return { + type: "cosmos-sdk/QueryVoteByProposalVoterResponse", + value: QueryVoteByProposalVoterResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryVoteByProposalVoterResponseProtoMsg): QueryVoteByProposalVoterResponse { + return QueryVoteByProposalVoterResponse.decode(message.value); + }, + toProto(message: QueryVoteByProposalVoterResponse): Uint8Array { + return QueryVoteByProposalVoterResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryVoteByProposalVoterResponse): QueryVoteByProposalVoterResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryVoteByProposalVoterResponse", + value: QueryVoteByProposalVoterResponse.encode(message).finish() + }; + } +}; +function createBaseQueryVotesByProposalRequest(): QueryVotesByProposalRequest { + return { + proposalId: BigInt(0), + pagination: undefined + }; +} +export const QueryVotesByProposalRequest = { + typeUrl: "/cosmos.group.v1.QueryVotesByProposalRequest", + encode(message: QueryVotesByProposalRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVotesByProposalRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVotesByProposalRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryVotesByProposalRequest { + const message = createBaseQueryVotesByProposalRequest(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryVotesByProposalRequestAmino): QueryVotesByProposalRequest { + const message = createBaseQueryVotesByProposalRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryVotesByProposalRequest): QueryVotesByProposalRequestAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryVotesByProposalRequestAminoMsg): QueryVotesByProposalRequest { + return QueryVotesByProposalRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryVotesByProposalRequest): QueryVotesByProposalRequestAminoMsg { + return { + type: "cosmos-sdk/QueryVotesByProposalRequest", + value: QueryVotesByProposalRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryVotesByProposalRequestProtoMsg): QueryVotesByProposalRequest { + return QueryVotesByProposalRequest.decode(message.value); + }, + toProto(message: QueryVotesByProposalRequest): Uint8Array { + return QueryVotesByProposalRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryVotesByProposalRequest): QueryVotesByProposalRequestProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryVotesByProposalRequest", + value: QueryVotesByProposalRequest.encode(message).finish() + }; + } +}; +function createBaseQueryVotesByProposalResponse(): QueryVotesByProposalResponse { + return { + votes: [], + pagination: undefined + }; +} +export const QueryVotesByProposalResponse = { + typeUrl: "/cosmos.group.v1.QueryVotesByProposalResponse", + encode(message: QueryVotesByProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.votes) { + Vote.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVotesByProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVotesByProposalResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votes.push(Vote.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryVotesByProposalResponse { + const message = createBaseQueryVotesByProposalResponse(); + message.votes = object.votes?.map(e => Vote.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryVotesByProposalResponseAmino): QueryVotesByProposalResponse { + const message = createBaseQueryVotesByProposalResponse(); + message.votes = object.votes?.map(e => Vote.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryVotesByProposalResponse): QueryVotesByProposalResponseAmino { + const obj: any = {}; + if (message.votes) { + obj.votes = message.votes.map(e => e ? Vote.toAmino(e) : undefined); + } else { + obj.votes = message.votes; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryVotesByProposalResponseAminoMsg): QueryVotesByProposalResponse { + return QueryVotesByProposalResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryVotesByProposalResponse): QueryVotesByProposalResponseAminoMsg { + return { + type: "cosmos-sdk/QueryVotesByProposalResponse", + value: QueryVotesByProposalResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryVotesByProposalResponseProtoMsg): QueryVotesByProposalResponse { + return QueryVotesByProposalResponse.decode(message.value); + }, + toProto(message: QueryVotesByProposalResponse): Uint8Array { + return QueryVotesByProposalResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryVotesByProposalResponse): QueryVotesByProposalResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryVotesByProposalResponse", + value: QueryVotesByProposalResponse.encode(message).finish() + }; + } +}; +function createBaseQueryVotesByVoterRequest(): QueryVotesByVoterRequest { + return { + voter: "", + pagination: undefined + }; +} +export const QueryVotesByVoterRequest = { + typeUrl: "/cosmos.group.v1.QueryVotesByVoterRequest", + encode(message: QueryVotesByVoterRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.voter !== "") { + writer.uint32(10).string(message.voter); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVotesByVoterRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVotesByVoterRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.voter = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryVotesByVoterRequest { + const message = createBaseQueryVotesByVoterRequest(); + message.voter = object.voter ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryVotesByVoterRequestAmino): QueryVotesByVoterRequest { + const message = createBaseQueryVotesByVoterRequest(); + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryVotesByVoterRequest): QueryVotesByVoterRequestAmino { + const obj: any = {}; + obj.voter = message.voter === "" ? undefined : message.voter; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryVotesByVoterRequestAminoMsg): QueryVotesByVoterRequest { + return QueryVotesByVoterRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryVotesByVoterRequest): QueryVotesByVoterRequestAminoMsg { + return { + type: "cosmos-sdk/QueryVotesByVoterRequest", + value: QueryVotesByVoterRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryVotesByVoterRequestProtoMsg): QueryVotesByVoterRequest { + return QueryVotesByVoterRequest.decode(message.value); + }, + toProto(message: QueryVotesByVoterRequest): Uint8Array { + return QueryVotesByVoterRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryVotesByVoterRequest): QueryVotesByVoterRequestProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryVotesByVoterRequest", + value: QueryVotesByVoterRequest.encode(message).finish() + }; + } +}; +function createBaseQueryVotesByVoterResponse(): QueryVotesByVoterResponse { + return { + votes: [], + pagination: undefined + }; +} +export const QueryVotesByVoterResponse = { + typeUrl: "/cosmos.group.v1.QueryVotesByVoterResponse", + encode(message: QueryVotesByVoterResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.votes) { + Vote.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVotesByVoterResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVotesByVoterResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votes.push(Vote.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryVotesByVoterResponse { + const message = createBaseQueryVotesByVoterResponse(); + message.votes = object.votes?.map(e => Vote.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryVotesByVoterResponseAmino): QueryVotesByVoterResponse { + const message = createBaseQueryVotesByVoterResponse(); + message.votes = object.votes?.map(e => Vote.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryVotesByVoterResponse): QueryVotesByVoterResponseAmino { + const obj: any = {}; + if (message.votes) { + obj.votes = message.votes.map(e => e ? Vote.toAmino(e) : undefined); + } else { + obj.votes = message.votes; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryVotesByVoterResponseAminoMsg): QueryVotesByVoterResponse { + return QueryVotesByVoterResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryVotesByVoterResponse): QueryVotesByVoterResponseAminoMsg { + return { + type: "cosmos-sdk/QueryVotesByVoterResponse", + value: QueryVotesByVoterResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryVotesByVoterResponseProtoMsg): QueryVotesByVoterResponse { + return QueryVotesByVoterResponse.decode(message.value); + }, + toProto(message: QueryVotesByVoterResponse): Uint8Array { + return QueryVotesByVoterResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryVotesByVoterResponse): QueryVotesByVoterResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryVotesByVoterResponse", + value: QueryVotesByVoterResponse.encode(message).finish() + }; + } +}; +function createBaseQueryGroupsByMemberRequest(): QueryGroupsByMemberRequest { + return { + address: "", + pagination: undefined + }; +} +export const QueryGroupsByMemberRequest = { + typeUrl: "/cosmos.group.v1.QueryGroupsByMemberRequest", + encode(message: QueryGroupsByMemberRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupsByMemberRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupsByMemberRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGroupsByMemberRequest { + const message = createBaseQueryGroupsByMemberRequest(); + message.address = object.address ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryGroupsByMemberRequestAmino): QueryGroupsByMemberRequest { + const message = createBaseQueryGroupsByMemberRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryGroupsByMemberRequest): QueryGroupsByMemberRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGroupsByMemberRequestAminoMsg): QueryGroupsByMemberRequest { + return QueryGroupsByMemberRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupsByMemberRequest): QueryGroupsByMemberRequestAminoMsg { + return { + type: "cosmos-sdk/QueryGroupsByMemberRequest", + value: QueryGroupsByMemberRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupsByMemberRequestProtoMsg): QueryGroupsByMemberRequest { + return QueryGroupsByMemberRequest.decode(message.value); + }, + toProto(message: QueryGroupsByMemberRequest): Uint8Array { + return QueryGroupsByMemberRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupsByMemberRequest): QueryGroupsByMemberRequestProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryGroupsByMemberRequest", + value: QueryGroupsByMemberRequest.encode(message).finish() + }; + } +}; +function createBaseQueryGroupsByMemberResponse(): QueryGroupsByMemberResponse { + return { + groups: [], + pagination: undefined + }; +} +export const QueryGroupsByMemberResponse = { + typeUrl: "/cosmos.group.v1.QueryGroupsByMemberResponse", + encode(message: QueryGroupsByMemberResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.groups) { + GroupInfo.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupsByMemberResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupsByMemberResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groups.push(GroupInfo.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGroupsByMemberResponse { + const message = createBaseQueryGroupsByMemberResponse(); + message.groups = object.groups?.map(e => GroupInfo.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryGroupsByMemberResponseAmino): QueryGroupsByMemberResponse { + const message = createBaseQueryGroupsByMemberResponse(); + message.groups = object.groups?.map(e => GroupInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryGroupsByMemberResponse): QueryGroupsByMemberResponseAmino { + const obj: any = {}; + if (message.groups) { + obj.groups = message.groups.map(e => e ? GroupInfo.toAmino(e) : undefined); + } else { + obj.groups = message.groups; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGroupsByMemberResponseAminoMsg): QueryGroupsByMemberResponse { + return QueryGroupsByMemberResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupsByMemberResponse): QueryGroupsByMemberResponseAminoMsg { + return { + type: "cosmos-sdk/QueryGroupsByMemberResponse", + value: QueryGroupsByMemberResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupsByMemberResponseProtoMsg): QueryGroupsByMemberResponse { + return QueryGroupsByMemberResponse.decode(message.value); + }, + toProto(message: QueryGroupsByMemberResponse): Uint8Array { + return QueryGroupsByMemberResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupsByMemberResponse): QueryGroupsByMemberResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryGroupsByMemberResponse", + value: QueryGroupsByMemberResponse.encode(message).finish() + }; + } +}; +function createBaseQueryTallyResultRequest(): QueryTallyResultRequest { + return { + proposalId: BigInt(0) + }; +} +export const QueryTallyResultRequest = { + typeUrl: "/cosmos.group.v1.QueryTallyResultRequest", + encode(message: QueryTallyResultRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTallyResultRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTallyResultRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryTallyResultRequest { + const message = createBaseQueryTallyResultRequest(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryTallyResultRequestAmino): QueryTallyResultRequest { + const message = createBaseQueryTallyResultRequest(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; + }, + toAmino(message: QueryTallyResultRequest): QueryTallyResultRequestAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryTallyResultRequestAminoMsg): QueryTallyResultRequest { + return QueryTallyResultRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryTallyResultRequest): QueryTallyResultRequestAminoMsg { + return { + type: "cosmos-sdk/QueryTallyResultRequest", + value: QueryTallyResultRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryTallyResultRequestProtoMsg): QueryTallyResultRequest { + return QueryTallyResultRequest.decode(message.value); + }, + toProto(message: QueryTallyResultRequest): Uint8Array { + return QueryTallyResultRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryTallyResultRequest): QueryTallyResultRequestProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryTallyResultRequest", + value: QueryTallyResultRequest.encode(message).finish() + }; + } +}; +function createBaseQueryTallyResultResponse(): QueryTallyResultResponse { + return { + tally: TallyResult.fromPartial({}) + }; +} +export const QueryTallyResultResponse = { + typeUrl: "/cosmos.group.v1.QueryTallyResultResponse", + encode(message: QueryTallyResultResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tally !== undefined) { + TallyResult.encode(message.tally, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTallyResultResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTallyResultResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tally = TallyResult.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryTallyResultResponse { + const message = createBaseQueryTallyResultResponse(); + message.tally = object.tally !== undefined && object.tally !== null ? TallyResult.fromPartial(object.tally) : undefined; + return message; + }, + fromAmino(object: QueryTallyResultResponseAmino): QueryTallyResultResponse { + const message = createBaseQueryTallyResultResponse(); + if (object.tally !== undefined && object.tally !== null) { + message.tally = TallyResult.fromAmino(object.tally); + } + return message; + }, + toAmino(message: QueryTallyResultResponse): QueryTallyResultResponseAmino { + const obj: any = {}; + obj.tally = message.tally ? TallyResult.toAmino(message.tally) : TallyResult.toAmino(TallyResult.fromPartial({})); + return obj; + }, + fromAminoMsg(object: QueryTallyResultResponseAminoMsg): QueryTallyResultResponse { + return QueryTallyResultResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryTallyResultResponse): QueryTallyResultResponseAminoMsg { + return { + type: "cosmos-sdk/QueryTallyResultResponse", + value: QueryTallyResultResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryTallyResultResponseProtoMsg): QueryTallyResultResponse { + return QueryTallyResultResponse.decode(message.value); + }, + toProto(message: QueryTallyResultResponse): Uint8Array { + return QueryTallyResultResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryTallyResultResponse): QueryTallyResultResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryTallyResultResponse", + value: QueryTallyResultResponse.encode(message).finish() + }; + } +}; +function createBaseQueryGroupsRequest(): QueryGroupsRequest { + return { + pagination: undefined + }; +} +export const QueryGroupsRequest = { + typeUrl: "/cosmos.group.v1.QueryGroupsRequest", + encode(message: QueryGroupsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGroupsRequest { + const message = createBaseQueryGroupsRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryGroupsRequestAmino): QueryGroupsRequest { + const message = createBaseQueryGroupsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryGroupsRequest): QueryGroupsRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGroupsRequestAminoMsg): QueryGroupsRequest { + return QueryGroupsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupsRequest): QueryGroupsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryGroupsRequest", + value: QueryGroupsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupsRequestProtoMsg): QueryGroupsRequest { + return QueryGroupsRequest.decode(message.value); + }, + toProto(message: QueryGroupsRequest): Uint8Array { + return QueryGroupsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupsRequest): QueryGroupsRequestProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryGroupsRequest", + value: QueryGroupsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryGroupsResponse(): QueryGroupsResponse { + return { + groups: [], + pagination: undefined + }; +} +export const QueryGroupsResponse = { + typeUrl: "/cosmos.group.v1.QueryGroupsResponse", + encode(message: QueryGroupsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.groups) { + GroupInfo.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryGroupsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGroupsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groups.push(GroupInfo.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryGroupsResponse { + const message = createBaseQueryGroupsResponse(); + message.groups = object.groups?.map(e => GroupInfo.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryGroupsResponseAmino): QueryGroupsResponse { + const message = createBaseQueryGroupsResponse(); + message.groups = object.groups?.map(e => GroupInfo.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryGroupsResponse): QueryGroupsResponseAmino { + const obj: any = {}; + if (message.groups) { + obj.groups = message.groups.map(e => e ? GroupInfo.toAmino(e) : undefined); + } else { + obj.groups = message.groups; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryGroupsResponseAminoMsg): QueryGroupsResponse { + return QueryGroupsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryGroupsResponse): QueryGroupsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryGroupsResponse", + value: QueryGroupsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryGroupsResponseProtoMsg): QueryGroupsResponse { + return QueryGroupsResponse.decode(message.value); + }, + toProto(message: QueryGroupsResponse): Uint8Array { + return QueryGroupsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryGroupsResponse): QueryGroupsResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.QueryGroupsResponse", + value: QueryGroupsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/group/v1/tx.amino.ts b/src/codegen/cosmos/group/v1/tx.amino.ts new file mode 100644 index 0000000..3a5c0e5 --- /dev/null +++ b/src/codegen/cosmos/group/v1/tx.amino.ts @@ -0,0 +1,73 @@ +import { MsgCreateGroup, MsgUpdateGroupMembers, MsgUpdateGroupAdmin, MsgUpdateGroupMetadata, MsgCreateGroupPolicy, MsgCreateGroupWithPolicy, MsgUpdateGroupPolicyAdmin, MsgUpdateGroupPolicyDecisionPolicy, MsgUpdateGroupPolicyMetadata, MsgSubmitProposal, MsgWithdrawProposal, MsgVote, MsgExec, MsgLeaveGroup } from "./tx"; +export const AminoConverter = { + "/cosmos.group.v1.MsgCreateGroup": { + aminoType: "cosmos-sdk/MsgCreateGroup", + toAmino: MsgCreateGroup.toAmino, + fromAmino: MsgCreateGroup.fromAmino + }, + "/cosmos.group.v1.MsgUpdateGroupMembers": { + aminoType: "cosmos-sdk/MsgUpdateGroupMembers", + toAmino: MsgUpdateGroupMembers.toAmino, + fromAmino: MsgUpdateGroupMembers.fromAmino + }, + "/cosmos.group.v1.MsgUpdateGroupAdmin": { + aminoType: "cosmos-sdk/MsgUpdateGroupAdmin", + toAmino: MsgUpdateGroupAdmin.toAmino, + fromAmino: MsgUpdateGroupAdmin.fromAmino + }, + "/cosmos.group.v1.MsgUpdateGroupMetadata": { + aminoType: "cosmos-sdk/MsgUpdateGroupMetadata", + toAmino: MsgUpdateGroupMetadata.toAmino, + fromAmino: MsgUpdateGroupMetadata.fromAmino + }, + "/cosmos.group.v1.MsgCreateGroupPolicy": { + aminoType: "cosmos-sdk/MsgCreateGroupPolicy", + toAmino: MsgCreateGroupPolicy.toAmino, + fromAmino: MsgCreateGroupPolicy.fromAmino + }, + "/cosmos.group.v1.MsgCreateGroupWithPolicy": { + aminoType: "cosmos-sdk/MsgCreateGroupWithPolicy", + toAmino: MsgCreateGroupWithPolicy.toAmino, + fromAmino: MsgCreateGroupWithPolicy.fromAmino + }, + "/cosmos.group.v1.MsgUpdateGroupPolicyAdmin": { + aminoType: "cosmos-sdk/MsgUpdateGroupPolicyAdmin", + toAmino: MsgUpdateGroupPolicyAdmin.toAmino, + fromAmino: MsgUpdateGroupPolicyAdmin.fromAmino + }, + "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy": { + aminoType: "cosmos-sdk/MsgUpdateGroupDecisionPolicy", + toAmino: MsgUpdateGroupPolicyDecisionPolicy.toAmino, + fromAmino: MsgUpdateGroupPolicyDecisionPolicy.fromAmino + }, + "/cosmos.group.v1.MsgUpdateGroupPolicyMetadata": { + aminoType: "cosmos-sdk/MsgUpdateGroupPolicyMetadata", + toAmino: MsgUpdateGroupPolicyMetadata.toAmino, + fromAmino: MsgUpdateGroupPolicyMetadata.fromAmino + }, + "/cosmos.group.v1.MsgSubmitProposal": { + aminoType: "cosmos-sdk/group/MsgSubmitProposal", + toAmino: MsgSubmitProposal.toAmino, + fromAmino: MsgSubmitProposal.fromAmino + }, + "/cosmos.group.v1.MsgWithdrawProposal": { + aminoType: "cosmos-sdk/group/MsgWithdrawProposal", + toAmino: MsgWithdrawProposal.toAmino, + fromAmino: MsgWithdrawProposal.fromAmino + }, + "/cosmos.group.v1.MsgVote": { + aminoType: "cosmos-sdk/group/MsgVote", + toAmino: MsgVote.toAmino, + fromAmino: MsgVote.fromAmino + }, + "/cosmos.group.v1.MsgExec": { + aminoType: "cosmos-sdk/group/MsgExec", + toAmino: MsgExec.toAmino, + fromAmino: MsgExec.fromAmino + }, + "/cosmos.group.v1.MsgLeaveGroup": { + aminoType: "cosmos-sdk/group/MsgLeaveGroup", + toAmino: MsgLeaveGroup.toAmino, + fromAmino: MsgLeaveGroup.fromAmino + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/group/v1/tx.registry.ts b/src/codegen/cosmos/group/v1/tx.registry.ts new file mode 100644 index 0000000..e200020 --- /dev/null +++ b/src/codegen/cosmos/group/v1/tx.registry.ts @@ -0,0 +1,268 @@ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgCreateGroup, MsgUpdateGroupMembers, MsgUpdateGroupAdmin, MsgUpdateGroupMetadata, MsgCreateGroupPolicy, MsgCreateGroupWithPolicy, MsgUpdateGroupPolicyAdmin, MsgUpdateGroupPolicyDecisionPolicy, MsgUpdateGroupPolicyMetadata, MsgSubmitProposal, MsgWithdrawProposal, MsgVote, MsgExec, MsgLeaveGroup } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.group.v1.MsgCreateGroup", MsgCreateGroup], ["/cosmos.group.v1.MsgUpdateGroupMembers", MsgUpdateGroupMembers], ["/cosmos.group.v1.MsgUpdateGroupAdmin", MsgUpdateGroupAdmin], ["/cosmos.group.v1.MsgUpdateGroupMetadata", MsgUpdateGroupMetadata], ["/cosmos.group.v1.MsgCreateGroupPolicy", MsgCreateGroupPolicy], ["/cosmos.group.v1.MsgCreateGroupWithPolicy", MsgCreateGroupWithPolicy], ["/cosmos.group.v1.MsgUpdateGroupPolicyAdmin", MsgUpdateGroupPolicyAdmin], ["/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy", MsgUpdateGroupPolicyDecisionPolicy], ["/cosmos.group.v1.MsgUpdateGroupPolicyMetadata", MsgUpdateGroupPolicyMetadata], ["/cosmos.group.v1.MsgSubmitProposal", MsgSubmitProposal], ["/cosmos.group.v1.MsgWithdrawProposal", MsgWithdrawProposal], ["/cosmos.group.v1.MsgVote", MsgVote], ["/cosmos.group.v1.MsgExec", MsgExec], ["/cosmos.group.v1.MsgLeaveGroup", MsgLeaveGroup]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + createGroup(value: MsgCreateGroup) { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroup", + value: MsgCreateGroup.encode(value).finish() + }; + }, + updateGroupMembers(value: MsgUpdateGroupMembers) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembers", + value: MsgUpdateGroupMembers.encode(value).finish() + }; + }, + updateGroupAdmin(value: MsgUpdateGroupAdmin) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdmin", + value: MsgUpdateGroupAdmin.encode(value).finish() + }; + }, + updateGroupMetadata(value: MsgUpdateGroupMetadata) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadata", + value: MsgUpdateGroupMetadata.encode(value).finish() + }; + }, + createGroupPolicy(value: MsgCreateGroupPolicy) { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicy", + value: MsgCreateGroupPolicy.encode(value).finish() + }; + }, + createGroupWithPolicy(value: MsgCreateGroupWithPolicy) { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicy", + value: MsgCreateGroupWithPolicy.encode(value).finish() + }; + }, + updateGroupPolicyAdmin(value: MsgUpdateGroupPolicyAdmin) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdmin", + value: MsgUpdateGroupPolicyAdmin.encode(value).finish() + }; + }, + updateGroupPolicyDecisionPolicy(value: MsgUpdateGroupPolicyDecisionPolicy) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy", + value: MsgUpdateGroupPolicyDecisionPolicy.encode(value).finish() + }; + }, + updateGroupPolicyMetadata(value: MsgUpdateGroupPolicyMetadata) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadata", + value: MsgUpdateGroupPolicyMetadata.encode(value).finish() + }; + }, + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: "/cosmos.group.v1.MsgSubmitProposal", + value: MsgSubmitProposal.encode(value).finish() + }; + }, + withdrawProposal(value: MsgWithdrawProposal) { + return { + typeUrl: "/cosmos.group.v1.MsgWithdrawProposal", + value: MsgWithdrawProposal.encode(value).finish() + }; + }, + vote(value: MsgVote) { + return { + typeUrl: "/cosmos.group.v1.MsgVote", + value: MsgVote.encode(value).finish() + }; + }, + exec(value: MsgExec) { + return { + typeUrl: "/cosmos.group.v1.MsgExec", + value: MsgExec.encode(value).finish() + }; + }, + leaveGroup(value: MsgLeaveGroup) { + return { + typeUrl: "/cosmos.group.v1.MsgLeaveGroup", + value: MsgLeaveGroup.encode(value).finish() + }; + } + }, + withTypeUrl: { + createGroup(value: MsgCreateGroup) { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroup", + value + }; + }, + updateGroupMembers(value: MsgUpdateGroupMembers) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembers", + value + }; + }, + updateGroupAdmin(value: MsgUpdateGroupAdmin) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdmin", + value + }; + }, + updateGroupMetadata(value: MsgUpdateGroupMetadata) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadata", + value + }; + }, + createGroupPolicy(value: MsgCreateGroupPolicy) { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicy", + value + }; + }, + createGroupWithPolicy(value: MsgCreateGroupWithPolicy) { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicy", + value + }; + }, + updateGroupPolicyAdmin(value: MsgUpdateGroupPolicyAdmin) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdmin", + value + }; + }, + updateGroupPolicyDecisionPolicy(value: MsgUpdateGroupPolicyDecisionPolicy) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy", + value + }; + }, + updateGroupPolicyMetadata(value: MsgUpdateGroupPolicyMetadata) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadata", + value + }; + }, + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: "/cosmos.group.v1.MsgSubmitProposal", + value + }; + }, + withdrawProposal(value: MsgWithdrawProposal) { + return { + typeUrl: "/cosmos.group.v1.MsgWithdrawProposal", + value + }; + }, + vote(value: MsgVote) { + return { + typeUrl: "/cosmos.group.v1.MsgVote", + value + }; + }, + exec(value: MsgExec) { + return { + typeUrl: "/cosmos.group.v1.MsgExec", + value + }; + }, + leaveGroup(value: MsgLeaveGroup) { + return { + typeUrl: "/cosmos.group.v1.MsgLeaveGroup", + value + }; + } + }, + fromPartial: { + createGroup(value: MsgCreateGroup) { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroup", + value: MsgCreateGroup.fromPartial(value) + }; + }, + updateGroupMembers(value: MsgUpdateGroupMembers) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembers", + value: MsgUpdateGroupMembers.fromPartial(value) + }; + }, + updateGroupAdmin(value: MsgUpdateGroupAdmin) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdmin", + value: MsgUpdateGroupAdmin.fromPartial(value) + }; + }, + updateGroupMetadata(value: MsgUpdateGroupMetadata) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadata", + value: MsgUpdateGroupMetadata.fromPartial(value) + }; + }, + createGroupPolicy(value: MsgCreateGroupPolicy) { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicy", + value: MsgCreateGroupPolicy.fromPartial(value) + }; + }, + createGroupWithPolicy(value: MsgCreateGroupWithPolicy) { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicy", + value: MsgCreateGroupWithPolicy.fromPartial(value) + }; + }, + updateGroupPolicyAdmin(value: MsgUpdateGroupPolicyAdmin) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdmin", + value: MsgUpdateGroupPolicyAdmin.fromPartial(value) + }; + }, + updateGroupPolicyDecisionPolicy(value: MsgUpdateGroupPolicyDecisionPolicy) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy", + value: MsgUpdateGroupPolicyDecisionPolicy.fromPartial(value) + }; + }, + updateGroupPolicyMetadata(value: MsgUpdateGroupPolicyMetadata) { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadata", + value: MsgUpdateGroupPolicyMetadata.fromPartial(value) + }; + }, + submitProposal(value: MsgSubmitProposal) { + return { + typeUrl: "/cosmos.group.v1.MsgSubmitProposal", + value: MsgSubmitProposal.fromPartial(value) + }; + }, + withdrawProposal(value: MsgWithdrawProposal) { + return { + typeUrl: "/cosmos.group.v1.MsgWithdrawProposal", + value: MsgWithdrawProposal.fromPartial(value) + }; + }, + vote(value: MsgVote) { + return { + typeUrl: "/cosmos.group.v1.MsgVote", + value: MsgVote.fromPartial(value) + }; + }, + exec(value: MsgExec) { + return { + typeUrl: "/cosmos.group.v1.MsgExec", + value: MsgExec.fromPartial(value) + }; + }, + leaveGroup(value: MsgLeaveGroup) { + return { + typeUrl: "/cosmos.group.v1.MsgLeaveGroup", + value: MsgLeaveGroup.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/group/v1/tx.rpc.msg.ts b/src/codegen/cosmos/group/v1/tx.rpc.msg.ts new file mode 100644 index 0000000..2cbd311 --- /dev/null +++ b/src/codegen/cosmos/group/v1/tx.rpc.msg.ts @@ -0,0 +1,124 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgCreateGroup, MsgCreateGroupResponse, MsgUpdateGroupMembers, MsgUpdateGroupMembersResponse, MsgUpdateGroupAdmin, MsgUpdateGroupAdminResponse, MsgUpdateGroupMetadata, MsgUpdateGroupMetadataResponse, MsgCreateGroupPolicy, MsgCreateGroupPolicyResponse, MsgCreateGroupWithPolicy, MsgCreateGroupWithPolicyResponse, MsgUpdateGroupPolicyAdmin, MsgUpdateGroupPolicyAdminResponse, MsgUpdateGroupPolicyDecisionPolicy, MsgUpdateGroupPolicyDecisionPolicyResponse, MsgUpdateGroupPolicyMetadata, MsgUpdateGroupPolicyMetadataResponse, MsgSubmitProposal, MsgSubmitProposalResponse, MsgWithdrawProposal, MsgWithdrawProposalResponse, MsgVote, MsgVoteResponse, MsgExec, MsgExecResponse, MsgLeaveGroup, MsgLeaveGroupResponse } from "./tx"; +/** Msg is the cosmos.group.v1 Msg service. */ +export interface Msg { + /** CreateGroup creates a new group with an admin account address, a list of members and some optional metadata. */ + createGroup(request: MsgCreateGroup): Promise; + /** UpdateGroupMembers updates the group members with given group id and admin address. */ + updateGroupMembers(request: MsgUpdateGroupMembers): Promise; + /** UpdateGroupAdmin updates the group admin with given group id and previous admin address. */ + updateGroupAdmin(request: MsgUpdateGroupAdmin): Promise; + /** UpdateGroupMetadata updates the group metadata with given group id and admin address. */ + updateGroupMetadata(request: MsgUpdateGroupMetadata): Promise; + /** CreateGroupPolicy creates a new group policy using given DecisionPolicy. */ + createGroupPolicy(request: MsgCreateGroupPolicy): Promise; + /** CreateGroupWithPolicy creates a new group with policy. */ + createGroupWithPolicy(request: MsgCreateGroupWithPolicy): Promise; + /** UpdateGroupPolicyAdmin updates a group policy admin. */ + updateGroupPolicyAdmin(request: MsgUpdateGroupPolicyAdmin): Promise; + /** UpdateGroupPolicyDecisionPolicy allows a group policy's decision policy to be updated. */ + updateGroupPolicyDecisionPolicy(request: MsgUpdateGroupPolicyDecisionPolicy): Promise; + /** UpdateGroupPolicyMetadata updates a group policy metadata. */ + updateGroupPolicyMetadata(request: MsgUpdateGroupPolicyMetadata): Promise; + /** SubmitProposal submits a new proposal. */ + submitProposal(request: MsgSubmitProposal): Promise; + /** WithdrawProposal withdraws a proposal. */ + withdrawProposal(request: MsgWithdrawProposal): Promise; + /** Vote allows a voter to vote on a proposal. */ + vote(request: MsgVote): Promise; + /** Exec executes a proposal. */ + exec(request: MsgExec): Promise; + /** LeaveGroup allows a group member to leave the group. */ + leaveGroup(request: MsgLeaveGroup): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.createGroup = this.createGroup.bind(this); + this.updateGroupMembers = this.updateGroupMembers.bind(this); + this.updateGroupAdmin = this.updateGroupAdmin.bind(this); + this.updateGroupMetadata = this.updateGroupMetadata.bind(this); + this.createGroupPolicy = this.createGroupPolicy.bind(this); + this.createGroupWithPolicy = this.createGroupWithPolicy.bind(this); + this.updateGroupPolicyAdmin = this.updateGroupPolicyAdmin.bind(this); + this.updateGroupPolicyDecisionPolicy = this.updateGroupPolicyDecisionPolicy.bind(this); + this.updateGroupPolicyMetadata = this.updateGroupPolicyMetadata.bind(this); + this.submitProposal = this.submitProposal.bind(this); + this.withdrawProposal = this.withdrawProposal.bind(this); + this.vote = this.vote.bind(this); + this.exec = this.exec.bind(this); + this.leaveGroup = this.leaveGroup.bind(this); + } + createGroup(request: MsgCreateGroup): Promise { + const data = MsgCreateGroup.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Msg", "CreateGroup", data); + return promise.then(data => MsgCreateGroupResponse.decode(new BinaryReader(data))); + } + updateGroupMembers(request: MsgUpdateGroupMembers): Promise { + const data = MsgUpdateGroupMembers.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupMembers", data); + return promise.then(data => MsgUpdateGroupMembersResponse.decode(new BinaryReader(data))); + } + updateGroupAdmin(request: MsgUpdateGroupAdmin): Promise { + const data = MsgUpdateGroupAdmin.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupAdmin", data); + return promise.then(data => MsgUpdateGroupAdminResponse.decode(new BinaryReader(data))); + } + updateGroupMetadata(request: MsgUpdateGroupMetadata): Promise { + const data = MsgUpdateGroupMetadata.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupMetadata", data); + return promise.then(data => MsgUpdateGroupMetadataResponse.decode(new BinaryReader(data))); + } + createGroupPolicy(request: MsgCreateGroupPolicy): Promise { + const data = MsgCreateGroupPolicy.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Msg", "CreateGroupPolicy", data); + return promise.then(data => MsgCreateGroupPolicyResponse.decode(new BinaryReader(data))); + } + createGroupWithPolicy(request: MsgCreateGroupWithPolicy): Promise { + const data = MsgCreateGroupWithPolicy.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Msg", "CreateGroupWithPolicy", data); + return promise.then(data => MsgCreateGroupWithPolicyResponse.decode(new BinaryReader(data))); + } + updateGroupPolicyAdmin(request: MsgUpdateGroupPolicyAdmin): Promise { + const data = MsgUpdateGroupPolicyAdmin.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupPolicyAdmin", data); + return promise.then(data => MsgUpdateGroupPolicyAdminResponse.decode(new BinaryReader(data))); + } + updateGroupPolicyDecisionPolicy(request: MsgUpdateGroupPolicyDecisionPolicy): Promise { + const data = MsgUpdateGroupPolicyDecisionPolicy.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupPolicyDecisionPolicy", data); + return promise.then(data => MsgUpdateGroupPolicyDecisionPolicyResponse.decode(new BinaryReader(data))); + } + updateGroupPolicyMetadata(request: MsgUpdateGroupPolicyMetadata): Promise { + const data = MsgUpdateGroupPolicyMetadata.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Msg", "UpdateGroupPolicyMetadata", data); + return promise.then(data => MsgUpdateGroupPolicyMetadataResponse.decode(new BinaryReader(data))); + } + submitProposal(request: MsgSubmitProposal): Promise { + const data = MsgSubmitProposal.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Msg", "SubmitProposal", data); + return promise.then(data => MsgSubmitProposalResponse.decode(new BinaryReader(data))); + } + withdrawProposal(request: MsgWithdrawProposal): Promise { + const data = MsgWithdrawProposal.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Msg", "WithdrawProposal", data); + return promise.then(data => MsgWithdrawProposalResponse.decode(new BinaryReader(data))); + } + vote(request: MsgVote): Promise { + const data = MsgVote.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Msg", "Vote", data); + return promise.then(data => MsgVoteResponse.decode(new BinaryReader(data))); + } + exec(request: MsgExec): Promise { + const data = MsgExec.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Msg", "Exec", data); + return promise.then(data => MsgExecResponse.decode(new BinaryReader(data))); + } + leaveGroup(request: MsgLeaveGroup): Promise { + const data = MsgLeaveGroup.encode(request).finish(); + const promise = this.rpc.request("cosmos.group.v1.Msg", "LeaveGroup", data); + return promise.then(data => MsgLeaveGroupResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/src/codegen/cosmos/group/v1/tx.ts b/src/codegen/cosmos/group/v1/tx.ts new file mode 100644 index 0000000..4468ccd --- /dev/null +++ b/src/codegen/cosmos/group/v1/tx.ts @@ -0,0 +1,3075 @@ +import { MemberRequest, MemberRequestAmino, MemberRequestSDKType, VoteOption, ProposalExecutorResult } from "./types"; +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** Exec defines modes of execution of a proposal on creation or on new vote. */ +export enum Exec { + /** + * EXEC_UNSPECIFIED - An empty value means that there should be a separate + * MsgExec request for the proposal to execute. + */ + EXEC_UNSPECIFIED = 0, + /** + * EXEC_TRY - Try to execute the proposal immediately. + * If the proposal is not allowed per the DecisionPolicy, + * the proposal will still be open and could + * be executed at a later point. + */ + EXEC_TRY = 1, + UNRECOGNIZED = -1, +} +export const ExecSDKType = Exec; +export const ExecAmino = Exec; +export function execFromJSON(object: any): Exec { + switch (object) { + case 0: + case "EXEC_UNSPECIFIED": + return Exec.EXEC_UNSPECIFIED; + case 1: + case "EXEC_TRY": + return Exec.EXEC_TRY; + case -1: + case "UNRECOGNIZED": + default: + return Exec.UNRECOGNIZED; + } +} +export function execToJSON(object: Exec): string { + switch (object) { + case Exec.EXEC_UNSPECIFIED: + return "EXEC_UNSPECIFIED"; + case Exec.EXEC_TRY: + return "EXEC_TRY"; + case Exec.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** MsgCreateGroup is the Msg/CreateGroup request type. */ +export interface MsgCreateGroup { + /** admin is the account address of the group admin. */ + admin: string; + /** members defines the group members. */ + members: MemberRequest[]; + /** metadata is any arbitrary metadata to attached to the group. */ + metadata: string; +} +export interface MsgCreateGroupProtoMsg { + typeUrl: "/cosmos.group.v1.MsgCreateGroup"; + value: Uint8Array; +} +/** MsgCreateGroup is the Msg/CreateGroup request type. */ +export interface MsgCreateGroupAmino { + /** admin is the account address of the group admin. */ + admin?: string; + /** members defines the group members. */ + members: MemberRequestAmino[]; + /** metadata is any arbitrary metadata to attached to the group. */ + metadata?: string; +} +export interface MsgCreateGroupAminoMsg { + type: "cosmos-sdk/MsgCreateGroup"; + value: MsgCreateGroupAmino; +} +/** MsgCreateGroup is the Msg/CreateGroup request type. */ +export interface MsgCreateGroupSDKType { + admin: string; + members: MemberRequestSDKType[]; + metadata: string; +} +/** MsgCreateGroupResponse is the Msg/CreateGroup response type. */ +export interface MsgCreateGroupResponse { + /** group_id is the unique ID of the newly created group. */ + groupId: bigint; +} +export interface MsgCreateGroupResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgCreateGroupResponse"; + value: Uint8Array; +} +/** MsgCreateGroupResponse is the Msg/CreateGroup response type. */ +export interface MsgCreateGroupResponseAmino { + /** group_id is the unique ID of the newly created group. */ + group_id?: string; +} +export interface MsgCreateGroupResponseAminoMsg { + type: "cosmos-sdk/MsgCreateGroupResponse"; + value: MsgCreateGroupResponseAmino; +} +/** MsgCreateGroupResponse is the Msg/CreateGroup response type. */ +export interface MsgCreateGroupResponseSDKType { + group_id: bigint; +} +/** MsgUpdateGroupMembers is the Msg/UpdateGroupMembers request type. */ +export interface MsgUpdateGroupMembers { + /** admin is the account address of the group admin. */ + admin: string; + /** group_id is the unique ID of the group. */ + groupId: bigint; + /** + * member_updates is the list of members to update, + * set weight to 0 to remove a member. + */ + memberUpdates: MemberRequest[]; +} +export interface MsgUpdateGroupMembersProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembers"; + value: Uint8Array; +} +/** MsgUpdateGroupMembers is the Msg/UpdateGroupMembers request type. */ +export interface MsgUpdateGroupMembersAmino { + /** admin is the account address of the group admin. */ + admin?: string; + /** group_id is the unique ID of the group. */ + group_id?: string; + /** + * member_updates is the list of members to update, + * set weight to 0 to remove a member. + */ + member_updates: MemberRequestAmino[]; +} +export interface MsgUpdateGroupMembersAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupMembers"; + value: MsgUpdateGroupMembersAmino; +} +/** MsgUpdateGroupMembers is the Msg/UpdateGroupMembers request type. */ +export interface MsgUpdateGroupMembersSDKType { + admin: string; + group_id: bigint; + member_updates: MemberRequestSDKType[]; +} +/** MsgUpdateGroupMembersResponse is the Msg/UpdateGroupMembers response type. */ +export interface MsgUpdateGroupMembersResponse {} +export interface MsgUpdateGroupMembersResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembersResponse"; + value: Uint8Array; +} +/** MsgUpdateGroupMembersResponse is the Msg/UpdateGroupMembers response type. */ +export interface MsgUpdateGroupMembersResponseAmino {} +export interface MsgUpdateGroupMembersResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupMembersResponse"; + value: MsgUpdateGroupMembersResponseAmino; +} +/** MsgUpdateGroupMembersResponse is the Msg/UpdateGroupMembers response type. */ +export interface MsgUpdateGroupMembersResponseSDKType {} +/** MsgUpdateGroupAdmin is the Msg/UpdateGroupAdmin request type. */ +export interface MsgUpdateGroupAdmin { + /** admin is the current account address of the group admin. */ + admin: string; + /** group_id is the unique ID of the group. */ + groupId: bigint; + /** new_admin is the group new admin account address. */ + newAdmin: string; +} +export interface MsgUpdateGroupAdminProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdmin"; + value: Uint8Array; +} +/** MsgUpdateGroupAdmin is the Msg/UpdateGroupAdmin request type. */ +export interface MsgUpdateGroupAdminAmino { + /** admin is the current account address of the group admin. */ + admin?: string; + /** group_id is the unique ID of the group. */ + group_id?: string; + /** new_admin is the group new admin account address. */ + new_admin?: string; +} +export interface MsgUpdateGroupAdminAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupAdmin"; + value: MsgUpdateGroupAdminAmino; +} +/** MsgUpdateGroupAdmin is the Msg/UpdateGroupAdmin request type. */ +export interface MsgUpdateGroupAdminSDKType { + admin: string; + group_id: bigint; + new_admin: string; +} +/** MsgUpdateGroupAdminResponse is the Msg/UpdateGroupAdmin response type. */ +export interface MsgUpdateGroupAdminResponse {} +export interface MsgUpdateGroupAdminResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdminResponse"; + value: Uint8Array; +} +/** MsgUpdateGroupAdminResponse is the Msg/UpdateGroupAdmin response type. */ +export interface MsgUpdateGroupAdminResponseAmino {} +export interface MsgUpdateGroupAdminResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupAdminResponse"; + value: MsgUpdateGroupAdminResponseAmino; +} +/** MsgUpdateGroupAdminResponse is the Msg/UpdateGroupAdmin response type. */ +export interface MsgUpdateGroupAdminResponseSDKType {} +/** MsgUpdateGroupMetadata is the Msg/UpdateGroupMetadata request type. */ +export interface MsgUpdateGroupMetadata { + /** admin is the account address of the group admin. */ + admin: string; + /** group_id is the unique ID of the group. */ + groupId: bigint; + /** metadata is the updated group's metadata. */ + metadata: string; +} +export interface MsgUpdateGroupMetadataProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadata"; + value: Uint8Array; +} +/** MsgUpdateGroupMetadata is the Msg/UpdateGroupMetadata request type. */ +export interface MsgUpdateGroupMetadataAmino { + /** admin is the account address of the group admin. */ + admin?: string; + /** group_id is the unique ID of the group. */ + group_id?: string; + /** metadata is the updated group's metadata. */ + metadata?: string; +} +export interface MsgUpdateGroupMetadataAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupMetadata"; + value: MsgUpdateGroupMetadataAmino; +} +/** MsgUpdateGroupMetadata is the Msg/UpdateGroupMetadata request type. */ +export interface MsgUpdateGroupMetadataSDKType { + admin: string; + group_id: bigint; + metadata: string; +} +/** MsgUpdateGroupMetadataResponse is the Msg/UpdateGroupMetadata response type. */ +export interface MsgUpdateGroupMetadataResponse {} +export interface MsgUpdateGroupMetadataResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadataResponse"; + value: Uint8Array; +} +/** MsgUpdateGroupMetadataResponse is the Msg/UpdateGroupMetadata response type. */ +export interface MsgUpdateGroupMetadataResponseAmino {} +export interface MsgUpdateGroupMetadataResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupMetadataResponse"; + value: MsgUpdateGroupMetadataResponseAmino; +} +/** MsgUpdateGroupMetadataResponse is the Msg/UpdateGroupMetadata response type. */ +export interface MsgUpdateGroupMetadataResponseSDKType {} +/** MsgCreateGroupPolicy is the Msg/CreateGroupPolicy request type. */ +export interface MsgCreateGroupPolicy { + /** admin is the account address of the group admin. */ + admin: string; + /** group_id is the unique ID of the group. */ + groupId: bigint; + /** metadata is any arbitrary metadata attached to the group policy. */ + metadata: string; + /** decision_policy specifies the group policy's decision policy. */ + decisionPolicy?: Any; +} +export interface MsgCreateGroupPolicyProtoMsg { + typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicy"; + value: Uint8Array; +} +/** MsgCreateGroupPolicy is the Msg/CreateGroupPolicy request type. */ +export interface MsgCreateGroupPolicyAmino { + /** admin is the account address of the group admin. */ + admin?: string; + /** group_id is the unique ID of the group. */ + group_id?: string; + /** metadata is any arbitrary metadata attached to the group policy. */ + metadata?: string; + /** decision_policy specifies the group policy's decision policy. */ + decision_policy?: AnyAmino; +} +export interface MsgCreateGroupPolicyAminoMsg { + type: "cosmos-sdk/MsgCreateGroupPolicy"; + value: MsgCreateGroupPolicyAmino; +} +/** MsgCreateGroupPolicy is the Msg/CreateGroupPolicy request type. */ +export interface MsgCreateGroupPolicySDKType { + admin: string; + group_id: bigint; + metadata: string; + decision_policy?: AnySDKType; +} +/** MsgCreateGroupPolicyResponse is the Msg/CreateGroupPolicy response type. */ +export interface MsgCreateGroupPolicyResponse { + /** address is the account address of the newly created group policy. */ + address: string; +} +export interface MsgCreateGroupPolicyResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicyResponse"; + value: Uint8Array; +} +/** MsgCreateGroupPolicyResponse is the Msg/CreateGroupPolicy response type. */ +export interface MsgCreateGroupPolicyResponseAmino { + /** address is the account address of the newly created group policy. */ + address?: string; +} +export interface MsgCreateGroupPolicyResponseAminoMsg { + type: "cosmos-sdk/MsgCreateGroupPolicyResponse"; + value: MsgCreateGroupPolicyResponseAmino; +} +/** MsgCreateGroupPolicyResponse is the Msg/CreateGroupPolicy response type. */ +export interface MsgCreateGroupPolicyResponseSDKType { + address: string; +} +/** MsgUpdateGroupPolicyAdmin is the Msg/UpdateGroupPolicyAdmin request type. */ +export interface MsgUpdateGroupPolicyAdmin { + /** admin is the account address of the group admin. */ + admin: string; + /** group_policy_address is the account address of the group policy. */ + groupPolicyAddress: string; + /** new_admin is the new group policy admin. */ + newAdmin: string; +} +export interface MsgUpdateGroupPolicyAdminProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdmin"; + value: Uint8Array; +} +/** MsgUpdateGroupPolicyAdmin is the Msg/UpdateGroupPolicyAdmin request type. */ +export interface MsgUpdateGroupPolicyAdminAmino { + /** admin is the account address of the group admin. */ + admin?: string; + /** group_policy_address is the account address of the group policy. */ + group_policy_address?: string; + /** new_admin is the new group policy admin. */ + new_admin?: string; +} +export interface MsgUpdateGroupPolicyAdminAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupPolicyAdmin"; + value: MsgUpdateGroupPolicyAdminAmino; +} +/** MsgUpdateGroupPolicyAdmin is the Msg/UpdateGroupPolicyAdmin request type. */ +export interface MsgUpdateGroupPolicyAdminSDKType { + admin: string; + group_policy_address: string; + new_admin: string; +} +/** MsgUpdateGroupPolicyAdminResponse is the Msg/UpdateGroupPolicyAdmin response type. */ +export interface MsgUpdateGroupPolicyAdminResponse {} +export interface MsgUpdateGroupPolicyAdminResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdminResponse"; + value: Uint8Array; +} +/** MsgUpdateGroupPolicyAdminResponse is the Msg/UpdateGroupPolicyAdmin response type. */ +export interface MsgUpdateGroupPolicyAdminResponseAmino {} +export interface MsgUpdateGroupPolicyAdminResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupPolicyAdminResponse"; + value: MsgUpdateGroupPolicyAdminResponseAmino; +} +/** MsgUpdateGroupPolicyAdminResponse is the Msg/UpdateGroupPolicyAdmin response type. */ +export interface MsgUpdateGroupPolicyAdminResponseSDKType {} +/** MsgCreateGroupWithPolicy is the Msg/CreateGroupWithPolicy request type. */ +export interface MsgCreateGroupWithPolicy { + /** admin is the account address of the group and group policy admin. */ + admin: string; + /** members defines the group members. */ + members: MemberRequest[]; + /** group_metadata is any arbitrary metadata attached to the group. */ + groupMetadata: string; + /** group_policy_metadata is any arbitrary metadata attached to the group policy. */ + groupPolicyMetadata: string; + /** + * group_policy_as_admin is a boolean field, if set to true, the group policy account address will be used as group + * and group policy admin. + */ + groupPolicyAsAdmin: boolean; + /** decision_policy specifies the group policy's decision policy. */ + decisionPolicy?: Any; +} +export interface MsgCreateGroupWithPolicyProtoMsg { + typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicy"; + value: Uint8Array; +} +/** MsgCreateGroupWithPolicy is the Msg/CreateGroupWithPolicy request type. */ +export interface MsgCreateGroupWithPolicyAmino { + /** admin is the account address of the group and group policy admin. */ + admin?: string; + /** members defines the group members. */ + members: MemberRequestAmino[]; + /** group_metadata is any arbitrary metadata attached to the group. */ + group_metadata?: string; + /** group_policy_metadata is any arbitrary metadata attached to the group policy. */ + group_policy_metadata?: string; + /** + * group_policy_as_admin is a boolean field, if set to true, the group policy account address will be used as group + * and group policy admin. + */ + group_policy_as_admin?: boolean; + /** decision_policy specifies the group policy's decision policy. */ + decision_policy?: AnyAmino; +} +export interface MsgCreateGroupWithPolicyAminoMsg { + type: "cosmos-sdk/MsgCreateGroupWithPolicy"; + value: MsgCreateGroupWithPolicyAmino; +} +/** MsgCreateGroupWithPolicy is the Msg/CreateGroupWithPolicy request type. */ +export interface MsgCreateGroupWithPolicySDKType { + admin: string; + members: MemberRequestSDKType[]; + group_metadata: string; + group_policy_metadata: string; + group_policy_as_admin: boolean; + decision_policy?: AnySDKType; +} +/** MsgCreateGroupWithPolicyResponse is the Msg/CreateGroupWithPolicy response type. */ +export interface MsgCreateGroupWithPolicyResponse { + /** group_id is the unique ID of the newly created group with policy. */ + groupId: bigint; + /** group_policy_address is the account address of the newly created group policy. */ + groupPolicyAddress: string; +} +export interface MsgCreateGroupWithPolicyResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicyResponse"; + value: Uint8Array; +} +/** MsgCreateGroupWithPolicyResponse is the Msg/CreateGroupWithPolicy response type. */ +export interface MsgCreateGroupWithPolicyResponseAmino { + /** group_id is the unique ID of the newly created group with policy. */ + group_id?: string; + /** group_policy_address is the account address of the newly created group policy. */ + group_policy_address?: string; +} +export interface MsgCreateGroupWithPolicyResponseAminoMsg { + type: "cosmos-sdk/MsgCreateGroupWithPolicyResponse"; + value: MsgCreateGroupWithPolicyResponseAmino; +} +/** MsgCreateGroupWithPolicyResponse is the Msg/CreateGroupWithPolicy response type. */ +export interface MsgCreateGroupWithPolicyResponseSDKType { + group_id: bigint; + group_policy_address: string; +} +/** MsgUpdateGroupPolicyDecisionPolicy is the Msg/UpdateGroupPolicyDecisionPolicy request type. */ +export interface MsgUpdateGroupPolicyDecisionPolicy { + /** admin is the account address of the group admin. */ + admin: string; + /** group_policy_address is the account address of group policy. */ + groupPolicyAddress: string; + /** decision_policy is the updated group policy's decision policy. */ + decisionPolicy?: Any; +} +export interface MsgUpdateGroupPolicyDecisionPolicyProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy"; + value: Uint8Array; +} +/** MsgUpdateGroupPolicyDecisionPolicy is the Msg/UpdateGroupPolicyDecisionPolicy request type. */ +export interface MsgUpdateGroupPolicyDecisionPolicyAmino { + /** admin is the account address of the group admin. */ + admin?: string; + /** group_policy_address is the account address of group policy. */ + group_policy_address?: string; + /** decision_policy is the updated group policy's decision policy. */ + decision_policy?: AnyAmino; +} +export interface MsgUpdateGroupPolicyDecisionPolicyAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupDecisionPolicy"; + value: MsgUpdateGroupPolicyDecisionPolicyAmino; +} +/** MsgUpdateGroupPolicyDecisionPolicy is the Msg/UpdateGroupPolicyDecisionPolicy request type. */ +export interface MsgUpdateGroupPolicyDecisionPolicySDKType { + admin: string; + group_policy_address: string; + decision_policy?: AnySDKType; +} +/** MsgUpdateGroupPolicyDecisionPolicyResponse is the Msg/UpdateGroupPolicyDecisionPolicy response type. */ +export interface MsgUpdateGroupPolicyDecisionPolicyResponse {} +export interface MsgUpdateGroupPolicyDecisionPolicyResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicyResponse"; + value: Uint8Array; +} +/** MsgUpdateGroupPolicyDecisionPolicyResponse is the Msg/UpdateGroupPolicyDecisionPolicy response type. */ +export interface MsgUpdateGroupPolicyDecisionPolicyResponseAmino {} +export interface MsgUpdateGroupPolicyDecisionPolicyResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupPolicyDecisionPolicyResponse"; + value: MsgUpdateGroupPolicyDecisionPolicyResponseAmino; +} +/** MsgUpdateGroupPolicyDecisionPolicyResponse is the Msg/UpdateGroupPolicyDecisionPolicy response type. */ +export interface MsgUpdateGroupPolicyDecisionPolicyResponseSDKType {} +/** MsgUpdateGroupPolicyMetadata is the Msg/UpdateGroupPolicyMetadata request type. */ +export interface MsgUpdateGroupPolicyMetadata { + /** admin is the account address of the group admin. */ + admin: string; + /** group_policy_address is the account address of group policy. */ + groupPolicyAddress: string; + /** metadata is the group policy metadata to be updated. */ + metadata: string; +} +export interface MsgUpdateGroupPolicyMetadataProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadata"; + value: Uint8Array; +} +/** MsgUpdateGroupPolicyMetadata is the Msg/UpdateGroupPolicyMetadata request type. */ +export interface MsgUpdateGroupPolicyMetadataAmino { + /** admin is the account address of the group admin. */ + admin?: string; + /** group_policy_address is the account address of group policy. */ + group_policy_address?: string; + /** metadata is the group policy metadata to be updated. */ + metadata?: string; +} +export interface MsgUpdateGroupPolicyMetadataAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupPolicyMetadata"; + value: MsgUpdateGroupPolicyMetadataAmino; +} +/** MsgUpdateGroupPolicyMetadata is the Msg/UpdateGroupPolicyMetadata request type. */ +export interface MsgUpdateGroupPolicyMetadataSDKType { + admin: string; + group_policy_address: string; + metadata: string; +} +/** MsgUpdateGroupPolicyMetadataResponse is the Msg/UpdateGroupPolicyMetadata response type. */ +export interface MsgUpdateGroupPolicyMetadataResponse {} +export interface MsgUpdateGroupPolicyMetadataResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadataResponse"; + value: Uint8Array; +} +/** MsgUpdateGroupPolicyMetadataResponse is the Msg/UpdateGroupPolicyMetadata response type. */ +export interface MsgUpdateGroupPolicyMetadataResponseAmino {} +export interface MsgUpdateGroupPolicyMetadataResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateGroupPolicyMetadataResponse"; + value: MsgUpdateGroupPolicyMetadataResponseAmino; +} +/** MsgUpdateGroupPolicyMetadataResponse is the Msg/UpdateGroupPolicyMetadata response type. */ +export interface MsgUpdateGroupPolicyMetadataResponseSDKType {} +/** MsgSubmitProposal is the Msg/SubmitProposal request type. */ +export interface MsgSubmitProposal { + /** group_policy_address is the account address of group policy. */ + groupPolicyAddress: string; + /** + * proposers are the account addresses of the proposers. + * Proposers signatures will be counted as yes votes. + */ + proposers: string[]; + /** metadata is any arbitrary metadata attached to the proposal. */ + metadata: string; + /** messages is a list of `sdk.Msg`s that will be executed if the proposal passes. */ + messages: Any[]; + /** + * exec defines the mode of execution of the proposal, + * whether it should be executed immediately on creation or not. + * If so, proposers signatures are considered as Yes votes. + */ + exec: Exec; + /** + * title is the title of the proposal. + * + * Since: cosmos-sdk 0.47 + */ + title: string; + /** + * summary is the summary of the proposal. + * + * Since: cosmos-sdk 0.47 + */ + summary: string; +} +export interface MsgSubmitProposalProtoMsg { + typeUrl: "/cosmos.group.v1.MsgSubmitProposal"; + value: Uint8Array; +} +/** MsgSubmitProposal is the Msg/SubmitProposal request type. */ +export interface MsgSubmitProposalAmino { + /** group_policy_address is the account address of group policy. */ + group_policy_address?: string; + /** + * proposers are the account addresses of the proposers. + * Proposers signatures will be counted as yes votes. + */ + proposers?: string[]; + /** metadata is any arbitrary metadata attached to the proposal. */ + metadata?: string; + /** messages is a list of `sdk.Msg`s that will be executed if the proposal passes. */ + messages?: AnyAmino[]; + /** + * exec defines the mode of execution of the proposal, + * whether it should be executed immediately on creation or not. + * If so, proposers signatures are considered as Yes votes. + */ + exec?: Exec; + /** + * title is the title of the proposal. + * + * Since: cosmos-sdk 0.47 + */ + title?: string; + /** + * summary is the summary of the proposal. + * + * Since: cosmos-sdk 0.47 + */ + summary?: string; +} +export interface MsgSubmitProposalAminoMsg { + type: "cosmos-sdk/group/MsgSubmitProposal"; + value: MsgSubmitProposalAmino; +} +/** MsgSubmitProposal is the Msg/SubmitProposal request type. */ +export interface MsgSubmitProposalSDKType { + group_policy_address: string; + proposers: string[]; + metadata: string; + messages: AnySDKType[]; + exec: Exec; + title: string; + summary: string; +} +/** MsgSubmitProposalResponse is the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponse { + /** proposal is the unique ID of the proposal. */ + proposalId: bigint; +} +export interface MsgSubmitProposalResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgSubmitProposalResponse"; + value: Uint8Array; +} +/** MsgSubmitProposalResponse is the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponseAmino { + /** proposal is the unique ID of the proposal. */ + proposal_id?: string; +} +export interface MsgSubmitProposalResponseAminoMsg { + type: "cosmos-sdk/MsgSubmitProposalResponse"; + value: MsgSubmitProposalResponseAmino; +} +/** MsgSubmitProposalResponse is the Msg/SubmitProposal response type. */ +export interface MsgSubmitProposalResponseSDKType { + proposal_id: bigint; +} +/** MsgWithdrawProposal is the Msg/WithdrawProposal request type. */ +export interface MsgWithdrawProposal { + /** proposal is the unique ID of the proposal. */ + proposalId: bigint; + /** address is the admin of the group policy or one of the proposer of the proposal. */ + address: string; +} +export interface MsgWithdrawProposalProtoMsg { + typeUrl: "/cosmos.group.v1.MsgWithdrawProposal"; + value: Uint8Array; +} +/** MsgWithdrawProposal is the Msg/WithdrawProposal request type. */ +export interface MsgWithdrawProposalAmino { + /** proposal is the unique ID of the proposal. */ + proposal_id?: string; + /** address is the admin of the group policy or one of the proposer of the proposal. */ + address?: string; +} +export interface MsgWithdrawProposalAminoMsg { + type: "cosmos-sdk/group/MsgWithdrawProposal"; + value: MsgWithdrawProposalAmino; +} +/** MsgWithdrawProposal is the Msg/WithdrawProposal request type. */ +export interface MsgWithdrawProposalSDKType { + proposal_id: bigint; + address: string; +} +/** MsgWithdrawProposalResponse is the Msg/WithdrawProposal response type. */ +export interface MsgWithdrawProposalResponse {} +export interface MsgWithdrawProposalResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgWithdrawProposalResponse"; + value: Uint8Array; +} +/** MsgWithdrawProposalResponse is the Msg/WithdrawProposal response type. */ +export interface MsgWithdrawProposalResponseAmino {} +export interface MsgWithdrawProposalResponseAminoMsg { + type: "cosmos-sdk/MsgWithdrawProposalResponse"; + value: MsgWithdrawProposalResponseAmino; +} +/** MsgWithdrawProposalResponse is the Msg/WithdrawProposal response type. */ +export interface MsgWithdrawProposalResponseSDKType {} +/** MsgVote is the Msg/Vote request type. */ +export interface MsgVote { + /** proposal is the unique ID of the proposal. */ + proposalId: bigint; + /** voter is the voter account address. */ + voter: string; + /** option is the voter's choice on the proposal. */ + option: VoteOption; + /** metadata is any arbitrary metadata attached to the vote. */ + metadata: string; + /** + * exec defines whether the proposal should be executed + * immediately after voting or not. + */ + exec: Exec; +} +export interface MsgVoteProtoMsg { + typeUrl: "/cosmos.group.v1.MsgVote"; + value: Uint8Array; +} +/** MsgVote is the Msg/Vote request type. */ +export interface MsgVoteAmino { + /** proposal is the unique ID of the proposal. */ + proposal_id?: string; + /** voter is the voter account address. */ + voter?: string; + /** option is the voter's choice on the proposal. */ + option?: VoteOption; + /** metadata is any arbitrary metadata attached to the vote. */ + metadata?: string; + /** + * exec defines whether the proposal should be executed + * immediately after voting or not. + */ + exec?: Exec; +} +export interface MsgVoteAminoMsg { + type: "cosmos-sdk/group/MsgVote"; + value: MsgVoteAmino; +} +/** MsgVote is the Msg/Vote request type. */ +export interface MsgVoteSDKType { + proposal_id: bigint; + voter: string; + option: VoteOption; + metadata: string; + exec: Exec; +} +/** MsgVoteResponse is the Msg/Vote response type. */ +export interface MsgVoteResponse {} +export interface MsgVoteResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgVoteResponse"; + value: Uint8Array; +} +/** MsgVoteResponse is the Msg/Vote response type. */ +export interface MsgVoteResponseAmino {} +export interface MsgVoteResponseAminoMsg { + type: "cosmos-sdk/MsgVoteResponse"; + value: MsgVoteResponseAmino; +} +/** MsgVoteResponse is the Msg/Vote response type. */ +export interface MsgVoteResponseSDKType {} +/** MsgExec is the Msg/Exec request type. */ +export interface MsgExec { + /** proposal is the unique ID of the proposal. */ + proposalId: bigint; + /** executor is the account address used to execute the proposal. */ + executor: string; +} +export interface MsgExecProtoMsg { + typeUrl: "/cosmos.group.v1.MsgExec"; + value: Uint8Array; +} +/** MsgExec is the Msg/Exec request type. */ +export interface MsgExecAmino { + /** proposal is the unique ID of the proposal. */ + proposal_id?: string; + /** executor is the account address used to execute the proposal. */ + executor?: string; +} +export interface MsgExecAminoMsg { + type: "cosmos-sdk/group/MsgExec"; + value: MsgExecAmino; +} +/** MsgExec is the Msg/Exec request type. */ +export interface MsgExecSDKType { + proposal_id: bigint; + executor: string; +} +/** MsgExecResponse is the Msg/Exec request type. */ +export interface MsgExecResponse { + /** result is the final result of the proposal execution. */ + result: ProposalExecutorResult; +} +export interface MsgExecResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgExecResponse"; + value: Uint8Array; +} +/** MsgExecResponse is the Msg/Exec request type. */ +export interface MsgExecResponseAmino { + /** result is the final result of the proposal execution. */ + result?: ProposalExecutorResult; +} +export interface MsgExecResponseAminoMsg { + type: "cosmos-sdk/MsgExecResponse"; + value: MsgExecResponseAmino; +} +/** MsgExecResponse is the Msg/Exec request type. */ +export interface MsgExecResponseSDKType { + result: ProposalExecutorResult; +} +/** MsgLeaveGroup is the Msg/LeaveGroup request type. */ +export interface MsgLeaveGroup { + /** address is the account address of the group member. */ + address: string; + /** group_id is the unique ID of the group. */ + groupId: bigint; +} +export interface MsgLeaveGroupProtoMsg { + typeUrl: "/cosmos.group.v1.MsgLeaveGroup"; + value: Uint8Array; +} +/** MsgLeaveGroup is the Msg/LeaveGroup request type. */ +export interface MsgLeaveGroupAmino { + /** address is the account address of the group member. */ + address?: string; + /** group_id is the unique ID of the group. */ + group_id?: string; +} +export interface MsgLeaveGroupAminoMsg { + type: "cosmos-sdk/group/MsgLeaveGroup"; + value: MsgLeaveGroupAmino; +} +/** MsgLeaveGroup is the Msg/LeaveGroup request type. */ +export interface MsgLeaveGroupSDKType { + address: string; + group_id: bigint; +} +/** MsgLeaveGroupResponse is the Msg/LeaveGroup response type. */ +export interface MsgLeaveGroupResponse {} +export interface MsgLeaveGroupResponseProtoMsg { + typeUrl: "/cosmos.group.v1.MsgLeaveGroupResponse"; + value: Uint8Array; +} +/** MsgLeaveGroupResponse is the Msg/LeaveGroup response type. */ +export interface MsgLeaveGroupResponseAmino {} +export interface MsgLeaveGroupResponseAminoMsg { + type: "cosmos-sdk/MsgLeaveGroupResponse"; + value: MsgLeaveGroupResponseAmino; +} +/** MsgLeaveGroupResponse is the Msg/LeaveGroup response type. */ +export interface MsgLeaveGroupResponseSDKType {} +function createBaseMsgCreateGroup(): MsgCreateGroup { + return { + admin: "", + members: [], + metadata: "" + }; +} +export const MsgCreateGroup = { + typeUrl: "/cosmos.group.v1.MsgCreateGroup", + encode(message: MsgCreateGroup, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.admin !== "") { + writer.uint32(10).string(message.admin); + } + for (const v of message.members) { + MemberRequest.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.metadata !== "") { + writer.uint32(26).string(message.metadata); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateGroup { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateGroup(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.members.push(MemberRequest.decode(reader, reader.uint32())); + break; + case 3: + message.metadata = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateGroup { + const message = createBaseMsgCreateGroup(); + message.admin = object.admin ?? ""; + message.members = object.members?.map(e => MemberRequest.fromPartial(e)) || []; + message.metadata = object.metadata ?? ""; + return message; + }, + fromAmino(object: MsgCreateGroupAmino): MsgCreateGroup { + const message = createBaseMsgCreateGroup(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + message.members = object.members?.map(e => MemberRequest.fromAmino(e)) || []; + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + return message; + }, + toAmino(message: MsgCreateGroup): MsgCreateGroupAmino { + const obj: any = {}; + obj.admin = message.admin === "" ? undefined : message.admin; + if (message.members) { + obj.members = message.members.map(e => e ? MemberRequest.toAmino(e) : undefined); + } else { + obj.members = message.members; + } + obj.metadata = message.metadata === "" ? undefined : message.metadata; + return obj; + }, + fromAminoMsg(object: MsgCreateGroupAminoMsg): MsgCreateGroup { + return MsgCreateGroup.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateGroup): MsgCreateGroupAminoMsg { + return { + type: "cosmos-sdk/MsgCreateGroup", + value: MsgCreateGroup.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateGroupProtoMsg): MsgCreateGroup { + return MsgCreateGroup.decode(message.value); + }, + toProto(message: MsgCreateGroup): Uint8Array { + return MsgCreateGroup.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateGroup): MsgCreateGroupProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroup", + value: MsgCreateGroup.encode(message).finish() + }; + } +}; +function createBaseMsgCreateGroupResponse(): MsgCreateGroupResponse { + return { + groupId: BigInt(0) + }; +} +export const MsgCreateGroupResponse = { + typeUrl: "/cosmos.group.v1.MsgCreateGroupResponse", + encode(message: MsgCreateGroupResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { + writer.uint32(8).uint64(message.groupId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateGroupResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateGroupResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateGroupResponse { + const message = createBaseMsgCreateGroupResponse(); + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgCreateGroupResponseAmino): MsgCreateGroupResponse { + const message = createBaseMsgCreateGroupResponse(); + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + return message; + }, + toAmino(message: MsgCreateGroupResponse): MsgCreateGroupResponseAmino { + const obj: any = {}; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateGroupResponseAminoMsg): MsgCreateGroupResponse { + return MsgCreateGroupResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateGroupResponse): MsgCreateGroupResponseAminoMsg { + return { + type: "cosmos-sdk/MsgCreateGroupResponse", + value: MsgCreateGroupResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateGroupResponseProtoMsg): MsgCreateGroupResponse { + return MsgCreateGroupResponse.decode(message.value); + }, + toProto(message: MsgCreateGroupResponse): Uint8Array { + return MsgCreateGroupResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateGroupResponse): MsgCreateGroupResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroupResponse", + value: MsgCreateGroupResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateGroupMembers(): MsgUpdateGroupMembers { + return { + admin: "", + groupId: BigInt(0), + memberUpdates: [] + }; +} +export const MsgUpdateGroupMembers = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembers", + encode(message: MsgUpdateGroupMembers, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.admin !== "") { + writer.uint32(10).string(message.admin); + } + if (message.groupId !== BigInt(0)) { + writer.uint32(16).uint64(message.groupId); + } + for (const v of message.memberUpdates) { + MemberRequest.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupMembers { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateGroupMembers(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.groupId = reader.uint64(); + break; + case 3: + message.memberUpdates.push(MemberRequest.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateGroupMembers { + const message = createBaseMsgUpdateGroupMembers(); + message.admin = object.admin ?? ""; + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); + message.memberUpdates = object.memberUpdates?.map(e => MemberRequest.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgUpdateGroupMembersAmino): MsgUpdateGroupMembers { + const message = createBaseMsgUpdateGroupMembers(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + message.memberUpdates = object.member_updates?.map(e => MemberRequest.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgUpdateGroupMembers): MsgUpdateGroupMembersAmino { + const obj: any = {}; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + if (message.memberUpdates) { + obj.member_updates = message.memberUpdates.map(e => e ? MemberRequest.toAmino(e) : undefined); + } else { + obj.member_updates = message.memberUpdates; + } + return obj; + }, + fromAminoMsg(object: MsgUpdateGroupMembersAminoMsg): MsgUpdateGroupMembers { + return MsgUpdateGroupMembers.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateGroupMembers): MsgUpdateGroupMembersAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateGroupMembers", + value: MsgUpdateGroupMembers.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateGroupMembersProtoMsg): MsgUpdateGroupMembers { + return MsgUpdateGroupMembers.decode(message.value); + }, + toProto(message: MsgUpdateGroupMembers): Uint8Array { + return MsgUpdateGroupMembers.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateGroupMembers): MsgUpdateGroupMembersProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembers", + value: MsgUpdateGroupMembers.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateGroupMembersResponse(): MsgUpdateGroupMembersResponse { + return {}; +} +export const MsgUpdateGroupMembersResponse = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembersResponse", + encode(_: MsgUpdateGroupMembersResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupMembersResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateGroupMembersResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateGroupMembersResponse { + const message = createBaseMsgUpdateGroupMembersResponse(); + return message; + }, + fromAmino(_: MsgUpdateGroupMembersResponseAmino): MsgUpdateGroupMembersResponse { + const message = createBaseMsgUpdateGroupMembersResponse(); + return message; + }, + toAmino(_: MsgUpdateGroupMembersResponse): MsgUpdateGroupMembersResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateGroupMembersResponseAminoMsg): MsgUpdateGroupMembersResponse { + return MsgUpdateGroupMembersResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateGroupMembersResponse): MsgUpdateGroupMembersResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateGroupMembersResponse", + value: MsgUpdateGroupMembersResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateGroupMembersResponseProtoMsg): MsgUpdateGroupMembersResponse { + return MsgUpdateGroupMembersResponse.decode(message.value); + }, + toProto(message: MsgUpdateGroupMembersResponse): Uint8Array { + return MsgUpdateGroupMembersResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateGroupMembersResponse): MsgUpdateGroupMembersResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMembersResponse", + value: MsgUpdateGroupMembersResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateGroupAdmin(): MsgUpdateGroupAdmin { + return { + admin: "", + groupId: BigInt(0), + newAdmin: "" + }; +} +export const MsgUpdateGroupAdmin = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdmin", + encode(message: MsgUpdateGroupAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.admin !== "") { + writer.uint32(10).string(message.admin); + } + if (message.groupId !== BigInt(0)) { + writer.uint32(16).uint64(message.groupId); + } + if (message.newAdmin !== "") { + writer.uint32(26).string(message.newAdmin); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupAdmin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateGroupAdmin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.groupId = reader.uint64(); + break; + case 3: + message.newAdmin = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateGroupAdmin { + const message = createBaseMsgUpdateGroupAdmin(); + message.admin = object.admin ?? ""; + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); + message.newAdmin = object.newAdmin ?? ""; + return message; + }, + fromAmino(object: MsgUpdateGroupAdminAmino): MsgUpdateGroupAdmin { + const message = createBaseMsgUpdateGroupAdmin(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + if (object.new_admin !== undefined && object.new_admin !== null) { + message.newAdmin = object.new_admin; + } + return message; + }, + toAmino(message: MsgUpdateGroupAdmin): MsgUpdateGroupAdminAmino { + const obj: any = {}; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + obj.new_admin = message.newAdmin === "" ? undefined : message.newAdmin; + return obj; + }, + fromAminoMsg(object: MsgUpdateGroupAdminAminoMsg): MsgUpdateGroupAdmin { + return MsgUpdateGroupAdmin.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateGroupAdmin): MsgUpdateGroupAdminAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateGroupAdmin", + value: MsgUpdateGroupAdmin.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateGroupAdminProtoMsg): MsgUpdateGroupAdmin { + return MsgUpdateGroupAdmin.decode(message.value); + }, + toProto(message: MsgUpdateGroupAdmin): Uint8Array { + return MsgUpdateGroupAdmin.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateGroupAdmin): MsgUpdateGroupAdminProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdmin", + value: MsgUpdateGroupAdmin.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateGroupAdminResponse(): MsgUpdateGroupAdminResponse { + return {}; +} +export const MsgUpdateGroupAdminResponse = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdminResponse", + encode(_: MsgUpdateGroupAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateGroupAdminResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateGroupAdminResponse { + const message = createBaseMsgUpdateGroupAdminResponse(); + return message; + }, + fromAmino(_: MsgUpdateGroupAdminResponseAmino): MsgUpdateGroupAdminResponse { + const message = createBaseMsgUpdateGroupAdminResponse(); + return message; + }, + toAmino(_: MsgUpdateGroupAdminResponse): MsgUpdateGroupAdminResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateGroupAdminResponseAminoMsg): MsgUpdateGroupAdminResponse { + return MsgUpdateGroupAdminResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateGroupAdminResponse): MsgUpdateGroupAdminResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateGroupAdminResponse", + value: MsgUpdateGroupAdminResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateGroupAdminResponseProtoMsg): MsgUpdateGroupAdminResponse { + return MsgUpdateGroupAdminResponse.decode(message.value); + }, + toProto(message: MsgUpdateGroupAdminResponse): Uint8Array { + return MsgUpdateGroupAdminResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateGroupAdminResponse): MsgUpdateGroupAdminResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupAdminResponse", + value: MsgUpdateGroupAdminResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateGroupMetadata(): MsgUpdateGroupMetadata { + return { + admin: "", + groupId: BigInt(0), + metadata: "" + }; +} +export const MsgUpdateGroupMetadata = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadata", + encode(message: MsgUpdateGroupMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.admin !== "") { + writer.uint32(10).string(message.admin); + } + if (message.groupId !== BigInt(0)) { + writer.uint32(16).uint64(message.groupId); + } + if (message.metadata !== "") { + writer.uint32(26).string(message.metadata); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateGroupMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.groupId = reader.uint64(); + break; + case 3: + message.metadata = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateGroupMetadata { + const message = createBaseMsgUpdateGroupMetadata(); + message.admin = object.admin ?? ""; + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); + message.metadata = object.metadata ?? ""; + return message; + }, + fromAmino(object: MsgUpdateGroupMetadataAmino): MsgUpdateGroupMetadata { + const message = createBaseMsgUpdateGroupMetadata(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + return message; + }, + toAmino(message: MsgUpdateGroupMetadata): MsgUpdateGroupMetadataAmino { + const obj: any = {}; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + return obj; + }, + fromAminoMsg(object: MsgUpdateGroupMetadataAminoMsg): MsgUpdateGroupMetadata { + return MsgUpdateGroupMetadata.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateGroupMetadata): MsgUpdateGroupMetadataAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateGroupMetadata", + value: MsgUpdateGroupMetadata.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateGroupMetadataProtoMsg): MsgUpdateGroupMetadata { + return MsgUpdateGroupMetadata.decode(message.value); + }, + toProto(message: MsgUpdateGroupMetadata): Uint8Array { + return MsgUpdateGroupMetadata.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateGroupMetadata): MsgUpdateGroupMetadataProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadata", + value: MsgUpdateGroupMetadata.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateGroupMetadataResponse(): MsgUpdateGroupMetadataResponse { + return {}; +} +export const MsgUpdateGroupMetadataResponse = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadataResponse", + encode(_: MsgUpdateGroupMetadataResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupMetadataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateGroupMetadataResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateGroupMetadataResponse { + const message = createBaseMsgUpdateGroupMetadataResponse(); + return message; + }, + fromAmino(_: MsgUpdateGroupMetadataResponseAmino): MsgUpdateGroupMetadataResponse { + const message = createBaseMsgUpdateGroupMetadataResponse(); + return message; + }, + toAmino(_: MsgUpdateGroupMetadataResponse): MsgUpdateGroupMetadataResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateGroupMetadataResponseAminoMsg): MsgUpdateGroupMetadataResponse { + return MsgUpdateGroupMetadataResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateGroupMetadataResponse): MsgUpdateGroupMetadataResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateGroupMetadataResponse", + value: MsgUpdateGroupMetadataResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateGroupMetadataResponseProtoMsg): MsgUpdateGroupMetadataResponse { + return MsgUpdateGroupMetadataResponse.decode(message.value); + }, + toProto(message: MsgUpdateGroupMetadataResponse): Uint8Array { + return MsgUpdateGroupMetadataResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateGroupMetadataResponse): MsgUpdateGroupMetadataResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupMetadataResponse", + value: MsgUpdateGroupMetadataResponse.encode(message).finish() + }; + } +}; +function createBaseMsgCreateGroupPolicy(): MsgCreateGroupPolicy { + return { + admin: "", + groupId: BigInt(0), + metadata: "", + decisionPolicy: undefined + }; +} +export const MsgCreateGroupPolicy = { + typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicy", + encode(message: MsgCreateGroupPolicy, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.admin !== "") { + writer.uint32(10).string(message.admin); + } + if (message.groupId !== BigInt(0)) { + writer.uint32(16).uint64(message.groupId); + } + if (message.metadata !== "") { + writer.uint32(26).string(message.metadata); + } + if (message.decisionPolicy !== undefined) { + Any.encode(message.decisionPolicy, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateGroupPolicy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateGroupPolicy(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.groupId = reader.uint64(); + break; + case 3: + message.metadata = reader.string(); + break; + case 4: + message.decisionPolicy = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateGroupPolicy { + const message = createBaseMsgCreateGroupPolicy(); + message.admin = object.admin ?? ""; + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); + message.metadata = object.metadata ?? ""; + message.decisionPolicy = object.decisionPolicy !== undefined && object.decisionPolicy !== null ? Any.fromPartial(object.decisionPolicy) : undefined; + return message; + }, + fromAmino(object: MsgCreateGroupPolicyAmino): MsgCreateGroupPolicy { + const message = createBaseMsgCreateGroupPolicy(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + if (object.decision_policy !== undefined && object.decision_policy !== null) { + message.decisionPolicy = Any.fromAmino(object.decision_policy); + } + return message; + }, + toAmino(message: MsgCreateGroupPolicy): MsgCreateGroupPolicyAmino { + const obj: any = {}; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + obj.decision_policy = message.decisionPolicy ? Any.toAmino(message.decisionPolicy) : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateGroupPolicyAminoMsg): MsgCreateGroupPolicy { + return MsgCreateGroupPolicy.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateGroupPolicy): MsgCreateGroupPolicyAminoMsg { + return { + type: "cosmos-sdk/MsgCreateGroupPolicy", + value: MsgCreateGroupPolicy.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateGroupPolicyProtoMsg): MsgCreateGroupPolicy { + return MsgCreateGroupPolicy.decode(message.value); + }, + toProto(message: MsgCreateGroupPolicy): Uint8Array { + return MsgCreateGroupPolicy.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateGroupPolicy): MsgCreateGroupPolicyProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicy", + value: MsgCreateGroupPolicy.encode(message).finish() + }; + } +}; +function createBaseMsgCreateGroupPolicyResponse(): MsgCreateGroupPolicyResponse { + return { + address: "" + }; +} +export const MsgCreateGroupPolicyResponse = { + typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicyResponse", + encode(message: MsgCreateGroupPolicyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateGroupPolicyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateGroupPolicyResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateGroupPolicyResponse { + const message = createBaseMsgCreateGroupPolicyResponse(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: MsgCreateGroupPolicyResponseAmino): MsgCreateGroupPolicyResponse { + const message = createBaseMsgCreateGroupPolicyResponse(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: MsgCreateGroupPolicyResponse): MsgCreateGroupPolicyResponseAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: MsgCreateGroupPolicyResponseAminoMsg): MsgCreateGroupPolicyResponse { + return MsgCreateGroupPolicyResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateGroupPolicyResponse): MsgCreateGroupPolicyResponseAminoMsg { + return { + type: "cosmos-sdk/MsgCreateGroupPolicyResponse", + value: MsgCreateGroupPolicyResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateGroupPolicyResponseProtoMsg): MsgCreateGroupPolicyResponse { + return MsgCreateGroupPolicyResponse.decode(message.value); + }, + toProto(message: MsgCreateGroupPolicyResponse): Uint8Array { + return MsgCreateGroupPolicyResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateGroupPolicyResponse): MsgCreateGroupPolicyResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroupPolicyResponse", + value: MsgCreateGroupPolicyResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateGroupPolicyAdmin(): MsgUpdateGroupPolicyAdmin { + return { + admin: "", + groupPolicyAddress: "", + newAdmin: "" + }; +} +export const MsgUpdateGroupPolicyAdmin = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdmin", + encode(message: MsgUpdateGroupPolicyAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.admin !== "") { + writer.uint32(10).string(message.admin); + } + if (message.groupPolicyAddress !== "") { + writer.uint32(18).string(message.groupPolicyAddress); + } + if (message.newAdmin !== "") { + writer.uint32(26).string(message.newAdmin); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupPolicyAdmin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateGroupPolicyAdmin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.groupPolicyAddress = reader.string(); + break; + case 3: + message.newAdmin = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateGroupPolicyAdmin { + const message = createBaseMsgUpdateGroupPolicyAdmin(); + message.admin = object.admin ?? ""; + message.groupPolicyAddress = object.groupPolicyAddress ?? ""; + message.newAdmin = object.newAdmin ?? ""; + return message; + }, + fromAmino(object: MsgUpdateGroupPolicyAdminAmino): MsgUpdateGroupPolicyAdmin { + const message = createBaseMsgUpdateGroupPolicyAdmin(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.group_policy_address !== undefined && object.group_policy_address !== null) { + message.groupPolicyAddress = object.group_policy_address; + } + if (object.new_admin !== undefined && object.new_admin !== null) { + message.newAdmin = object.new_admin; + } + return message; + }, + toAmino(message: MsgUpdateGroupPolicyAdmin): MsgUpdateGroupPolicyAdminAmino { + const obj: any = {}; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.group_policy_address = message.groupPolicyAddress === "" ? undefined : message.groupPolicyAddress; + obj.new_admin = message.newAdmin === "" ? undefined : message.newAdmin; + return obj; + }, + fromAminoMsg(object: MsgUpdateGroupPolicyAdminAminoMsg): MsgUpdateGroupPolicyAdmin { + return MsgUpdateGroupPolicyAdmin.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateGroupPolicyAdmin): MsgUpdateGroupPolicyAdminAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateGroupPolicyAdmin", + value: MsgUpdateGroupPolicyAdmin.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateGroupPolicyAdminProtoMsg): MsgUpdateGroupPolicyAdmin { + return MsgUpdateGroupPolicyAdmin.decode(message.value); + }, + toProto(message: MsgUpdateGroupPolicyAdmin): Uint8Array { + return MsgUpdateGroupPolicyAdmin.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateGroupPolicyAdmin): MsgUpdateGroupPolicyAdminProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdmin", + value: MsgUpdateGroupPolicyAdmin.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateGroupPolicyAdminResponse(): MsgUpdateGroupPolicyAdminResponse { + return {}; +} +export const MsgUpdateGroupPolicyAdminResponse = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdminResponse", + encode(_: MsgUpdateGroupPolicyAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupPolicyAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateGroupPolicyAdminResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateGroupPolicyAdminResponse { + const message = createBaseMsgUpdateGroupPolicyAdminResponse(); + return message; + }, + fromAmino(_: MsgUpdateGroupPolicyAdminResponseAmino): MsgUpdateGroupPolicyAdminResponse { + const message = createBaseMsgUpdateGroupPolicyAdminResponse(); + return message; + }, + toAmino(_: MsgUpdateGroupPolicyAdminResponse): MsgUpdateGroupPolicyAdminResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateGroupPolicyAdminResponseAminoMsg): MsgUpdateGroupPolicyAdminResponse { + return MsgUpdateGroupPolicyAdminResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateGroupPolicyAdminResponse): MsgUpdateGroupPolicyAdminResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateGroupPolicyAdminResponse", + value: MsgUpdateGroupPolicyAdminResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateGroupPolicyAdminResponseProtoMsg): MsgUpdateGroupPolicyAdminResponse { + return MsgUpdateGroupPolicyAdminResponse.decode(message.value); + }, + toProto(message: MsgUpdateGroupPolicyAdminResponse): Uint8Array { + return MsgUpdateGroupPolicyAdminResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateGroupPolicyAdminResponse): MsgUpdateGroupPolicyAdminResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyAdminResponse", + value: MsgUpdateGroupPolicyAdminResponse.encode(message).finish() + }; + } +}; +function createBaseMsgCreateGroupWithPolicy(): MsgCreateGroupWithPolicy { + return { + admin: "", + members: [], + groupMetadata: "", + groupPolicyMetadata: "", + groupPolicyAsAdmin: false, + decisionPolicy: undefined + }; +} +export const MsgCreateGroupWithPolicy = { + typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicy", + encode(message: MsgCreateGroupWithPolicy, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.admin !== "") { + writer.uint32(10).string(message.admin); + } + for (const v of message.members) { + MemberRequest.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.groupMetadata !== "") { + writer.uint32(26).string(message.groupMetadata); + } + if (message.groupPolicyMetadata !== "") { + writer.uint32(34).string(message.groupPolicyMetadata); + } + if (message.groupPolicyAsAdmin === true) { + writer.uint32(40).bool(message.groupPolicyAsAdmin); + } + if (message.decisionPolicy !== undefined) { + Any.encode(message.decisionPolicy, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateGroupWithPolicy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateGroupWithPolicy(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.members.push(MemberRequest.decode(reader, reader.uint32())); + break; + case 3: + message.groupMetadata = reader.string(); + break; + case 4: + message.groupPolicyMetadata = reader.string(); + break; + case 5: + message.groupPolicyAsAdmin = reader.bool(); + break; + case 6: + message.decisionPolicy = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateGroupWithPolicy { + const message = createBaseMsgCreateGroupWithPolicy(); + message.admin = object.admin ?? ""; + message.members = object.members?.map(e => MemberRequest.fromPartial(e)) || []; + message.groupMetadata = object.groupMetadata ?? ""; + message.groupPolicyMetadata = object.groupPolicyMetadata ?? ""; + message.groupPolicyAsAdmin = object.groupPolicyAsAdmin ?? false; + message.decisionPolicy = object.decisionPolicy !== undefined && object.decisionPolicy !== null ? Any.fromPartial(object.decisionPolicy) : undefined; + return message; + }, + fromAmino(object: MsgCreateGroupWithPolicyAmino): MsgCreateGroupWithPolicy { + const message = createBaseMsgCreateGroupWithPolicy(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + message.members = object.members?.map(e => MemberRequest.fromAmino(e)) || []; + if (object.group_metadata !== undefined && object.group_metadata !== null) { + message.groupMetadata = object.group_metadata; + } + if (object.group_policy_metadata !== undefined && object.group_policy_metadata !== null) { + message.groupPolicyMetadata = object.group_policy_metadata; + } + if (object.group_policy_as_admin !== undefined && object.group_policy_as_admin !== null) { + message.groupPolicyAsAdmin = object.group_policy_as_admin; + } + if (object.decision_policy !== undefined && object.decision_policy !== null) { + message.decisionPolicy = Any.fromAmino(object.decision_policy); + } + return message; + }, + toAmino(message: MsgCreateGroupWithPolicy): MsgCreateGroupWithPolicyAmino { + const obj: any = {}; + obj.admin = message.admin === "" ? undefined : message.admin; + if (message.members) { + obj.members = message.members.map(e => e ? MemberRequest.toAmino(e) : undefined); + } else { + obj.members = message.members; + } + obj.group_metadata = message.groupMetadata === "" ? undefined : message.groupMetadata; + obj.group_policy_metadata = message.groupPolicyMetadata === "" ? undefined : message.groupPolicyMetadata; + obj.group_policy_as_admin = message.groupPolicyAsAdmin === false ? undefined : message.groupPolicyAsAdmin; + obj.decision_policy = message.decisionPolicy ? Any.toAmino(message.decisionPolicy) : undefined; + return obj; + }, + fromAminoMsg(object: MsgCreateGroupWithPolicyAminoMsg): MsgCreateGroupWithPolicy { + return MsgCreateGroupWithPolicy.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateGroupWithPolicy): MsgCreateGroupWithPolicyAminoMsg { + return { + type: "cosmos-sdk/MsgCreateGroupWithPolicy", + value: MsgCreateGroupWithPolicy.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateGroupWithPolicyProtoMsg): MsgCreateGroupWithPolicy { + return MsgCreateGroupWithPolicy.decode(message.value); + }, + toProto(message: MsgCreateGroupWithPolicy): Uint8Array { + return MsgCreateGroupWithPolicy.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateGroupWithPolicy): MsgCreateGroupWithPolicyProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicy", + value: MsgCreateGroupWithPolicy.encode(message).finish() + }; + } +}; +function createBaseMsgCreateGroupWithPolicyResponse(): MsgCreateGroupWithPolicyResponse { + return { + groupId: BigInt(0), + groupPolicyAddress: "" + }; +} +export const MsgCreateGroupWithPolicyResponse = { + typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicyResponse", + encode(message: MsgCreateGroupWithPolicyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { + writer.uint32(8).uint64(message.groupId); + } + if (message.groupPolicyAddress !== "") { + writer.uint32(18).string(message.groupPolicyAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateGroupWithPolicyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateGroupWithPolicyResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupId = reader.uint64(); + break; + case 2: + message.groupPolicyAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateGroupWithPolicyResponse { + const message = createBaseMsgCreateGroupWithPolicyResponse(); + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); + message.groupPolicyAddress = object.groupPolicyAddress ?? ""; + return message; + }, + fromAmino(object: MsgCreateGroupWithPolicyResponseAmino): MsgCreateGroupWithPolicyResponse { + const message = createBaseMsgCreateGroupWithPolicyResponse(); + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + if (object.group_policy_address !== undefined && object.group_policy_address !== null) { + message.groupPolicyAddress = object.group_policy_address; + } + return message; + }, + toAmino(message: MsgCreateGroupWithPolicyResponse): MsgCreateGroupWithPolicyResponseAmino { + const obj: any = {}; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + obj.group_policy_address = message.groupPolicyAddress === "" ? undefined : message.groupPolicyAddress; + return obj; + }, + fromAminoMsg(object: MsgCreateGroupWithPolicyResponseAminoMsg): MsgCreateGroupWithPolicyResponse { + return MsgCreateGroupWithPolicyResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateGroupWithPolicyResponse): MsgCreateGroupWithPolicyResponseAminoMsg { + return { + type: "cosmos-sdk/MsgCreateGroupWithPolicyResponse", + value: MsgCreateGroupWithPolicyResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateGroupWithPolicyResponseProtoMsg): MsgCreateGroupWithPolicyResponse { + return MsgCreateGroupWithPolicyResponse.decode(message.value); + }, + toProto(message: MsgCreateGroupWithPolicyResponse): Uint8Array { + return MsgCreateGroupWithPolicyResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateGroupWithPolicyResponse): MsgCreateGroupWithPolicyResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgCreateGroupWithPolicyResponse", + value: MsgCreateGroupWithPolicyResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateGroupPolicyDecisionPolicy(): MsgUpdateGroupPolicyDecisionPolicy { + return { + admin: "", + groupPolicyAddress: "", + decisionPolicy: undefined + }; +} +export const MsgUpdateGroupPolicyDecisionPolicy = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy", + encode(message: MsgUpdateGroupPolicyDecisionPolicy, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.admin !== "") { + writer.uint32(10).string(message.admin); + } + if (message.groupPolicyAddress !== "") { + writer.uint32(18).string(message.groupPolicyAddress); + } + if (message.decisionPolicy !== undefined) { + Any.encode(message.decisionPolicy, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupPolicyDecisionPolicy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateGroupPolicyDecisionPolicy(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.groupPolicyAddress = reader.string(); + break; + case 3: + message.decisionPolicy = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateGroupPolicyDecisionPolicy { + const message = createBaseMsgUpdateGroupPolicyDecisionPolicy(); + message.admin = object.admin ?? ""; + message.groupPolicyAddress = object.groupPolicyAddress ?? ""; + message.decisionPolicy = object.decisionPolicy !== undefined && object.decisionPolicy !== null ? Any.fromPartial(object.decisionPolicy) : undefined; + return message; + }, + fromAmino(object: MsgUpdateGroupPolicyDecisionPolicyAmino): MsgUpdateGroupPolicyDecisionPolicy { + const message = createBaseMsgUpdateGroupPolicyDecisionPolicy(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.group_policy_address !== undefined && object.group_policy_address !== null) { + message.groupPolicyAddress = object.group_policy_address; + } + if (object.decision_policy !== undefined && object.decision_policy !== null) { + message.decisionPolicy = Any.fromAmino(object.decision_policy); + } + return message; + }, + toAmino(message: MsgUpdateGroupPolicyDecisionPolicy): MsgUpdateGroupPolicyDecisionPolicyAmino { + const obj: any = {}; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.group_policy_address = message.groupPolicyAddress === "" ? undefined : message.groupPolicyAddress; + obj.decision_policy = message.decisionPolicy ? Any.toAmino(message.decisionPolicy) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateGroupPolicyDecisionPolicyAminoMsg): MsgUpdateGroupPolicyDecisionPolicy { + return MsgUpdateGroupPolicyDecisionPolicy.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateGroupPolicyDecisionPolicy): MsgUpdateGroupPolicyDecisionPolicyAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateGroupDecisionPolicy", + value: MsgUpdateGroupPolicyDecisionPolicy.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateGroupPolicyDecisionPolicyProtoMsg): MsgUpdateGroupPolicyDecisionPolicy { + return MsgUpdateGroupPolicyDecisionPolicy.decode(message.value); + }, + toProto(message: MsgUpdateGroupPolicyDecisionPolicy): Uint8Array { + return MsgUpdateGroupPolicyDecisionPolicy.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateGroupPolicyDecisionPolicy): MsgUpdateGroupPolicyDecisionPolicyProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy", + value: MsgUpdateGroupPolicyDecisionPolicy.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateGroupPolicyDecisionPolicyResponse(): MsgUpdateGroupPolicyDecisionPolicyResponse { + return {}; +} +export const MsgUpdateGroupPolicyDecisionPolicyResponse = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicyResponse", + encode(_: MsgUpdateGroupPolicyDecisionPolicyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupPolicyDecisionPolicyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateGroupPolicyDecisionPolicyResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateGroupPolicyDecisionPolicyResponse { + const message = createBaseMsgUpdateGroupPolicyDecisionPolicyResponse(); + return message; + }, + fromAmino(_: MsgUpdateGroupPolicyDecisionPolicyResponseAmino): MsgUpdateGroupPolicyDecisionPolicyResponse { + const message = createBaseMsgUpdateGroupPolicyDecisionPolicyResponse(); + return message; + }, + toAmino(_: MsgUpdateGroupPolicyDecisionPolicyResponse): MsgUpdateGroupPolicyDecisionPolicyResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateGroupPolicyDecisionPolicyResponseAminoMsg): MsgUpdateGroupPolicyDecisionPolicyResponse { + return MsgUpdateGroupPolicyDecisionPolicyResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateGroupPolicyDecisionPolicyResponse): MsgUpdateGroupPolicyDecisionPolicyResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateGroupPolicyDecisionPolicyResponse", + value: MsgUpdateGroupPolicyDecisionPolicyResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateGroupPolicyDecisionPolicyResponseProtoMsg): MsgUpdateGroupPolicyDecisionPolicyResponse { + return MsgUpdateGroupPolicyDecisionPolicyResponse.decode(message.value); + }, + toProto(message: MsgUpdateGroupPolicyDecisionPolicyResponse): Uint8Array { + return MsgUpdateGroupPolicyDecisionPolicyResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateGroupPolicyDecisionPolicyResponse): MsgUpdateGroupPolicyDecisionPolicyResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicyResponse", + value: MsgUpdateGroupPolicyDecisionPolicyResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateGroupPolicyMetadata(): MsgUpdateGroupPolicyMetadata { + return { + admin: "", + groupPolicyAddress: "", + metadata: "" + }; +} +export const MsgUpdateGroupPolicyMetadata = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadata", + encode(message: MsgUpdateGroupPolicyMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.admin !== "") { + writer.uint32(10).string(message.admin); + } + if (message.groupPolicyAddress !== "") { + writer.uint32(18).string(message.groupPolicyAddress); + } + if (message.metadata !== "") { + writer.uint32(26).string(message.metadata); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupPolicyMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateGroupPolicyMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + case 2: + message.groupPolicyAddress = reader.string(); + break; + case 3: + message.metadata = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateGroupPolicyMetadata { + const message = createBaseMsgUpdateGroupPolicyMetadata(); + message.admin = object.admin ?? ""; + message.groupPolicyAddress = object.groupPolicyAddress ?? ""; + message.metadata = object.metadata ?? ""; + return message; + }, + fromAmino(object: MsgUpdateGroupPolicyMetadataAmino): MsgUpdateGroupPolicyMetadata { + const message = createBaseMsgUpdateGroupPolicyMetadata(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.group_policy_address !== undefined && object.group_policy_address !== null) { + message.groupPolicyAddress = object.group_policy_address; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + return message; + }, + toAmino(message: MsgUpdateGroupPolicyMetadata): MsgUpdateGroupPolicyMetadataAmino { + const obj: any = {}; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.group_policy_address = message.groupPolicyAddress === "" ? undefined : message.groupPolicyAddress; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + return obj; + }, + fromAminoMsg(object: MsgUpdateGroupPolicyMetadataAminoMsg): MsgUpdateGroupPolicyMetadata { + return MsgUpdateGroupPolicyMetadata.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateGroupPolicyMetadata): MsgUpdateGroupPolicyMetadataAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateGroupPolicyMetadata", + value: MsgUpdateGroupPolicyMetadata.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateGroupPolicyMetadataProtoMsg): MsgUpdateGroupPolicyMetadata { + return MsgUpdateGroupPolicyMetadata.decode(message.value); + }, + toProto(message: MsgUpdateGroupPolicyMetadata): Uint8Array { + return MsgUpdateGroupPolicyMetadata.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateGroupPolicyMetadata): MsgUpdateGroupPolicyMetadataProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadata", + value: MsgUpdateGroupPolicyMetadata.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateGroupPolicyMetadataResponse(): MsgUpdateGroupPolicyMetadataResponse { + return {}; +} +export const MsgUpdateGroupPolicyMetadataResponse = { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadataResponse", + encode(_: MsgUpdateGroupPolicyMetadataResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateGroupPolicyMetadataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateGroupPolicyMetadataResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateGroupPolicyMetadataResponse { + const message = createBaseMsgUpdateGroupPolicyMetadataResponse(); + return message; + }, + fromAmino(_: MsgUpdateGroupPolicyMetadataResponseAmino): MsgUpdateGroupPolicyMetadataResponse { + const message = createBaseMsgUpdateGroupPolicyMetadataResponse(); + return message; + }, + toAmino(_: MsgUpdateGroupPolicyMetadataResponse): MsgUpdateGroupPolicyMetadataResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateGroupPolicyMetadataResponseAminoMsg): MsgUpdateGroupPolicyMetadataResponse { + return MsgUpdateGroupPolicyMetadataResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateGroupPolicyMetadataResponse): MsgUpdateGroupPolicyMetadataResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateGroupPolicyMetadataResponse", + value: MsgUpdateGroupPolicyMetadataResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateGroupPolicyMetadataResponseProtoMsg): MsgUpdateGroupPolicyMetadataResponse { + return MsgUpdateGroupPolicyMetadataResponse.decode(message.value); + }, + toProto(message: MsgUpdateGroupPolicyMetadataResponse): Uint8Array { + return MsgUpdateGroupPolicyMetadataResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateGroupPolicyMetadataResponse): MsgUpdateGroupPolicyMetadataResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgUpdateGroupPolicyMetadataResponse", + value: MsgUpdateGroupPolicyMetadataResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSubmitProposal(): MsgSubmitProposal { + return { + groupPolicyAddress: "", + proposers: [], + metadata: "", + messages: [], + exec: 0, + title: "", + summary: "" + }; +} +export const MsgSubmitProposal = { + typeUrl: "/cosmos.group.v1.MsgSubmitProposal", + encode(message: MsgSubmitProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupPolicyAddress !== "") { + writer.uint32(10).string(message.groupPolicyAddress); + } + for (const v of message.proposers) { + writer.uint32(18).string(v!); + } + if (message.metadata !== "") { + writer.uint32(26).string(message.metadata); + } + for (const v of message.messages) { + Any.encode(v!, writer.uint32(34).fork()).ldelim(); + } + if (message.exec !== 0) { + writer.uint32(40).int32(message.exec); + } + if (message.title !== "") { + writer.uint32(50).string(message.title); + } + if (message.summary !== "") { + writer.uint32(58).string(message.summary); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupPolicyAddress = reader.string(); + break; + case 2: + message.proposers.push(reader.string()); + break; + case 3: + message.metadata = reader.string(); + break; + case 4: + message.messages.push(Any.decode(reader, reader.uint32())); + break; + case 5: + message.exec = (reader.int32() as any); + break; + case 6: + message.title = reader.string(); + break; + case 7: + message.summary = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSubmitProposal { + const message = createBaseMsgSubmitProposal(); + message.groupPolicyAddress = object.groupPolicyAddress ?? ""; + message.proposers = object.proposers?.map(e => e) || []; + message.metadata = object.metadata ?? ""; + message.messages = object.messages?.map(e => Any.fromPartial(e)) || []; + message.exec = object.exec ?? 0; + message.title = object.title ?? ""; + message.summary = object.summary ?? ""; + return message; + }, + fromAmino(object: MsgSubmitProposalAmino): MsgSubmitProposal { + const message = createBaseMsgSubmitProposal(); + if (object.group_policy_address !== undefined && object.group_policy_address !== null) { + message.groupPolicyAddress = object.group_policy_address; + } + message.proposers = object.proposers?.map(e => e) || []; + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + message.messages = object.messages?.map(e => Any.fromAmino(e)) || []; + if (object.exec !== undefined && object.exec !== null) { + message.exec = object.exec; + } + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.summary !== undefined && object.summary !== null) { + message.summary = object.summary; + } + return message; + }, + toAmino(message: MsgSubmitProposal): MsgSubmitProposalAmino { + const obj: any = {}; + obj.group_policy_address = message.groupPolicyAddress === "" ? undefined : message.groupPolicyAddress; + if (message.proposers) { + obj.proposers = message.proposers.map(e => e); + } else { + obj.proposers = message.proposers; + } + obj.metadata = message.metadata === "" ? undefined : message.metadata; + if (message.messages) { + obj.messages = message.messages.map(e => e ? Any.toAmino(e) : undefined); + } else { + obj.messages = message.messages; + } + obj.exec = message.exec === 0 ? undefined : message.exec; + obj.title = message.title === "" ? undefined : message.title; + obj.summary = message.summary === "" ? undefined : message.summary; + return obj; + }, + fromAminoMsg(object: MsgSubmitProposalAminoMsg): MsgSubmitProposal { + return MsgSubmitProposal.fromAmino(object.value); + }, + toAminoMsg(message: MsgSubmitProposal): MsgSubmitProposalAminoMsg { + return { + type: "cosmos-sdk/group/MsgSubmitProposal", + value: MsgSubmitProposal.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSubmitProposalProtoMsg): MsgSubmitProposal { + return MsgSubmitProposal.decode(message.value); + }, + toProto(message: MsgSubmitProposal): Uint8Array { + return MsgSubmitProposal.encode(message).finish(); + }, + toProtoMsg(message: MsgSubmitProposal): MsgSubmitProposalProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgSubmitProposal", + value: MsgSubmitProposal.encode(message).finish() + }; + } +}; +function createBaseMsgSubmitProposalResponse(): MsgSubmitProposalResponse { + return { + proposalId: BigInt(0) + }; +} +export const MsgSubmitProposalResponse = { + typeUrl: "/cosmos.group.v1.MsgSubmitProposalResponse", + encode(message: MsgSubmitProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSubmitProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitProposalResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSubmitProposalResponse { + const message = createBaseMsgSubmitProposalResponse(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgSubmitProposalResponseAmino): MsgSubmitProposalResponse { + const message = createBaseMsgSubmitProposalResponse(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + return message; + }, + toAmino(message: MsgSubmitProposalResponse): MsgSubmitProposalResponseAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgSubmitProposalResponseAminoMsg): MsgSubmitProposalResponse { + return MsgSubmitProposalResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSubmitProposalResponse): MsgSubmitProposalResponseAminoMsg { + return { + type: "cosmos-sdk/MsgSubmitProposalResponse", + value: MsgSubmitProposalResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSubmitProposalResponseProtoMsg): MsgSubmitProposalResponse { + return MsgSubmitProposalResponse.decode(message.value); + }, + toProto(message: MsgSubmitProposalResponse): Uint8Array { + return MsgSubmitProposalResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSubmitProposalResponse): MsgSubmitProposalResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgSubmitProposalResponse", + value: MsgSubmitProposalResponse.encode(message).finish() + }; + } +}; +function createBaseMsgWithdrawProposal(): MsgWithdrawProposal { + return { + proposalId: BigInt(0), + address: "" + }; +} +export const MsgWithdrawProposal = { + typeUrl: "/cosmos.group.v1.MsgWithdrawProposal", + encode(message: MsgWithdrawProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.address !== "") { + writer.uint32(18).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgWithdrawProposal { + const message = createBaseMsgWithdrawProposal(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: MsgWithdrawProposalAmino): MsgWithdrawProposal { + const message = createBaseMsgWithdrawProposal(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: MsgWithdrawProposal): MsgWithdrawProposalAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: MsgWithdrawProposalAminoMsg): MsgWithdrawProposal { + return MsgWithdrawProposal.fromAmino(object.value); + }, + toAminoMsg(message: MsgWithdrawProposal): MsgWithdrawProposalAminoMsg { + return { + type: "cosmos-sdk/group/MsgWithdrawProposal", + value: MsgWithdrawProposal.toAmino(message) + }; + }, + fromProtoMsg(message: MsgWithdrawProposalProtoMsg): MsgWithdrawProposal { + return MsgWithdrawProposal.decode(message.value); + }, + toProto(message: MsgWithdrawProposal): Uint8Array { + return MsgWithdrawProposal.encode(message).finish(); + }, + toProtoMsg(message: MsgWithdrawProposal): MsgWithdrawProposalProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgWithdrawProposal", + value: MsgWithdrawProposal.encode(message).finish() + }; + } +}; +function createBaseMsgWithdrawProposalResponse(): MsgWithdrawProposalResponse { + return {}; +} +export const MsgWithdrawProposalResponse = { + typeUrl: "/cosmos.group.v1.MsgWithdrawProposalResponse", + encode(_: MsgWithdrawProposalResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgWithdrawProposalResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgWithdrawProposalResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgWithdrawProposalResponse { + const message = createBaseMsgWithdrawProposalResponse(); + return message; + }, + fromAmino(_: MsgWithdrawProposalResponseAmino): MsgWithdrawProposalResponse { + const message = createBaseMsgWithdrawProposalResponse(); + return message; + }, + toAmino(_: MsgWithdrawProposalResponse): MsgWithdrawProposalResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgWithdrawProposalResponseAminoMsg): MsgWithdrawProposalResponse { + return MsgWithdrawProposalResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgWithdrawProposalResponse): MsgWithdrawProposalResponseAminoMsg { + return { + type: "cosmos-sdk/MsgWithdrawProposalResponse", + value: MsgWithdrawProposalResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgWithdrawProposalResponseProtoMsg): MsgWithdrawProposalResponse { + return MsgWithdrawProposalResponse.decode(message.value); + }, + toProto(message: MsgWithdrawProposalResponse): Uint8Array { + return MsgWithdrawProposalResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgWithdrawProposalResponse): MsgWithdrawProposalResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgWithdrawProposalResponse", + value: MsgWithdrawProposalResponse.encode(message).finish() + }; + } +}; +function createBaseMsgVote(): MsgVote { + return { + proposalId: BigInt(0), + voter: "", + option: 0, + metadata: "", + exec: 0 + }; +} +export const MsgVote = { + typeUrl: "/cosmos.group.v1.MsgVote", + encode(message: MsgVote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.voter !== "") { + writer.uint32(18).string(message.voter); + } + if (message.option !== 0) { + writer.uint32(24).int32(message.option); + } + if (message.metadata !== "") { + writer.uint32(34).string(message.metadata); + } + if (message.exec !== 0) { + writer.uint32(40).int32(message.exec); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgVote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgVote(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.voter = reader.string(); + break; + case 3: + message.option = (reader.int32() as any); + break; + case 4: + message.metadata = reader.string(); + break; + case 5: + message.exec = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgVote { + const message = createBaseMsgVote(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.voter = object.voter ?? ""; + message.option = object.option ?? 0; + message.metadata = object.metadata ?? ""; + message.exec = object.exec ?? 0; + return message; + }, + fromAmino(object: MsgVoteAmino): MsgVote { + const message = createBaseMsgVote(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + if (object.option !== undefined && object.option !== null) { + message.option = object.option; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + if (object.exec !== undefined && object.exec !== null) { + message.exec = object.exec; + } + return message; + }, + toAmino(message: MsgVote): MsgVoteAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.voter = message.voter === "" ? undefined : message.voter; + obj.option = message.option === 0 ? undefined : message.option; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + obj.exec = message.exec === 0 ? undefined : message.exec; + return obj; + }, + fromAminoMsg(object: MsgVoteAminoMsg): MsgVote { + return MsgVote.fromAmino(object.value); + }, + toAminoMsg(message: MsgVote): MsgVoteAminoMsg { + return { + type: "cosmos-sdk/group/MsgVote", + value: MsgVote.toAmino(message) + }; + }, + fromProtoMsg(message: MsgVoteProtoMsg): MsgVote { + return MsgVote.decode(message.value); + }, + toProto(message: MsgVote): Uint8Array { + return MsgVote.encode(message).finish(); + }, + toProtoMsg(message: MsgVote): MsgVoteProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgVote", + value: MsgVote.encode(message).finish() + }; + } +}; +function createBaseMsgVoteResponse(): MsgVoteResponse { + return {}; +} +export const MsgVoteResponse = { + typeUrl: "/cosmos.group.v1.MsgVoteResponse", + encode(_: MsgVoteResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgVoteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgVoteResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgVoteResponse { + const message = createBaseMsgVoteResponse(); + return message; + }, + fromAmino(_: MsgVoteResponseAmino): MsgVoteResponse { + const message = createBaseMsgVoteResponse(); + return message; + }, + toAmino(_: MsgVoteResponse): MsgVoteResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgVoteResponseAminoMsg): MsgVoteResponse { + return MsgVoteResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgVoteResponse): MsgVoteResponseAminoMsg { + return { + type: "cosmos-sdk/MsgVoteResponse", + value: MsgVoteResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgVoteResponseProtoMsg): MsgVoteResponse { + return MsgVoteResponse.decode(message.value); + }, + toProto(message: MsgVoteResponse): Uint8Array { + return MsgVoteResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgVoteResponse): MsgVoteResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgVoteResponse", + value: MsgVoteResponse.encode(message).finish() + }; + } +}; +function createBaseMsgExec(): MsgExec { + return { + proposalId: BigInt(0), + executor: "" + }; +} +export const MsgExec = { + typeUrl: "/cosmos.group.v1.MsgExec", + encode(message: MsgExec, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.executor !== "") { + writer.uint32(18).string(message.executor); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgExec { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExec(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.executor = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgExec { + const message = createBaseMsgExec(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.executor = object.executor ?? ""; + return message; + }, + fromAmino(object: MsgExecAmino): MsgExec { + const message = createBaseMsgExec(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.executor !== undefined && object.executor !== null) { + message.executor = object.executor; + } + return message; + }, + toAmino(message: MsgExec): MsgExecAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.executor = message.executor === "" ? undefined : message.executor; + return obj; + }, + fromAminoMsg(object: MsgExecAminoMsg): MsgExec { + return MsgExec.fromAmino(object.value); + }, + toAminoMsg(message: MsgExec): MsgExecAminoMsg { + return { + type: "cosmos-sdk/group/MsgExec", + value: MsgExec.toAmino(message) + }; + }, + fromProtoMsg(message: MsgExecProtoMsg): MsgExec { + return MsgExec.decode(message.value); + }, + toProto(message: MsgExec): Uint8Array { + return MsgExec.encode(message).finish(); + }, + toProtoMsg(message: MsgExec): MsgExecProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgExec", + value: MsgExec.encode(message).finish() + }; + } +}; +function createBaseMsgExecResponse(): MsgExecResponse { + return { + result: 0 + }; +} +export const MsgExecResponse = { + typeUrl: "/cosmos.group.v1.MsgExecResponse", + encode(message: MsgExecResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.result !== 0) { + writer.uint32(16).int32(message.result); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgExecResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExecResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.result = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgExecResponse { + const message = createBaseMsgExecResponse(); + message.result = object.result ?? 0; + return message; + }, + fromAmino(object: MsgExecResponseAmino): MsgExecResponse { + const message = createBaseMsgExecResponse(); + if (object.result !== undefined && object.result !== null) { + message.result = object.result; + } + return message; + }, + toAmino(message: MsgExecResponse): MsgExecResponseAmino { + const obj: any = {}; + obj.result = message.result === 0 ? undefined : message.result; + return obj; + }, + fromAminoMsg(object: MsgExecResponseAminoMsg): MsgExecResponse { + return MsgExecResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgExecResponse): MsgExecResponseAminoMsg { + return { + type: "cosmos-sdk/MsgExecResponse", + value: MsgExecResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgExecResponseProtoMsg): MsgExecResponse { + return MsgExecResponse.decode(message.value); + }, + toProto(message: MsgExecResponse): Uint8Array { + return MsgExecResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgExecResponse): MsgExecResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgExecResponse", + value: MsgExecResponse.encode(message).finish() + }; + } +}; +function createBaseMsgLeaveGroup(): MsgLeaveGroup { + return { + address: "", + groupId: BigInt(0) + }; +} +export const MsgLeaveGroup = { + typeUrl: "/cosmos.group.v1.MsgLeaveGroup", + encode(message: MsgLeaveGroup, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.groupId !== BigInt(0)) { + writer.uint32(16).uint64(message.groupId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgLeaveGroup { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgLeaveGroup(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.groupId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgLeaveGroup { + const message = createBaseMsgLeaveGroup(); + message.address = object.address ?? ""; + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgLeaveGroupAmino): MsgLeaveGroup { + const message = createBaseMsgLeaveGroup(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + return message; + }, + toAmino(message: MsgLeaveGroup): MsgLeaveGroupAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgLeaveGroupAminoMsg): MsgLeaveGroup { + return MsgLeaveGroup.fromAmino(object.value); + }, + toAminoMsg(message: MsgLeaveGroup): MsgLeaveGroupAminoMsg { + return { + type: "cosmos-sdk/group/MsgLeaveGroup", + value: MsgLeaveGroup.toAmino(message) + }; + }, + fromProtoMsg(message: MsgLeaveGroupProtoMsg): MsgLeaveGroup { + return MsgLeaveGroup.decode(message.value); + }, + toProto(message: MsgLeaveGroup): Uint8Array { + return MsgLeaveGroup.encode(message).finish(); + }, + toProtoMsg(message: MsgLeaveGroup): MsgLeaveGroupProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgLeaveGroup", + value: MsgLeaveGroup.encode(message).finish() + }; + } +}; +function createBaseMsgLeaveGroupResponse(): MsgLeaveGroupResponse { + return {}; +} +export const MsgLeaveGroupResponse = { + typeUrl: "/cosmos.group.v1.MsgLeaveGroupResponse", + encode(_: MsgLeaveGroupResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgLeaveGroupResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgLeaveGroupResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgLeaveGroupResponse { + const message = createBaseMsgLeaveGroupResponse(); + return message; + }, + fromAmino(_: MsgLeaveGroupResponseAmino): MsgLeaveGroupResponse { + const message = createBaseMsgLeaveGroupResponse(); + return message; + }, + toAmino(_: MsgLeaveGroupResponse): MsgLeaveGroupResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgLeaveGroupResponseAminoMsg): MsgLeaveGroupResponse { + return MsgLeaveGroupResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgLeaveGroupResponse): MsgLeaveGroupResponseAminoMsg { + return { + type: "cosmos-sdk/MsgLeaveGroupResponse", + value: MsgLeaveGroupResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgLeaveGroupResponseProtoMsg): MsgLeaveGroupResponse { + return MsgLeaveGroupResponse.decode(message.value); + }, + toProto(message: MsgLeaveGroupResponse): Uint8Array { + return MsgLeaveGroupResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgLeaveGroupResponse): MsgLeaveGroupResponseProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MsgLeaveGroupResponse", + value: MsgLeaveGroupResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/group/v1/types.ts b/src/codegen/cosmos/group/v1/types.ts new file mode 100644 index 0000000..3800395 --- /dev/null +++ b/src/codegen/cosmos/group/v1/types.ts @@ -0,0 +1,2091 @@ +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { Duration, DurationAmino, DurationSDKType } from "../../../google/protobuf/duration"; +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { toTimestamp, fromTimestamp } from "../../../helpers"; +/** VoteOption enumerates the valid vote options for a given proposal. */ +export enum VoteOption { + /** + * VOTE_OPTION_UNSPECIFIED - VOTE_OPTION_UNSPECIFIED defines an unspecified vote option which will + * return an error. + */ + VOTE_OPTION_UNSPECIFIED = 0, + /** VOTE_OPTION_YES - VOTE_OPTION_YES defines a yes vote option. */ + VOTE_OPTION_YES = 1, + /** VOTE_OPTION_ABSTAIN - VOTE_OPTION_ABSTAIN defines an abstain vote option. */ + VOTE_OPTION_ABSTAIN = 2, + /** VOTE_OPTION_NO - VOTE_OPTION_NO defines a no vote option. */ + VOTE_OPTION_NO = 3, + /** VOTE_OPTION_NO_WITH_VETO - VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. */ + VOTE_OPTION_NO_WITH_VETO = 4, + UNRECOGNIZED = -1, +} +export const VoteOptionSDKType = VoteOption; +export const VoteOptionAmino = VoteOption; +export function voteOptionFromJSON(object: any): VoteOption { + switch (object) { + case 0: + case "VOTE_OPTION_UNSPECIFIED": + return VoteOption.VOTE_OPTION_UNSPECIFIED; + case 1: + case "VOTE_OPTION_YES": + return VoteOption.VOTE_OPTION_YES; + case 2: + case "VOTE_OPTION_ABSTAIN": + return VoteOption.VOTE_OPTION_ABSTAIN; + case 3: + case "VOTE_OPTION_NO": + return VoteOption.VOTE_OPTION_NO; + case 4: + case "VOTE_OPTION_NO_WITH_VETO": + return VoteOption.VOTE_OPTION_NO_WITH_VETO; + case -1: + case "UNRECOGNIZED": + default: + return VoteOption.UNRECOGNIZED; + } +} +export function voteOptionToJSON(object: VoteOption): string { + switch (object) { + case VoteOption.VOTE_OPTION_UNSPECIFIED: + return "VOTE_OPTION_UNSPECIFIED"; + case VoteOption.VOTE_OPTION_YES: + return "VOTE_OPTION_YES"; + case VoteOption.VOTE_OPTION_ABSTAIN: + return "VOTE_OPTION_ABSTAIN"; + case VoteOption.VOTE_OPTION_NO: + return "VOTE_OPTION_NO"; + case VoteOption.VOTE_OPTION_NO_WITH_VETO: + return "VOTE_OPTION_NO_WITH_VETO"; + case VoteOption.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** ProposalStatus defines proposal statuses. */ +export enum ProposalStatus { + /** PROPOSAL_STATUS_UNSPECIFIED - An empty value is invalid and not allowed. */ + PROPOSAL_STATUS_UNSPECIFIED = 0, + /** PROPOSAL_STATUS_SUBMITTED - Initial status of a proposal when submitted. */ + PROPOSAL_STATUS_SUBMITTED = 1, + /** + * PROPOSAL_STATUS_ACCEPTED - Final status of a proposal when the final tally is done and the outcome + * passes the group policy's decision policy. + */ + PROPOSAL_STATUS_ACCEPTED = 2, + /** + * PROPOSAL_STATUS_REJECTED - Final status of a proposal when the final tally is done and the outcome + * is rejected by the group policy's decision policy. + */ + PROPOSAL_STATUS_REJECTED = 3, + /** + * PROPOSAL_STATUS_ABORTED - Final status of a proposal when the group policy is modified before the + * final tally. + */ + PROPOSAL_STATUS_ABORTED = 4, + /** + * PROPOSAL_STATUS_WITHDRAWN - A proposal can be withdrawn before the voting start time by the owner. + * When this happens the final status is Withdrawn. + */ + PROPOSAL_STATUS_WITHDRAWN = 5, + UNRECOGNIZED = -1, +} +export const ProposalStatusSDKType = ProposalStatus; +export const ProposalStatusAmino = ProposalStatus; +export function proposalStatusFromJSON(object: any): ProposalStatus { + switch (object) { + case 0: + case "PROPOSAL_STATUS_UNSPECIFIED": + return ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED; + case 1: + case "PROPOSAL_STATUS_SUBMITTED": + return ProposalStatus.PROPOSAL_STATUS_SUBMITTED; + case 2: + case "PROPOSAL_STATUS_ACCEPTED": + return ProposalStatus.PROPOSAL_STATUS_ACCEPTED; + case 3: + case "PROPOSAL_STATUS_REJECTED": + return ProposalStatus.PROPOSAL_STATUS_REJECTED; + case 4: + case "PROPOSAL_STATUS_ABORTED": + return ProposalStatus.PROPOSAL_STATUS_ABORTED; + case 5: + case "PROPOSAL_STATUS_WITHDRAWN": + return ProposalStatus.PROPOSAL_STATUS_WITHDRAWN; + case -1: + case "UNRECOGNIZED": + default: + return ProposalStatus.UNRECOGNIZED; + } +} +export function proposalStatusToJSON(object: ProposalStatus): string { + switch (object) { + case ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED: + return "PROPOSAL_STATUS_UNSPECIFIED"; + case ProposalStatus.PROPOSAL_STATUS_SUBMITTED: + return "PROPOSAL_STATUS_SUBMITTED"; + case ProposalStatus.PROPOSAL_STATUS_ACCEPTED: + return "PROPOSAL_STATUS_ACCEPTED"; + case ProposalStatus.PROPOSAL_STATUS_REJECTED: + return "PROPOSAL_STATUS_REJECTED"; + case ProposalStatus.PROPOSAL_STATUS_ABORTED: + return "PROPOSAL_STATUS_ABORTED"; + case ProposalStatus.PROPOSAL_STATUS_WITHDRAWN: + return "PROPOSAL_STATUS_WITHDRAWN"; + case ProposalStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** ProposalExecutorResult defines types of proposal executor results. */ +export enum ProposalExecutorResult { + /** PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED - An empty value is not allowed. */ + PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED = 0, + /** PROPOSAL_EXECUTOR_RESULT_NOT_RUN - We have not yet run the executor. */ + PROPOSAL_EXECUTOR_RESULT_NOT_RUN = 1, + /** PROPOSAL_EXECUTOR_RESULT_SUCCESS - The executor was successful and proposed action updated state. */ + PROPOSAL_EXECUTOR_RESULT_SUCCESS = 2, + /** PROPOSAL_EXECUTOR_RESULT_FAILURE - The executor returned an error and proposed action didn't update state. */ + PROPOSAL_EXECUTOR_RESULT_FAILURE = 3, + UNRECOGNIZED = -1, +} +export const ProposalExecutorResultSDKType = ProposalExecutorResult; +export const ProposalExecutorResultAmino = ProposalExecutorResult; +export function proposalExecutorResultFromJSON(object: any): ProposalExecutorResult { + switch (object) { + case 0: + case "PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED": + return ProposalExecutorResult.PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED; + case 1: + case "PROPOSAL_EXECUTOR_RESULT_NOT_RUN": + return ProposalExecutorResult.PROPOSAL_EXECUTOR_RESULT_NOT_RUN; + case 2: + case "PROPOSAL_EXECUTOR_RESULT_SUCCESS": + return ProposalExecutorResult.PROPOSAL_EXECUTOR_RESULT_SUCCESS; + case 3: + case "PROPOSAL_EXECUTOR_RESULT_FAILURE": + return ProposalExecutorResult.PROPOSAL_EXECUTOR_RESULT_FAILURE; + case -1: + case "UNRECOGNIZED": + default: + return ProposalExecutorResult.UNRECOGNIZED; + } +} +export function proposalExecutorResultToJSON(object: ProposalExecutorResult): string { + switch (object) { + case ProposalExecutorResult.PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED: + return "PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED"; + case ProposalExecutorResult.PROPOSAL_EXECUTOR_RESULT_NOT_RUN: + return "PROPOSAL_EXECUTOR_RESULT_NOT_RUN"; + case ProposalExecutorResult.PROPOSAL_EXECUTOR_RESULT_SUCCESS: + return "PROPOSAL_EXECUTOR_RESULT_SUCCESS"; + case ProposalExecutorResult.PROPOSAL_EXECUTOR_RESULT_FAILURE: + return "PROPOSAL_EXECUTOR_RESULT_FAILURE"; + case ProposalExecutorResult.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * Member represents a group member with an account address, + * non-zero weight, metadata and added_at timestamp. + */ +export interface Member { + /** address is the member's account address. */ + address: string; + /** weight is the member's voting weight that should be greater than 0. */ + weight: string; + /** metadata is any arbitrary metadata attached to the member. */ + metadata: string; + /** added_at is a timestamp specifying when a member was added. */ + addedAt: Date; +} +export interface MemberProtoMsg { + typeUrl: "/cosmos.group.v1.Member"; + value: Uint8Array; +} +/** + * Member represents a group member with an account address, + * non-zero weight, metadata and added_at timestamp. + */ +export interface MemberAmino { + /** address is the member's account address. */ + address?: string; + /** weight is the member's voting weight that should be greater than 0. */ + weight?: string; + /** metadata is any arbitrary metadata attached to the member. */ + metadata?: string; + /** added_at is a timestamp specifying when a member was added. */ + added_at: string; +} +export interface MemberAminoMsg { + type: "cosmos-sdk/Member"; + value: MemberAmino; +} +/** + * Member represents a group member with an account address, + * non-zero weight, metadata and added_at timestamp. + */ +export interface MemberSDKType { + address: string; + weight: string; + metadata: string; + added_at: Date; +} +/** + * MemberRequest represents a group member to be used in Msg server requests. + * Contrary to `Member`, it doesn't have any `added_at` field + * since this field cannot be set as part of requests. + */ +export interface MemberRequest { + /** address is the member's account address. */ + address: string; + /** weight is the member's voting weight that should be greater than 0. */ + weight: string; + /** metadata is any arbitrary metadata attached to the member. */ + metadata: string; +} +export interface MemberRequestProtoMsg { + typeUrl: "/cosmos.group.v1.MemberRequest"; + value: Uint8Array; +} +/** + * MemberRequest represents a group member to be used in Msg server requests. + * Contrary to `Member`, it doesn't have any `added_at` field + * since this field cannot be set as part of requests. + */ +export interface MemberRequestAmino { + /** address is the member's account address. */ + address?: string; + /** weight is the member's voting weight that should be greater than 0. */ + weight?: string; + /** metadata is any arbitrary metadata attached to the member. */ + metadata?: string; +} +export interface MemberRequestAminoMsg { + type: "cosmos-sdk/MemberRequest"; + value: MemberRequestAmino; +} +/** + * MemberRequest represents a group member to be used in Msg server requests. + * Contrary to `Member`, it doesn't have any `added_at` field + * since this field cannot be set as part of requests. + */ +export interface MemberRequestSDKType { + address: string; + weight: string; + metadata: string; +} +/** + * ThresholdDecisionPolicy is a decision policy where a proposal passes when it + * satisfies the two following conditions: + * 1. The sum of all `YES` voter's weights is greater or equal than the defined + * `threshold`. + * 2. The voting and execution periods of the proposal respect the parameters + * given by `windows`. + */ +export interface ThresholdDecisionPolicy { + /** + * threshold is the minimum weighted sum of `YES` votes that must be met or + * exceeded for a proposal to succeed. + */ + threshold: string; + /** windows defines the different windows for voting and execution. */ + windows?: DecisionPolicyWindows; +} +export interface ThresholdDecisionPolicyProtoMsg { + typeUrl: "/cosmos.group.v1.ThresholdDecisionPolicy"; + value: Uint8Array; +} +/** + * ThresholdDecisionPolicy is a decision policy where a proposal passes when it + * satisfies the two following conditions: + * 1. The sum of all `YES` voter's weights is greater or equal than the defined + * `threshold`. + * 2. The voting and execution periods of the proposal respect the parameters + * given by `windows`. + */ +export interface ThresholdDecisionPolicyAmino { + /** + * threshold is the minimum weighted sum of `YES` votes that must be met or + * exceeded for a proposal to succeed. + */ + threshold?: string; + /** windows defines the different windows for voting and execution. */ + windows?: DecisionPolicyWindowsAmino; +} +export interface ThresholdDecisionPolicyAminoMsg { + type: "cosmos-sdk/ThresholdDecisionPolicy"; + value: ThresholdDecisionPolicyAmino; +} +/** + * ThresholdDecisionPolicy is a decision policy where a proposal passes when it + * satisfies the two following conditions: + * 1. The sum of all `YES` voter's weights is greater or equal than the defined + * `threshold`. + * 2. The voting and execution periods of the proposal respect the parameters + * given by `windows`. + */ +export interface ThresholdDecisionPolicySDKType { + threshold: string; + windows?: DecisionPolicyWindowsSDKType; +} +/** + * PercentageDecisionPolicy is a decision policy where a proposal passes when + * it satisfies the two following conditions: + * 1. The percentage of all `YES` voters' weights out of the total group weight + * is greater or equal than the given `percentage`. + * 2. The voting and execution periods of the proposal respect the parameters + * given by `windows`. + */ +export interface PercentageDecisionPolicy { + /** + * percentage is the minimum percentage of the weighted sum of `YES` votes must + * meet for a proposal to succeed. + */ + percentage: string; + /** windows defines the different windows for voting and execution. */ + windows?: DecisionPolicyWindows; +} +export interface PercentageDecisionPolicyProtoMsg { + typeUrl: "/cosmos.group.v1.PercentageDecisionPolicy"; + value: Uint8Array; +} +/** + * PercentageDecisionPolicy is a decision policy where a proposal passes when + * it satisfies the two following conditions: + * 1. The percentage of all `YES` voters' weights out of the total group weight + * is greater or equal than the given `percentage`. + * 2. The voting and execution periods of the proposal respect the parameters + * given by `windows`. + */ +export interface PercentageDecisionPolicyAmino { + /** + * percentage is the minimum percentage of the weighted sum of `YES` votes must + * meet for a proposal to succeed. + */ + percentage?: string; + /** windows defines the different windows for voting and execution. */ + windows?: DecisionPolicyWindowsAmino; +} +export interface PercentageDecisionPolicyAminoMsg { + type: "cosmos-sdk/PercentageDecisionPolicy"; + value: PercentageDecisionPolicyAmino; +} +/** + * PercentageDecisionPolicy is a decision policy where a proposal passes when + * it satisfies the two following conditions: + * 1. The percentage of all `YES` voters' weights out of the total group weight + * is greater or equal than the given `percentage`. + * 2. The voting and execution periods of the proposal respect the parameters + * given by `windows`. + */ +export interface PercentageDecisionPolicySDKType { + percentage: string; + windows?: DecisionPolicyWindowsSDKType; +} +/** DecisionPolicyWindows defines the different windows for voting and execution. */ +export interface DecisionPolicyWindows { + /** + * voting_period is the duration from submission of a proposal to the end of voting period + * Within this times votes can be submitted with MsgVote. + */ + votingPeriod: Duration; + /** + * min_execution_period is the minimum duration after the proposal submission + * where members can start sending MsgExec. This means that the window for + * sending a MsgExec transaction is: + * `[ submission + min_execution_period ; submission + voting_period + max_execution_period]` + * where max_execution_period is a app-specific config, defined in the keeper. + * If not set, min_execution_period will default to 0. + * + * Please make sure to set a `min_execution_period` that is smaller than + * `voting_period + max_execution_period`, or else the above execution window + * is empty, meaning that all proposals created with this decision policy + * won't be able to be executed. + */ + minExecutionPeriod: Duration; +} +export interface DecisionPolicyWindowsProtoMsg { + typeUrl: "/cosmos.group.v1.DecisionPolicyWindows"; + value: Uint8Array; +} +/** DecisionPolicyWindows defines the different windows for voting and execution. */ +export interface DecisionPolicyWindowsAmino { + /** + * voting_period is the duration from submission of a proposal to the end of voting period + * Within this times votes can be submitted with MsgVote. + */ + voting_period: DurationAmino; + /** + * min_execution_period is the minimum duration after the proposal submission + * where members can start sending MsgExec. This means that the window for + * sending a MsgExec transaction is: + * `[ submission + min_execution_period ; submission + voting_period + max_execution_period]` + * where max_execution_period is a app-specific config, defined in the keeper. + * If not set, min_execution_period will default to 0. + * + * Please make sure to set a `min_execution_period` that is smaller than + * `voting_period + max_execution_period`, or else the above execution window + * is empty, meaning that all proposals created with this decision policy + * won't be able to be executed. + */ + min_execution_period: DurationAmino; +} +export interface DecisionPolicyWindowsAminoMsg { + type: "cosmos-sdk/DecisionPolicyWindows"; + value: DecisionPolicyWindowsAmino; +} +/** DecisionPolicyWindows defines the different windows for voting and execution. */ +export interface DecisionPolicyWindowsSDKType { + voting_period: DurationSDKType; + min_execution_period: DurationSDKType; +} +/** GroupInfo represents the high-level on-chain information for a group. */ +export interface GroupInfo { + /** id is the unique ID of the group. */ + id: bigint; + /** admin is the account address of the group's admin. */ + admin: string; + /** + * metadata is any arbitrary metadata to attached to the group. + * the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/group#group-1 + */ + metadata: string; + /** + * version is used to track changes to a group's membership structure that + * would break existing proposals. Whenever any members weight is changed, + * or any member is added or removed this version is incremented and will + * cause proposals based on older versions of this group to fail + */ + version: bigint; + /** total_weight is the sum of the group members' weights. */ + totalWeight: string; + /** created_at is a timestamp specifying when a group was created. */ + createdAt: Date; +} +export interface GroupInfoProtoMsg { + typeUrl: "/cosmos.group.v1.GroupInfo"; + value: Uint8Array; +} +/** GroupInfo represents the high-level on-chain information for a group. */ +export interface GroupInfoAmino { + /** id is the unique ID of the group. */ + id?: string; + /** admin is the account address of the group's admin. */ + admin?: string; + /** + * metadata is any arbitrary metadata to attached to the group. + * the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/group#group-1 + */ + metadata?: string; + /** + * version is used to track changes to a group's membership structure that + * would break existing proposals. Whenever any members weight is changed, + * or any member is added or removed this version is incremented and will + * cause proposals based on older versions of this group to fail + */ + version?: string; + /** total_weight is the sum of the group members' weights. */ + total_weight?: string; + /** created_at is a timestamp specifying when a group was created. */ + created_at: string; +} +export interface GroupInfoAminoMsg { + type: "cosmos-sdk/GroupInfo"; + value: GroupInfoAmino; +} +/** GroupInfo represents the high-level on-chain information for a group. */ +export interface GroupInfoSDKType { + id: bigint; + admin: string; + metadata: string; + version: bigint; + total_weight: string; + created_at: Date; +} +/** GroupMember represents the relationship between a group and a member. */ +export interface GroupMember { + /** group_id is the unique ID of the group. */ + groupId: bigint; + /** member is the member data. */ + member?: Member; +} +export interface GroupMemberProtoMsg { + typeUrl: "/cosmos.group.v1.GroupMember"; + value: Uint8Array; +} +/** GroupMember represents the relationship between a group and a member. */ +export interface GroupMemberAmino { + /** group_id is the unique ID of the group. */ + group_id?: string; + /** member is the member data. */ + member?: MemberAmino; +} +export interface GroupMemberAminoMsg { + type: "cosmos-sdk/GroupMember"; + value: GroupMemberAmino; +} +/** GroupMember represents the relationship between a group and a member. */ +export interface GroupMemberSDKType { + group_id: bigint; + member?: MemberSDKType; +} +/** GroupPolicyInfo represents the high-level on-chain information for a group policy. */ +export interface GroupPolicyInfo { + /** address is the account address of group policy. */ + address: string; + /** group_id is the unique ID of the group. */ + groupId: bigint; + /** admin is the account address of the group admin. */ + admin: string; + /** + * metadata is any arbitrary metadata attached to the group policy. + * the recommended format of the metadata is to be found here: + * https://docs.cosmos.network/v0.47/modules/group#decision-policy-1 + */ + metadata: string; + /** + * version is used to track changes to a group's GroupPolicyInfo structure that + * would create a different result on a running proposal. + */ + version: bigint; + /** decision_policy specifies the group policy's decision policy. */ + decisionPolicy?: Any; + /** created_at is a timestamp specifying when a group policy was created. */ + createdAt: Date; +} +export interface GroupPolicyInfoProtoMsg { + typeUrl: "/cosmos.group.v1.GroupPolicyInfo"; + value: Uint8Array; +} +/** GroupPolicyInfo represents the high-level on-chain information for a group policy. */ +export interface GroupPolicyInfoAmino { + /** address is the account address of group policy. */ + address?: string; + /** group_id is the unique ID of the group. */ + group_id?: string; + /** admin is the account address of the group admin. */ + admin?: string; + /** + * metadata is any arbitrary metadata attached to the group policy. + * the recommended format of the metadata is to be found here: + * https://docs.cosmos.network/v0.47/modules/group#decision-policy-1 + */ + metadata?: string; + /** + * version is used to track changes to a group's GroupPolicyInfo structure that + * would create a different result on a running proposal. + */ + version?: string; + /** decision_policy specifies the group policy's decision policy. */ + decision_policy?: AnyAmino; + /** created_at is a timestamp specifying when a group policy was created. */ + created_at: string; +} +export interface GroupPolicyInfoAminoMsg { + type: "cosmos-sdk/GroupPolicyInfo"; + value: GroupPolicyInfoAmino; +} +/** GroupPolicyInfo represents the high-level on-chain information for a group policy. */ +export interface GroupPolicyInfoSDKType { + address: string; + group_id: bigint; + admin: string; + metadata: string; + version: bigint; + decision_policy?: AnySDKType; + created_at: Date; +} +/** + * Proposal defines a group proposal. Any member of a group can submit a proposal + * for a group policy to decide upon. + * A proposal consists of a set of `sdk.Msg`s that will be executed if the proposal + * passes as well as some optional metadata associated with the proposal. + */ +export interface Proposal { + /** id is the unique id of the proposal. */ + id: bigint; + /** group_policy_address is the account address of group policy. */ + groupPolicyAddress: string; + /** + * metadata is any arbitrary metadata attached to the proposal. + * the recommended format of the metadata is to be found here: + * https://docs.cosmos.network/v0.47/modules/group#proposal-4 + */ + metadata: string; + /** proposers are the account addresses of the proposers. */ + proposers: string[]; + /** submit_time is a timestamp specifying when a proposal was submitted. */ + submitTime: Date; + /** + * group_version tracks the version of the group at proposal submission. + * This field is here for informational purposes only. + */ + groupVersion: bigint; + /** + * group_policy_version tracks the version of the group policy at proposal submission. + * When a decision policy is changed, existing proposals from previous policy + * versions will become invalid with the `ABORTED` status. + * This field is here for informational purposes only. + */ + groupPolicyVersion: bigint; + /** status represents the high level position in the life cycle of the proposal. Initial value is Submitted. */ + status: ProposalStatus; + /** + * final_tally_result contains the sums of all weighted votes for this + * proposal for each vote option. It is empty at submission, and only + * populated after tallying, at voting period end or at proposal execution, + * whichever happens first. + */ + finalTallyResult: TallyResult; + /** + * voting_period_end is the timestamp before which voting must be done. + * Unless a successful MsgExec is called before (to execute a proposal whose + * tally is successful before the voting period ends), tallying will be done + * at this point, and the `final_tally_result`and `status` fields will be + * accordingly updated. + */ + votingPeriodEnd: Date; + /** executor_result is the final result of the proposal execution. Initial value is NotRun. */ + executorResult: ProposalExecutorResult; + /** messages is a list of `sdk.Msg`s that will be executed if the proposal passes. */ + messages: Any[]; + /** + * title is the title of the proposal + * + * Since: cosmos-sdk 0.47 + */ + title: string; + /** + * summary is a short summary of the proposal + * + * Since: cosmos-sdk 0.47 + */ + summary: string; +} +export interface ProposalProtoMsg { + typeUrl: "/cosmos.group.v1.Proposal"; + value: Uint8Array; +} +/** + * Proposal defines a group proposal. Any member of a group can submit a proposal + * for a group policy to decide upon. + * A proposal consists of a set of `sdk.Msg`s that will be executed if the proposal + * passes as well as some optional metadata associated with the proposal. + */ +export interface ProposalAmino { + /** id is the unique id of the proposal. */ + id?: string; + /** group_policy_address is the account address of group policy. */ + group_policy_address?: string; + /** + * metadata is any arbitrary metadata attached to the proposal. + * the recommended format of the metadata is to be found here: + * https://docs.cosmos.network/v0.47/modules/group#proposal-4 + */ + metadata?: string; + /** proposers are the account addresses of the proposers. */ + proposers?: string[]; + /** submit_time is a timestamp specifying when a proposal was submitted. */ + submit_time: string; + /** + * group_version tracks the version of the group at proposal submission. + * This field is here for informational purposes only. + */ + group_version?: string; + /** + * group_policy_version tracks the version of the group policy at proposal submission. + * When a decision policy is changed, existing proposals from previous policy + * versions will become invalid with the `ABORTED` status. + * This field is here for informational purposes only. + */ + group_policy_version?: string; + /** status represents the high level position in the life cycle of the proposal. Initial value is Submitted. */ + status?: ProposalStatus; + /** + * final_tally_result contains the sums of all weighted votes for this + * proposal for each vote option. It is empty at submission, and only + * populated after tallying, at voting period end or at proposal execution, + * whichever happens first. + */ + final_tally_result: TallyResultAmino; + /** + * voting_period_end is the timestamp before which voting must be done. + * Unless a successful MsgExec is called before (to execute a proposal whose + * tally is successful before the voting period ends), tallying will be done + * at this point, and the `final_tally_result`and `status` fields will be + * accordingly updated. + */ + voting_period_end: string; + /** executor_result is the final result of the proposal execution. Initial value is NotRun. */ + executor_result?: ProposalExecutorResult; + /** messages is a list of `sdk.Msg`s that will be executed if the proposal passes. */ + messages?: AnyAmino[]; + /** + * title is the title of the proposal + * + * Since: cosmos-sdk 0.47 + */ + title?: string; + /** + * summary is a short summary of the proposal + * + * Since: cosmos-sdk 0.47 + */ + summary?: string; +} +export interface ProposalAminoMsg { + type: "cosmos-sdk/Proposal"; + value: ProposalAmino; +} +/** + * Proposal defines a group proposal. Any member of a group can submit a proposal + * for a group policy to decide upon. + * A proposal consists of a set of `sdk.Msg`s that will be executed if the proposal + * passes as well as some optional metadata associated with the proposal. + */ +export interface ProposalSDKType { + id: bigint; + group_policy_address: string; + metadata: string; + proposers: string[]; + submit_time: Date; + group_version: bigint; + group_policy_version: bigint; + status: ProposalStatus; + final_tally_result: TallyResultSDKType; + voting_period_end: Date; + executor_result: ProposalExecutorResult; + messages: AnySDKType[]; + title: string; + summary: string; +} +/** TallyResult represents the sum of weighted votes for each vote option. */ +export interface TallyResult { + /** yes_count is the weighted sum of yes votes. */ + yesCount: string; + /** abstain_count is the weighted sum of abstainers. */ + abstainCount: string; + /** no_count is the weighted sum of no votes. */ + noCount: string; + /** no_with_veto_count is the weighted sum of veto. */ + noWithVetoCount: string; +} +export interface TallyResultProtoMsg { + typeUrl: "/cosmos.group.v1.TallyResult"; + value: Uint8Array; +} +/** TallyResult represents the sum of weighted votes for each vote option. */ +export interface TallyResultAmino { + /** yes_count is the weighted sum of yes votes. */ + yes_count?: string; + /** abstain_count is the weighted sum of abstainers. */ + abstain_count?: string; + /** no_count is the weighted sum of no votes. */ + no_count?: string; + /** no_with_veto_count is the weighted sum of veto. */ + no_with_veto_count?: string; +} +export interface TallyResultAminoMsg { + type: "cosmos-sdk/TallyResult"; + value: TallyResultAmino; +} +/** TallyResult represents the sum of weighted votes for each vote option. */ +export interface TallyResultSDKType { + yes_count: string; + abstain_count: string; + no_count: string; + no_with_veto_count: string; +} +/** Vote represents a vote for a proposal.string metadata */ +export interface Vote { + /** proposal is the unique ID of the proposal. */ + proposalId: bigint; + /** voter is the account address of the voter. */ + voter: string; + /** option is the voter's choice on the proposal. */ + option: VoteOption; + /** + * metadata is any arbitrary metadata attached to the vote. + * the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/group#vote-2 + */ + metadata: string; + /** submit_time is the timestamp when the vote was submitted. */ + submitTime: Date; +} +export interface VoteProtoMsg { + typeUrl: "/cosmos.group.v1.Vote"; + value: Uint8Array; +} +/** Vote represents a vote for a proposal.string metadata */ +export interface VoteAmino { + /** proposal is the unique ID of the proposal. */ + proposal_id?: string; + /** voter is the account address of the voter. */ + voter?: string; + /** option is the voter's choice on the proposal. */ + option?: VoteOption; + /** + * metadata is any arbitrary metadata attached to the vote. + * the recommended format of the metadata is to be found here: https://docs.cosmos.network/v0.47/modules/group#vote-2 + */ + metadata?: string; + /** submit_time is the timestamp when the vote was submitted. */ + submit_time: string; +} +export interface VoteAminoMsg { + type: "cosmos-sdk/Vote"; + value: VoteAmino; +} +/** Vote represents a vote for a proposal.string metadata */ +export interface VoteSDKType { + proposal_id: bigint; + voter: string; + option: VoteOption; + metadata: string; + submit_time: Date; +} +function createBaseMember(): Member { + return { + address: "", + weight: "", + metadata: "", + addedAt: new Date() + }; +} +export const Member = { + typeUrl: "/cosmos.group.v1.Member", + encode(message: Member, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.weight !== "") { + writer.uint32(18).string(message.weight); + } + if (message.metadata !== "") { + writer.uint32(26).string(message.metadata); + } + if (message.addedAt !== undefined) { + Timestamp.encode(toTimestamp(message.addedAt), writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Member { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMember(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.weight = reader.string(); + break; + case 3: + message.metadata = reader.string(); + break; + case 4: + message.addedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Member { + const message = createBaseMember(); + message.address = object.address ?? ""; + message.weight = object.weight ?? ""; + message.metadata = object.metadata ?? ""; + message.addedAt = object.addedAt ?? undefined; + return message; + }, + fromAmino(object: MemberAmino): Member { + const message = createBaseMember(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.weight !== undefined && object.weight !== null) { + message.weight = object.weight; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + if (object.added_at !== undefined && object.added_at !== null) { + message.addedAt = fromTimestamp(Timestamp.fromAmino(object.added_at)); + } + return message; + }, + toAmino(message: Member): MemberAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.weight = message.weight === "" ? undefined : message.weight; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + obj.added_at = message.addedAt ? Timestamp.toAmino(toTimestamp(message.addedAt)) : new Date(); + return obj; + }, + fromAminoMsg(object: MemberAminoMsg): Member { + return Member.fromAmino(object.value); + }, + toAminoMsg(message: Member): MemberAminoMsg { + return { + type: "cosmos-sdk/Member", + value: Member.toAmino(message) + }; + }, + fromProtoMsg(message: MemberProtoMsg): Member { + return Member.decode(message.value); + }, + toProto(message: Member): Uint8Array { + return Member.encode(message).finish(); + }, + toProtoMsg(message: Member): MemberProtoMsg { + return { + typeUrl: "/cosmos.group.v1.Member", + value: Member.encode(message).finish() + }; + } +}; +function createBaseMemberRequest(): MemberRequest { + return { + address: "", + weight: "", + metadata: "" + }; +} +export const MemberRequest = { + typeUrl: "/cosmos.group.v1.MemberRequest", + encode(message: MemberRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.weight !== "") { + writer.uint32(18).string(message.weight); + } + if (message.metadata !== "") { + writer.uint32(26).string(message.metadata); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MemberRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMemberRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.weight = reader.string(); + break; + case 3: + message.metadata = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MemberRequest { + const message = createBaseMemberRequest(); + message.address = object.address ?? ""; + message.weight = object.weight ?? ""; + message.metadata = object.metadata ?? ""; + return message; + }, + fromAmino(object: MemberRequestAmino): MemberRequest { + const message = createBaseMemberRequest(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.weight !== undefined && object.weight !== null) { + message.weight = object.weight; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + return message; + }, + toAmino(message: MemberRequest): MemberRequestAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.weight = message.weight === "" ? undefined : message.weight; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + return obj; + }, + fromAminoMsg(object: MemberRequestAminoMsg): MemberRequest { + return MemberRequest.fromAmino(object.value); + }, + toAminoMsg(message: MemberRequest): MemberRequestAminoMsg { + return { + type: "cosmos-sdk/MemberRequest", + value: MemberRequest.toAmino(message) + }; + }, + fromProtoMsg(message: MemberRequestProtoMsg): MemberRequest { + return MemberRequest.decode(message.value); + }, + toProto(message: MemberRequest): Uint8Array { + return MemberRequest.encode(message).finish(); + }, + toProtoMsg(message: MemberRequest): MemberRequestProtoMsg { + return { + typeUrl: "/cosmos.group.v1.MemberRequest", + value: MemberRequest.encode(message).finish() + }; + } +}; +function createBaseThresholdDecisionPolicy(): ThresholdDecisionPolicy { + return { + threshold: "", + windows: undefined + }; +} +export const ThresholdDecisionPolicy = { + typeUrl: "/cosmos.group.v1.ThresholdDecisionPolicy", + encode(message: ThresholdDecisionPolicy, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.threshold !== "") { + writer.uint32(10).string(message.threshold); + } + if (message.windows !== undefined) { + DecisionPolicyWindows.encode(message.windows, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ThresholdDecisionPolicy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseThresholdDecisionPolicy(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.threshold = reader.string(); + break; + case 2: + message.windows = DecisionPolicyWindows.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ThresholdDecisionPolicy { + const message = createBaseThresholdDecisionPolicy(); + message.threshold = object.threshold ?? ""; + message.windows = object.windows !== undefined && object.windows !== null ? DecisionPolicyWindows.fromPartial(object.windows) : undefined; + return message; + }, + fromAmino(object: ThresholdDecisionPolicyAmino): ThresholdDecisionPolicy { + const message = createBaseThresholdDecisionPolicy(); + if (object.threshold !== undefined && object.threshold !== null) { + message.threshold = object.threshold; + } + if (object.windows !== undefined && object.windows !== null) { + message.windows = DecisionPolicyWindows.fromAmino(object.windows); + } + return message; + }, + toAmino(message: ThresholdDecisionPolicy): ThresholdDecisionPolicyAmino { + const obj: any = {}; + obj.threshold = message.threshold === "" ? undefined : message.threshold; + obj.windows = message.windows ? DecisionPolicyWindows.toAmino(message.windows) : undefined; + return obj; + }, + fromAminoMsg(object: ThresholdDecisionPolicyAminoMsg): ThresholdDecisionPolicy { + return ThresholdDecisionPolicy.fromAmino(object.value); + }, + toAminoMsg(message: ThresholdDecisionPolicy): ThresholdDecisionPolicyAminoMsg { + return { + type: "cosmos-sdk/ThresholdDecisionPolicy", + value: ThresholdDecisionPolicy.toAmino(message) + }; + }, + fromProtoMsg(message: ThresholdDecisionPolicyProtoMsg): ThresholdDecisionPolicy { + return ThresholdDecisionPolicy.decode(message.value); + }, + toProto(message: ThresholdDecisionPolicy): Uint8Array { + return ThresholdDecisionPolicy.encode(message).finish(); + }, + toProtoMsg(message: ThresholdDecisionPolicy): ThresholdDecisionPolicyProtoMsg { + return { + typeUrl: "/cosmos.group.v1.ThresholdDecisionPolicy", + value: ThresholdDecisionPolicy.encode(message).finish() + }; + } +}; +function createBasePercentageDecisionPolicy(): PercentageDecisionPolicy { + return { + percentage: "", + windows: undefined + }; +} +export const PercentageDecisionPolicy = { + typeUrl: "/cosmos.group.v1.PercentageDecisionPolicy", + encode(message: PercentageDecisionPolicy, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.percentage !== "") { + writer.uint32(10).string(message.percentage); + } + if (message.windows !== undefined) { + DecisionPolicyWindows.encode(message.windows, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PercentageDecisionPolicy { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePercentageDecisionPolicy(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.percentage = reader.string(); + break; + case 2: + message.windows = DecisionPolicyWindows.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PercentageDecisionPolicy { + const message = createBasePercentageDecisionPolicy(); + message.percentage = object.percentage ?? ""; + message.windows = object.windows !== undefined && object.windows !== null ? DecisionPolicyWindows.fromPartial(object.windows) : undefined; + return message; + }, + fromAmino(object: PercentageDecisionPolicyAmino): PercentageDecisionPolicy { + const message = createBasePercentageDecisionPolicy(); + if (object.percentage !== undefined && object.percentage !== null) { + message.percentage = object.percentage; + } + if (object.windows !== undefined && object.windows !== null) { + message.windows = DecisionPolicyWindows.fromAmino(object.windows); + } + return message; + }, + toAmino(message: PercentageDecisionPolicy): PercentageDecisionPolicyAmino { + const obj: any = {}; + obj.percentage = message.percentage === "" ? undefined : message.percentage; + obj.windows = message.windows ? DecisionPolicyWindows.toAmino(message.windows) : undefined; + return obj; + }, + fromAminoMsg(object: PercentageDecisionPolicyAminoMsg): PercentageDecisionPolicy { + return PercentageDecisionPolicy.fromAmino(object.value); + }, + toAminoMsg(message: PercentageDecisionPolicy): PercentageDecisionPolicyAminoMsg { + return { + type: "cosmos-sdk/PercentageDecisionPolicy", + value: PercentageDecisionPolicy.toAmino(message) + }; + }, + fromProtoMsg(message: PercentageDecisionPolicyProtoMsg): PercentageDecisionPolicy { + return PercentageDecisionPolicy.decode(message.value); + }, + toProto(message: PercentageDecisionPolicy): Uint8Array { + return PercentageDecisionPolicy.encode(message).finish(); + }, + toProtoMsg(message: PercentageDecisionPolicy): PercentageDecisionPolicyProtoMsg { + return { + typeUrl: "/cosmos.group.v1.PercentageDecisionPolicy", + value: PercentageDecisionPolicy.encode(message).finish() + }; + } +}; +function createBaseDecisionPolicyWindows(): DecisionPolicyWindows { + return { + votingPeriod: Duration.fromPartial({}), + minExecutionPeriod: Duration.fromPartial({}) + }; +} +export const DecisionPolicyWindows = { + typeUrl: "/cosmos.group.v1.DecisionPolicyWindows", + encode(message: DecisionPolicyWindows, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.votingPeriod !== undefined) { + Duration.encode(message.votingPeriod, writer.uint32(10).fork()).ldelim(); + } + if (message.minExecutionPeriod !== undefined) { + Duration.encode(message.minExecutionPeriod, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DecisionPolicyWindows { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDecisionPolicyWindows(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.votingPeriod = Duration.decode(reader, reader.uint32()); + break; + case 2: + message.minExecutionPeriod = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DecisionPolicyWindows { + const message = createBaseDecisionPolicyWindows(); + message.votingPeriod = object.votingPeriod !== undefined && object.votingPeriod !== null ? Duration.fromPartial(object.votingPeriod) : undefined; + message.minExecutionPeriod = object.minExecutionPeriod !== undefined && object.minExecutionPeriod !== null ? Duration.fromPartial(object.minExecutionPeriod) : undefined; + return message; + }, + fromAmino(object: DecisionPolicyWindowsAmino): DecisionPolicyWindows { + const message = createBaseDecisionPolicyWindows(); + if (object.voting_period !== undefined && object.voting_period !== null) { + message.votingPeriod = Duration.fromAmino(object.voting_period); + } + if (object.min_execution_period !== undefined && object.min_execution_period !== null) { + message.minExecutionPeriod = Duration.fromAmino(object.min_execution_period); + } + return message; + }, + toAmino(message: DecisionPolicyWindows): DecisionPolicyWindowsAmino { + const obj: any = {}; + obj.voting_period = message.votingPeriod ? Duration.toAmino(message.votingPeriod) : Duration.toAmino(Duration.fromPartial({})); + obj.min_execution_period = message.minExecutionPeriod ? Duration.toAmino(message.minExecutionPeriod) : Duration.toAmino(Duration.fromPartial({})); + return obj; + }, + fromAminoMsg(object: DecisionPolicyWindowsAminoMsg): DecisionPolicyWindows { + return DecisionPolicyWindows.fromAmino(object.value); + }, + toAminoMsg(message: DecisionPolicyWindows): DecisionPolicyWindowsAminoMsg { + return { + type: "cosmos-sdk/DecisionPolicyWindows", + value: DecisionPolicyWindows.toAmino(message) + }; + }, + fromProtoMsg(message: DecisionPolicyWindowsProtoMsg): DecisionPolicyWindows { + return DecisionPolicyWindows.decode(message.value); + }, + toProto(message: DecisionPolicyWindows): Uint8Array { + return DecisionPolicyWindows.encode(message).finish(); + }, + toProtoMsg(message: DecisionPolicyWindows): DecisionPolicyWindowsProtoMsg { + return { + typeUrl: "/cosmos.group.v1.DecisionPolicyWindows", + value: DecisionPolicyWindows.encode(message).finish() + }; + } +}; +function createBaseGroupInfo(): GroupInfo { + return { + id: BigInt(0), + admin: "", + metadata: "", + version: BigInt(0), + totalWeight: "", + createdAt: new Date() + }; +} +export const GroupInfo = { + typeUrl: "/cosmos.group.v1.GroupInfo", + encode(message: GroupInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { + writer.uint32(8).uint64(message.id); + } + if (message.admin !== "") { + writer.uint32(18).string(message.admin); + } + if (message.metadata !== "") { + writer.uint32(26).string(message.metadata); + } + if (message.version !== BigInt(0)) { + writer.uint32(32).uint64(message.version); + } + if (message.totalWeight !== "") { + writer.uint32(42).string(message.totalWeight); + } + if (message.createdAt !== undefined) { + Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GroupInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGroupInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint64(); + break; + case 2: + message.admin = reader.string(); + break; + case 3: + message.metadata = reader.string(); + break; + case 4: + message.version = reader.uint64(); + break; + case 5: + message.totalWeight = reader.string(); + break; + case 6: + message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GroupInfo { + const message = createBaseGroupInfo(); + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); + message.admin = object.admin ?? ""; + message.metadata = object.metadata ?? ""; + message.version = object.version !== undefined && object.version !== null ? BigInt(object.version.toString()) : BigInt(0); + message.totalWeight = object.totalWeight ?? ""; + message.createdAt = object.createdAt ?? undefined; + return message; + }, + fromAmino(object: GroupInfoAmino): GroupInfo { + const message = createBaseGroupInfo(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + if (object.version !== undefined && object.version !== null) { + message.version = BigInt(object.version); + } + if (object.total_weight !== undefined && object.total_weight !== null) { + message.totalWeight = object.total_weight; + } + if (object.created_at !== undefined && object.created_at !== null) { + message.createdAt = fromTimestamp(Timestamp.fromAmino(object.created_at)); + } + return message; + }, + toAmino(message: GroupInfo): GroupInfoAmino { + const obj: any = {}; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + obj.version = message.version !== BigInt(0) ? message.version.toString() : undefined; + obj.total_weight = message.totalWeight === "" ? undefined : message.totalWeight; + obj.created_at = message.createdAt ? Timestamp.toAmino(toTimestamp(message.createdAt)) : new Date(); + return obj; + }, + fromAminoMsg(object: GroupInfoAminoMsg): GroupInfo { + return GroupInfo.fromAmino(object.value); + }, + toAminoMsg(message: GroupInfo): GroupInfoAminoMsg { + return { + type: "cosmos-sdk/GroupInfo", + value: GroupInfo.toAmino(message) + }; + }, + fromProtoMsg(message: GroupInfoProtoMsg): GroupInfo { + return GroupInfo.decode(message.value); + }, + toProto(message: GroupInfo): Uint8Array { + return GroupInfo.encode(message).finish(); + }, + toProtoMsg(message: GroupInfo): GroupInfoProtoMsg { + return { + typeUrl: "/cosmos.group.v1.GroupInfo", + value: GroupInfo.encode(message).finish() + }; + } +}; +function createBaseGroupMember(): GroupMember { + return { + groupId: BigInt(0), + member: undefined + }; +} +export const GroupMember = { + typeUrl: "/cosmos.group.v1.GroupMember", + encode(message: GroupMember, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.groupId !== BigInt(0)) { + writer.uint32(8).uint64(message.groupId); + } + if (message.member !== undefined) { + Member.encode(message.member, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GroupMember { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGroupMember(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupId = reader.uint64(); + break; + case 2: + message.member = Member.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GroupMember { + const message = createBaseGroupMember(); + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); + message.member = object.member !== undefined && object.member !== null ? Member.fromPartial(object.member) : undefined; + return message; + }, + fromAmino(object: GroupMemberAmino): GroupMember { + const message = createBaseGroupMember(); + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + if (object.member !== undefined && object.member !== null) { + message.member = Member.fromAmino(object.member); + } + return message; + }, + toAmino(message: GroupMember): GroupMemberAmino { + const obj: any = {}; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + obj.member = message.member ? Member.toAmino(message.member) : undefined; + return obj; + }, + fromAminoMsg(object: GroupMemberAminoMsg): GroupMember { + return GroupMember.fromAmino(object.value); + }, + toAminoMsg(message: GroupMember): GroupMemberAminoMsg { + return { + type: "cosmos-sdk/GroupMember", + value: GroupMember.toAmino(message) + }; + }, + fromProtoMsg(message: GroupMemberProtoMsg): GroupMember { + return GroupMember.decode(message.value); + }, + toProto(message: GroupMember): Uint8Array { + return GroupMember.encode(message).finish(); + }, + toProtoMsg(message: GroupMember): GroupMemberProtoMsg { + return { + typeUrl: "/cosmos.group.v1.GroupMember", + value: GroupMember.encode(message).finish() + }; + } +}; +function createBaseGroupPolicyInfo(): GroupPolicyInfo { + return { + address: "", + groupId: BigInt(0), + admin: "", + metadata: "", + version: BigInt(0), + decisionPolicy: undefined, + createdAt: new Date() + }; +} +export const GroupPolicyInfo = { + typeUrl: "/cosmos.group.v1.GroupPolicyInfo", + encode(message: GroupPolicyInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.groupId !== BigInt(0)) { + writer.uint32(16).uint64(message.groupId); + } + if (message.admin !== "") { + writer.uint32(26).string(message.admin); + } + if (message.metadata !== "") { + writer.uint32(34).string(message.metadata); + } + if (message.version !== BigInt(0)) { + writer.uint32(40).uint64(message.version); + } + if (message.decisionPolicy !== undefined) { + Any.encode(message.decisionPolicy, writer.uint32(50).fork()).ldelim(); + } + if (message.createdAt !== undefined) { + Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(58).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GroupPolicyInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGroupPolicyInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.groupId = reader.uint64(); + break; + case 3: + message.admin = reader.string(); + break; + case 4: + message.metadata = reader.string(); + break; + case 5: + message.version = reader.uint64(); + break; + case 6: + message.decisionPolicy = Any.decode(reader, reader.uint32()); + break; + case 7: + message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GroupPolicyInfo { + const message = createBaseGroupPolicyInfo(); + message.address = object.address ?? ""; + message.groupId = object.groupId !== undefined && object.groupId !== null ? BigInt(object.groupId.toString()) : BigInt(0); + message.admin = object.admin ?? ""; + message.metadata = object.metadata ?? ""; + message.version = object.version !== undefined && object.version !== null ? BigInt(object.version.toString()) : BigInt(0); + message.decisionPolicy = object.decisionPolicy !== undefined && object.decisionPolicy !== null ? Any.fromPartial(object.decisionPolicy) : undefined; + message.createdAt = object.createdAt ?? undefined; + return message; + }, + fromAmino(object: GroupPolicyInfoAmino): GroupPolicyInfo { + const message = createBaseGroupPolicyInfo(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.group_id !== undefined && object.group_id !== null) { + message.groupId = BigInt(object.group_id); + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + if (object.version !== undefined && object.version !== null) { + message.version = BigInt(object.version); + } + if (object.decision_policy !== undefined && object.decision_policy !== null) { + message.decisionPolicy = Any.fromAmino(object.decision_policy); + } + if (object.created_at !== undefined && object.created_at !== null) { + message.createdAt = fromTimestamp(Timestamp.fromAmino(object.created_at)); + } + return message; + }, + toAmino(message: GroupPolicyInfo): GroupPolicyInfoAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.group_id = message.groupId !== BigInt(0) ? message.groupId.toString() : undefined; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + obj.version = message.version !== BigInt(0) ? message.version.toString() : undefined; + obj.decision_policy = message.decisionPolicy ? Any.toAmino(message.decisionPolicy) : undefined; + obj.created_at = message.createdAt ? Timestamp.toAmino(toTimestamp(message.createdAt)) : new Date(); + return obj; + }, + fromAminoMsg(object: GroupPolicyInfoAminoMsg): GroupPolicyInfo { + return GroupPolicyInfo.fromAmino(object.value); + }, + toAminoMsg(message: GroupPolicyInfo): GroupPolicyInfoAminoMsg { + return { + type: "cosmos-sdk/GroupPolicyInfo", + value: GroupPolicyInfo.toAmino(message) + }; + }, + fromProtoMsg(message: GroupPolicyInfoProtoMsg): GroupPolicyInfo { + return GroupPolicyInfo.decode(message.value); + }, + toProto(message: GroupPolicyInfo): Uint8Array { + return GroupPolicyInfo.encode(message).finish(); + }, + toProtoMsg(message: GroupPolicyInfo): GroupPolicyInfoProtoMsg { + return { + typeUrl: "/cosmos.group.v1.GroupPolicyInfo", + value: GroupPolicyInfo.encode(message).finish() + }; + } +}; +function createBaseProposal(): Proposal { + return { + id: BigInt(0), + groupPolicyAddress: "", + metadata: "", + proposers: [], + submitTime: new Date(), + groupVersion: BigInt(0), + groupPolicyVersion: BigInt(0), + status: 0, + finalTallyResult: TallyResult.fromPartial({}), + votingPeriodEnd: new Date(), + executorResult: 0, + messages: [], + title: "", + summary: "" + }; +} +export const Proposal = { + typeUrl: "/cosmos.group.v1.Proposal", + encode(message: Proposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== BigInt(0)) { + writer.uint32(8).uint64(message.id); + } + if (message.groupPolicyAddress !== "") { + writer.uint32(18).string(message.groupPolicyAddress); + } + if (message.metadata !== "") { + writer.uint32(26).string(message.metadata); + } + for (const v of message.proposers) { + writer.uint32(34).string(v!); + } + if (message.submitTime !== undefined) { + Timestamp.encode(toTimestamp(message.submitTime), writer.uint32(42).fork()).ldelim(); + } + if (message.groupVersion !== BigInt(0)) { + writer.uint32(48).uint64(message.groupVersion); + } + if (message.groupPolicyVersion !== BigInt(0)) { + writer.uint32(56).uint64(message.groupPolicyVersion); + } + if (message.status !== 0) { + writer.uint32(64).int32(message.status); + } + if (message.finalTallyResult !== undefined) { + TallyResult.encode(message.finalTallyResult, writer.uint32(74).fork()).ldelim(); + } + if (message.votingPeriodEnd !== undefined) { + Timestamp.encode(toTimestamp(message.votingPeriodEnd), writer.uint32(82).fork()).ldelim(); + } + if (message.executorResult !== 0) { + writer.uint32(88).int32(message.executorResult); + } + for (const v of message.messages) { + Any.encode(v!, writer.uint32(98).fork()).ldelim(); + } + if (message.title !== "") { + writer.uint32(106).string(message.title); + } + if (message.summary !== "") { + writer.uint32(114).string(message.summary); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Proposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint64(); + break; + case 2: + message.groupPolicyAddress = reader.string(); + break; + case 3: + message.metadata = reader.string(); + break; + case 4: + message.proposers.push(reader.string()); + break; + case 5: + message.submitTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 6: + message.groupVersion = reader.uint64(); + break; + case 7: + message.groupPolicyVersion = reader.uint64(); + break; + case 8: + message.status = (reader.int32() as any); + break; + case 9: + message.finalTallyResult = TallyResult.decode(reader, reader.uint32()); + break; + case 10: + message.votingPeriodEnd = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 11: + message.executorResult = (reader.int32() as any); + break; + case 12: + message.messages.push(Any.decode(reader, reader.uint32())); + break; + case 13: + message.title = reader.string(); + break; + case 14: + message.summary = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Proposal { + const message = createBaseProposal(); + message.id = object.id !== undefined && object.id !== null ? BigInt(object.id.toString()) : BigInt(0); + message.groupPolicyAddress = object.groupPolicyAddress ?? ""; + message.metadata = object.metadata ?? ""; + message.proposers = object.proposers?.map(e => e) || []; + message.submitTime = object.submitTime ?? undefined; + message.groupVersion = object.groupVersion !== undefined && object.groupVersion !== null ? BigInt(object.groupVersion.toString()) : BigInt(0); + message.groupPolicyVersion = object.groupPolicyVersion !== undefined && object.groupPolicyVersion !== null ? BigInt(object.groupPolicyVersion.toString()) : BigInt(0); + message.status = object.status ?? 0; + message.finalTallyResult = object.finalTallyResult !== undefined && object.finalTallyResult !== null ? TallyResult.fromPartial(object.finalTallyResult) : undefined; + message.votingPeriodEnd = object.votingPeriodEnd ?? undefined; + message.executorResult = object.executorResult ?? 0; + message.messages = object.messages?.map(e => Any.fromPartial(e)) || []; + message.title = object.title ?? ""; + message.summary = object.summary ?? ""; + return message; + }, + fromAmino(object: ProposalAmino): Proposal { + const message = createBaseProposal(); + if (object.id !== undefined && object.id !== null) { + message.id = BigInt(object.id); + } + if (object.group_policy_address !== undefined && object.group_policy_address !== null) { + message.groupPolicyAddress = object.group_policy_address; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + message.proposers = object.proposers?.map(e => e) || []; + if (object.submit_time !== undefined && object.submit_time !== null) { + message.submitTime = fromTimestamp(Timestamp.fromAmino(object.submit_time)); + } + if (object.group_version !== undefined && object.group_version !== null) { + message.groupVersion = BigInt(object.group_version); + } + if (object.group_policy_version !== undefined && object.group_policy_version !== null) { + message.groupPolicyVersion = BigInt(object.group_policy_version); + } + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + if (object.final_tally_result !== undefined && object.final_tally_result !== null) { + message.finalTallyResult = TallyResult.fromAmino(object.final_tally_result); + } + if (object.voting_period_end !== undefined && object.voting_period_end !== null) { + message.votingPeriodEnd = fromTimestamp(Timestamp.fromAmino(object.voting_period_end)); + } + if (object.executor_result !== undefined && object.executor_result !== null) { + message.executorResult = object.executor_result; + } + message.messages = object.messages?.map(e => Any.fromAmino(e)) || []; + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.summary !== undefined && object.summary !== null) { + message.summary = object.summary; + } + return message; + }, + toAmino(message: Proposal): ProposalAmino { + const obj: any = {}; + obj.id = message.id !== BigInt(0) ? message.id.toString() : undefined; + obj.group_policy_address = message.groupPolicyAddress === "" ? undefined : message.groupPolicyAddress; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + if (message.proposers) { + obj.proposers = message.proposers.map(e => e); + } else { + obj.proposers = message.proposers; + } + obj.submit_time = message.submitTime ? Timestamp.toAmino(toTimestamp(message.submitTime)) : new Date(); + obj.group_version = message.groupVersion !== BigInt(0) ? message.groupVersion.toString() : undefined; + obj.group_policy_version = message.groupPolicyVersion !== BigInt(0) ? message.groupPolicyVersion.toString() : undefined; + obj.status = message.status === 0 ? undefined : message.status; + obj.final_tally_result = message.finalTallyResult ? TallyResult.toAmino(message.finalTallyResult) : TallyResult.toAmino(TallyResult.fromPartial({})); + obj.voting_period_end = message.votingPeriodEnd ? Timestamp.toAmino(toTimestamp(message.votingPeriodEnd)) : new Date(); + obj.executor_result = message.executorResult === 0 ? undefined : message.executorResult; + if (message.messages) { + obj.messages = message.messages.map(e => e ? Any.toAmino(e) : undefined); + } else { + obj.messages = message.messages; + } + obj.title = message.title === "" ? undefined : message.title; + obj.summary = message.summary === "" ? undefined : message.summary; + return obj; + }, + fromAminoMsg(object: ProposalAminoMsg): Proposal { + return Proposal.fromAmino(object.value); + }, + toAminoMsg(message: Proposal): ProposalAminoMsg { + return { + type: "cosmos-sdk/Proposal", + value: Proposal.toAmino(message) + }; + }, + fromProtoMsg(message: ProposalProtoMsg): Proposal { + return Proposal.decode(message.value); + }, + toProto(message: Proposal): Uint8Array { + return Proposal.encode(message).finish(); + }, + toProtoMsg(message: Proposal): ProposalProtoMsg { + return { + typeUrl: "/cosmos.group.v1.Proposal", + value: Proposal.encode(message).finish() + }; + } +}; +function createBaseTallyResult(): TallyResult { + return { + yesCount: "", + abstainCount: "", + noCount: "", + noWithVetoCount: "" + }; +} +export const TallyResult = { + typeUrl: "/cosmos.group.v1.TallyResult", + encode(message: TallyResult, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.yesCount !== "") { + writer.uint32(10).string(message.yesCount); + } + if (message.abstainCount !== "") { + writer.uint32(18).string(message.abstainCount); + } + if (message.noCount !== "") { + writer.uint32(26).string(message.noCount); + } + if (message.noWithVetoCount !== "") { + writer.uint32(34).string(message.noWithVetoCount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TallyResult { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTallyResult(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.yesCount = reader.string(); + break; + case 2: + message.abstainCount = reader.string(); + break; + case 3: + message.noCount = reader.string(); + break; + case 4: + message.noWithVetoCount = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TallyResult { + const message = createBaseTallyResult(); + message.yesCount = object.yesCount ?? ""; + message.abstainCount = object.abstainCount ?? ""; + message.noCount = object.noCount ?? ""; + message.noWithVetoCount = object.noWithVetoCount ?? ""; + return message; + }, + fromAmino(object: TallyResultAmino): TallyResult { + const message = createBaseTallyResult(); + if (object.yes_count !== undefined && object.yes_count !== null) { + message.yesCount = object.yes_count; + } + if (object.abstain_count !== undefined && object.abstain_count !== null) { + message.abstainCount = object.abstain_count; + } + if (object.no_count !== undefined && object.no_count !== null) { + message.noCount = object.no_count; + } + if (object.no_with_veto_count !== undefined && object.no_with_veto_count !== null) { + message.noWithVetoCount = object.no_with_veto_count; + } + return message; + }, + toAmino(message: TallyResult): TallyResultAmino { + const obj: any = {}; + obj.yes_count = message.yesCount === "" ? undefined : message.yesCount; + obj.abstain_count = message.abstainCount === "" ? undefined : message.abstainCount; + obj.no_count = message.noCount === "" ? undefined : message.noCount; + obj.no_with_veto_count = message.noWithVetoCount === "" ? undefined : message.noWithVetoCount; + return obj; + }, + fromAminoMsg(object: TallyResultAminoMsg): TallyResult { + return TallyResult.fromAmino(object.value); + }, + toAminoMsg(message: TallyResult): TallyResultAminoMsg { + return { + type: "cosmos-sdk/TallyResult", + value: TallyResult.toAmino(message) + }; + }, + fromProtoMsg(message: TallyResultProtoMsg): TallyResult { + return TallyResult.decode(message.value); + }, + toProto(message: TallyResult): Uint8Array { + return TallyResult.encode(message).finish(); + }, + toProtoMsg(message: TallyResult): TallyResultProtoMsg { + return { + typeUrl: "/cosmos.group.v1.TallyResult", + value: TallyResult.encode(message).finish() + }; + } +}; +function createBaseVote(): Vote { + return { + proposalId: BigInt(0), + voter: "", + option: 0, + metadata: "", + submitTime: new Date() + }; +} +export const Vote = { + typeUrl: "/cosmos.group.v1.Vote", + encode(message: Vote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.proposalId !== BigInt(0)) { + writer.uint32(8).uint64(message.proposalId); + } + if (message.voter !== "") { + writer.uint32(18).string(message.voter); + } + if (message.option !== 0) { + writer.uint32(24).int32(message.option); + } + if (message.metadata !== "") { + writer.uint32(34).string(message.metadata); + } + if (message.submitTime !== undefined) { + Timestamp.encode(toTimestamp(message.submitTime), writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Vote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseVote(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.proposalId = reader.uint64(); + break; + case 2: + message.voter = reader.string(); + break; + case 3: + message.option = (reader.int32() as any); + break; + case 4: + message.metadata = reader.string(); + break; + case 5: + message.submitTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Vote { + const message = createBaseVote(); + message.proposalId = object.proposalId !== undefined && object.proposalId !== null ? BigInt(object.proposalId.toString()) : BigInt(0); + message.voter = object.voter ?? ""; + message.option = object.option ?? 0; + message.metadata = object.metadata ?? ""; + message.submitTime = object.submitTime ?? undefined; + return message; + }, + fromAmino(object: VoteAmino): Vote { + const message = createBaseVote(); + if (object.proposal_id !== undefined && object.proposal_id !== null) { + message.proposalId = BigInt(object.proposal_id); + } + if (object.voter !== undefined && object.voter !== null) { + message.voter = object.voter; + } + if (object.option !== undefined && object.option !== null) { + message.option = object.option; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } + if (object.submit_time !== undefined && object.submit_time !== null) { + message.submitTime = fromTimestamp(Timestamp.fromAmino(object.submit_time)); + } + return message; + }, + toAmino(message: Vote): VoteAmino { + const obj: any = {}; + obj.proposal_id = message.proposalId !== BigInt(0) ? message.proposalId.toString() : undefined; + obj.voter = message.voter === "" ? undefined : message.voter; + obj.option = message.option === 0 ? undefined : message.option; + obj.metadata = message.metadata === "" ? undefined : message.metadata; + obj.submit_time = message.submitTime ? Timestamp.toAmino(toTimestamp(message.submitTime)) : new Date(); + return obj; + }, + fromAminoMsg(object: VoteAminoMsg): Vote { + return Vote.fromAmino(object.value); + }, + toAminoMsg(message: Vote): VoteAminoMsg { + return { + type: "cosmos-sdk/Vote", + value: Vote.toAmino(message) + }; + }, + fromProtoMsg(message: VoteProtoMsg): Vote { + return Vote.decode(message.value); + }, + toProto(message: Vote): Uint8Array { + return Vote.encode(message).finish(); + }, + toProtoMsg(message: Vote): VoteProtoMsg { + return { + typeUrl: "/cosmos.group.v1.Vote", + value: Vote.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/ics23/v1/proofs.ts b/src/codegen/cosmos/ics23/v1/proofs.ts new file mode 100644 index 0000000..8decf67 --- /dev/null +++ b/src/codegen/cosmos/ics23/v1/proofs.ts @@ -0,0 +1,2032 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +export enum HashOp { + /** + * NO_HASH - NO_HASH is the default if no data passed. Note this is an illegal argument + * some places. + */ + NO_HASH = 0, + SHA256 = 1, + SHA512 = 2, + KECCAK = 3, + RIPEMD160 = 4, + /** BITCOIN - ripemd160(sha256(x)) */ + BITCOIN = 5, + SHA512_256 = 6, + UNRECOGNIZED = -1, +} +export const HashOpSDKType = HashOp; +export const HashOpAmino = HashOp; +export function hashOpFromJSON(object: any): HashOp { + switch (object) { + case 0: + case "NO_HASH": + return HashOp.NO_HASH; + case 1: + case "SHA256": + return HashOp.SHA256; + case 2: + case "SHA512": + return HashOp.SHA512; + case 3: + case "KECCAK": + return HashOp.KECCAK; + case 4: + case "RIPEMD160": + return HashOp.RIPEMD160; + case 5: + case "BITCOIN": + return HashOp.BITCOIN; + case 6: + case "SHA512_256": + return HashOp.SHA512_256; + case -1: + case "UNRECOGNIZED": + default: + return HashOp.UNRECOGNIZED; + } +} +export function hashOpToJSON(object: HashOp): string { + switch (object) { + case HashOp.NO_HASH: + return "NO_HASH"; + case HashOp.SHA256: + return "SHA256"; + case HashOp.SHA512: + return "SHA512"; + case HashOp.KECCAK: + return "KECCAK"; + case HashOp.RIPEMD160: + return "RIPEMD160"; + case HashOp.BITCOIN: + return "BITCOIN"; + case HashOp.SHA512_256: + return "SHA512_256"; + case HashOp.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * LengthOp defines how to process the key and value of the LeafOp + * to include length information. After encoding the length with the given + * algorithm, the length will be prepended to the key and value bytes. + * (Each one with it's own encoded length) + */ +export enum LengthOp { + /** NO_PREFIX - NO_PREFIX don't include any length info */ + NO_PREFIX = 0, + /** VAR_PROTO - VAR_PROTO uses protobuf (and go-amino) varint encoding of the length */ + VAR_PROTO = 1, + /** VAR_RLP - VAR_RLP uses rlp int encoding of the length */ + VAR_RLP = 2, + /** FIXED32_BIG - FIXED32_BIG uses big-endian encoding of the length as a 32 bit integer */ + FIXED32_BIG = 3, + /** + * FIXED32_LITTLE - FIXED32_LITTLE uses little-endian encoding of the length as a 32 bit + * integer + */ + FIXED32_LITTLE = 4, + /** FIXED64_BIG - FIXED64_BIG uses big-endian encoding of the length as a 64 bit integer */ + FIXED64_BIG = 5, + /** + * FIXED64_LITTLE - FIXED64_LITTLE uses little-endian encoding of the length as a 64 bit + * integer + */ + FIXED64_LITTLE = 6, + /** + * REQUIRE_32_BYTES - REQUIRE_32_BYTES is like NONE, but will fail if the input is not exactly 32 + * bytes (sha256 output) + */ + REQUIRE_32_BYTES = 7, + /** + * REQUIRE_64_BYTES - REQUIRE_64_BYTES is like NONE, but will fail if the input is not exactly 64 + * bytes (sha512 output) + */ + REQUIRE_64_BYTES = 8, + UNRECOGNIZED = -1, +} +export const LengthOpSDKType = LengthOp; +export const LengthOpAmino = LengthOp; +export function lengthOpFromJSON(object: any): LengthOp { + switch (object) { + case 0: + case "NO_PREFIX": + return LengthOp.NO_PREFIX; + case 1: + case "VAR_PROTO": + return LengthOp.VAR_PROTO; + case 2: + case "VAR_RLP": + return LengthOp.VAR_RLP; + case 3: + case "FIXED32_BIG": + return LengthOp.FIXED32_BIG; + case 4: + case "FIXED32_LITTLE": + return LengthOp.FIXED32_LITTLE; + case 5: + case "FIXED64_BIG": + return LengthOp.FIXED64_BIG; + case 6: + case "FIXED64_LITTLE": + return LengthOp.FIXED64_LITTLE; + case 7: + case "REQUIRE_32_BYTES": + return LengthOp.REQUIRE_32_BYTES; + case 8: + case "REQUIRE_64_BYTES": + return LengthOp.REQUIRE_64_BYTES; + case -1: + case "UNRECOGNIZED": + default: + return LengthOp.UNRECOGNIZED; + } +} +export function lengthOpToJSON(object: LengthOp): string { + switch (object) { + case LengthOp.NO_PREFIX: + return "NO_PREFIX"; + case LengthOp.VAR_PROTO: + return "VAR_PROTO"; + case LengthOp.VAR_RLP: + return "VAR_RLP"; + case LengthOp.FIXED32_BIG: + return "FIXED32_BIG"; + case LengthOp.FIXED32_LITTLE: + return "FIXED32_LITTLE"; + case LengthOp.FIXED64_BIG: + return "FIXED64_BIG"; + case LengthOp.FIXED64_LITTLE: + return "FIXED64_LITTLE"; + case LengthOp.REQUIRE_32_BYTES: + return "REQUIRE_32_BYTES"; + case LengthOp.REQUIRE_64_BYTES: + return "REQUIRE_64_BYTES"; + case LengthOp.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * ExistenceProof takes a key and a value and a set of steps to perform on it. + * The result of peforming all these steps will provide a "root hash", which can + * be compared to the value in a header. + * Since it is computationally infeasible to produce a hash collission for any of + * the used cryptographic hash functions, if someone can provide a series of + * operations to transform a given key and value into a root hash that matches some + * trusted root, these key and values must be in the referenced merkle tree. The + * only possible issue is maliablity in LeafOp, such as providing extra prefix + * data, which should be controlled by a spec. Eg. with lengthOp as NONE, prefix = + * FOO, key = BAR, value = CHOICE and prefix = F, key = OOBAR, value = CHOICE would + * produce the same value. With LengthOp this is tricker but not impossible. Which + * is why the "leafPrefixEqual" field in the ProofSpec is valuable to prevent this + * mutability. And why all trees should length-prefix the data before hashing it. + */ +export interface ExistenceProof { + key: Uint8Array; + value: Uint8Array; + leaf?: LeafOp; + path: InnerOp[]; +} +export interface ExistenceProofProtoMsg { + typeUrl: "/cosmos.ics23.v1.ExistenceProof"; + value: Uint8Array; +} +/** + * ExistenceProof takes a key and a value and a set of steps to perform on it. + * The result of peforming all these steps will provide a "root hash", which can + * be compared to the value in a header. + * Since it is computationally infeasible to produce a hash collission for any of + * the used cryptographic hash functions, if someone can provide a series of + * operations to transform a given key and value into a root hash that matches some + * trusted root, these key and values must be in the referenced merkle tree. The + * only possible issue is maliablity in LeafOp, such as providing extra prefix + * data, which should be controlled by a spec. Eg. with lengthOp as NONE, prefix = + * FOO, key = BAR, value = CHOICE and prefix = F, key = OOBAR, value = CHOICE would + * produce the same value. With LengthOp this is tricker but not impossible. Which + * is why the "leafPrefixEqual" field in the ProofSpec is valuable to prevent this + * mutability. And why all trees should length-prefix the data before hashing it. + */ +export interface ExistenceProofAmino { + key?: string; + value?: string; + leaf?: LeafOpAmino; + path?: InnerOpAmino[]; +} +export interface ExistenceProofAminoMsg { + type: "cosmos-sdk/ExistenceProof"; + value: ExistenceProofAmino; +} +/** + * ExistenceProof takes a key and a value and a set of steps to perform on it. + * The result of peforming all these steps will provide a "root hash", which can + * be compared to the value in a header. + * Since it is computationally infeasible to produce a hash collission for any of + * the used cryptographic hash functions, if someone can provide a series of + * operations to transform a given key and value into a root hash that matches some + * trusted root, these key and values must be in the referenced merkle tree. The + * only possible issue is maliablity in LeafOp, such as providing extra prefix + * data, which should be controlled by a spec. Eg. with lengthOp as NONE, prefix = + * FOO, key = BAR, value = CHOICE and prefix = F, key = OOBAR, value = CHOICE would + * produce the same value. With LengthOp this is tricker but not impossible. Which + * is why the "leafPrefixEqual" field in the ProofSpec is valuable to prevent this + * mutability. And why all trees should length-prefix the data before hashing it. + */ +export interface ExistenceProofSDKType { + key: Uint8Array; + value: Uint8Array; + leaf?: LeafOpSDKType; + path: InnerOpSDKType[]; +} +/** + * NonExistenceProof takes a proof of two neighbors, one left of the desired key, + * one right of the desired key. If both proofs are valid AND they are neighbors, + * then there is no valid proof for the given key. + */ +export interface NonExistenceProof { + /** TODO: remove this as unnecessary??? we prove a range */ + key: Uint8Array; + left?: ExistenceProof; + right?: ExistenceProof; +} +export interface NonExistenceProofProtoMsg { + typeUrl: "/cosmos.ics23.v1.NonExistenceProof"; + value: Uint8Array; +} +/** + * NonExistenceProof takes a proof of two neighbors, one left of the desired key, + * one right of the desired key. If both proofs are valid AND they are neighbors, + * then there is no valid proof for the given key. + */ +export interface NonExistenceProofAmino { + /** TODO: remove this as unnecessary??? we prove a range */ + key?: string; + left?: ExistenceProofAmino; + right?: ExistenceProofAmino; +} +export interface NonExistenceProofAminoMsg { + type: "cosmos-sdk/NonExistenceProof"; + value: NonExistenceProofAmino; +} +/** + * NonExistenceProof takes a proof of two neighbors, one left of the desired key, + * one right of the desired key. If both proofs are valid AND they are neighbors, + * then there is no valid proof for the given key. + */ +export interface NonExistenceProofSDKType { + key: Uint8Array; + left?: ExistenceProofSDKType; + right?: ExistenceProofSDKType; +} +/** + * CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch + * of such messages + */ +export interface CommitmentProof { + exist?: ExistenceProof; + nonexist?: NonExistenceProof; + batch?: BatchProof; + compressed?: CompressedBatchProof; +} +export interface CommitmentProofProtoMsg { + typeUrl: "/cosmos.ics23.v1.CommitmentProof"; + value: Uint8Array; +} +/** + * CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch + * of such messages + */ +export interface CommitmentProofAmino { + exist?: ExistenceProofAmino; + nonexist?: NonExistenceProofAmino; + batch?: BatchProofAmino; + compressed?: CompressedBatchProofAmino; +} +export interface CommitmentProofAminoMsg { + type: "cosmos-sdk/CommitmentProof"; + value: CommitmentProofAmino; +} +/** + * CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch + * of such messages + */ +export interface CommitmentProofSDKType { + exist?: ExistenceProofSDKType; + nonexist?: NonExistenceProofSDKType; + batch?: BatchProofSDKType; + compressed?: CompressedBatchProofSDKType; +} +/** + * LeafOp represents the raw key-value data we wish to prove, and + * must be flexible to represent the internal transformation from + * the original key-value pairs into the basis hash, for many existing + * merkle trees. + * key and value are passed in. So that the signature of this operation is: + * leafOp(key, value) -> output + * To process this, first prehash the keys and values if needed (ANY means no hash + * in this case): hkey = prehashKey(key) hvalue = prehashValue(value) Then combine + * the bytes, and hash it output = hash(prefix || length(hkey) || hkey || + * length(hvalue) || hvalue) + */ +export interface LeafOp { + hash: HashOp; + prehashKey: HashOp; + prehashValue: HashOp; + length: LengthOp; + /** + * prefix is a fixed bytes that may optionally be included at the beginning to + * differentiate a leaf node from an inner node. + */ + prefix: Uint8Array; +} +export interface LeafOpProtoMsg { + typeUrl: "/cosmos.ics23.v1.LeafOp"; + value: Uint8Array; +} +/** + * LeafOp represents the raw key-value data we wish to prove, and + * must be flexible to represent the internal transformation from + * the original key-value pairs into the basis hash, for many existing + * merkle trees. + * key and value are passed in. So that the signature of this operation is: + * leafOp(key, value) -> output + * To process this, first prehash the keys and values if needed (ANY means no hash + * in this case): hkey = prehashKey(key) hvalue = prehashValue(value) Then combine + * the bytes, and hash it output = hash(prefix || length(hkey) || hkey || + * length(hvalue) || hvalue) + */ +export interface LeafOpAmino { + hash?: HashOp; + prehash_key?: HashOp; + prehash_value?: HashOp; + length?: LengthOp; + /** + * prefix is a fixed bytes that may optionally be included at the beginning to + * differentiate a leaf node from an inner node. + */ + prefix?: string; +} +export interface LeafOpAminoMsg { + type: "cosmos-sdk/LeafOp"; + value: LeafOpAmino; +} +/** + * LeafOp represents the raw key-value data we wish to prove, and + * must be flexible to represent the internal transformation from + * the original key-value pairs into the basis hash, for many existing + * merkle trees. + * key and value are passed in. So that the signature of this operation is: + * leafOp(key, value) -> output + * To process this, first prehash the keys and values if needed (ANY means no hash + * in this case): hkey = prehashKey(key) hvalue = prehashValue(value) Then combine + * the bytes, and hash it output = hash(prefix || length(hkey) || hkey || + * length(hvalue) || hvalue) + */ +export interface LeafOpSDKType { + hash: HashOp; + prehash_key: HashOp; + prehash_value: HashOp; + length: LengthOp; + prefix: Uint8Array; +} +/** + * InnerOp represents a merkle-proof step that is not a leaf. + * It represents concatenating two children and hashing them to provide the next + * result. The result of the previous step is passed in, so the signature of this + * op is: innerOp(child) -> output The result of applying InnerOp should be: output + * = op.hash(op.prefix || child || op.suffix) where the || operator is + * concatenation of binary data, and child is the result of hashing all the tree + * below this step. Any special data, like prepending child with the length, or + * prepending the entire operation with some value to differentiate from leaf + * nodes, should be included in prefix and suffix. If either of prefix or suffix is + * empty, we just treat it as an empty string + */ +export interface InnerOp { + hash: HashOp; + prefix: Uint8Array; + suffix: Uint8Array; +} +export interface InnerOpProtoMsg { + typeUrl: "/cosmos.ics23.v1.InnerOp"; + value: Uint8Array; +} +/** + * InnerOp represents a merkle-proof step that is not a leaf. + * It represents concatenating two children and hashing them to provide the next + * result. The result of the previous step is passed in, so the signature of this + * op is: innerOp(child) -> output The result of applying InnerOp should be: output + * = op.hash(op.prefix || child || op.suffix) where the || operator is + * concatenation of binary data, and child is the result of hashing all the tree + * below this step. Any special data, like prepending child with the length, or + * prepending the entire operation with some value to differentiate from leaf + * nodes, should be included in prefix and suffix. If either of prefix or suffix is + * empty, we just treat it as an empty string + */ +export interface InnerOpAmino { + hash?: HashOp; + prefix?: string; + suffix?: string; +} +export interface InnerOpAminoMsg { + type: "cosmos-sdk/InnerOp"; + value: InnerOpAmino; +} +/** + * InnerOp represents a merkle-proof step that is not a leaf. + * It represents concatenating two children and hashing them to provide the next + * result. The result of the previous step is passed in, so the signature of this + * op is: innerOp(child) -> output The result of applying InnerOp should be: output + * = op.hash(op.prefix || child || op.suffix) where the || operator is + * concatenation of binary data, and child is the result of hashing all the tree + * below this step. Any special data, like prepending child with the length, or + * prepending the entire operation with some value to differentiate from leaf + * nodes, should be included in prefix and suffix. If either of prefix or suffix is + * empty, we just treat it as an empty string + */ +export interface InnerOpSDKType { + hash: HashOp; + prefix: Uint8Array; + suffix: Uint8Array; +} +/** + * ProofSpec defines what the expected parameters are for a given proof type. + * This can be stored in the client and used to validate any incoming proofs. + * verify(ProofSpec, Proof) -> Proof | Error + * As demonstrated in tests, if we don't fix the algorithm used to calculate the + * LeafHash for a given tree, there are many possible key-value pairs that can + * generate a given hash (by interpretting the preimage differently). + * We need this for proper security, requires client knows a priori what + * tree format server uses. But not in code, rather a configuration object. + */ +export interface ProofSpec { + /** + * any field in the ExistenceProof must be the same as in this spec. + * except Prefix, which is just the first bytes of prefix (spec can be longer) + */ + leafSpec?: LeafOp; + innerSpec?: InnerSpec; + /** + * max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for + * fixed-depth tries) + */ + maxDepth: number; + /** + * min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for + * fixed-depth tries) + */ + minDepth: number; +} +export interface ProofSpecProtoMsg { + typeUrl: "/cosmos.ics23.v1.ProofSpec"; + value: Uint8Array; +} +/** + * ProofSpec defines what the expected parameters are for a given proof type. + * This can be stored in the client and used to validate any incoming proofs. + * verify(ProofSpec, Proof) -> Proof | Error + * As demonstrated in tests, if we don't fix the algorithm used to calculate the + * LeafHash for a given tree, there are many possible key-value pairs that can + * generate a given hash (by interpretting the preimage differently). + * We need this for proper security, requires client knows a priori what + * tree format server uses. But not in code, rather a configuration object. + */ +export interface ProofSpecAmino { + /** + * any field in the ExistenceProof must be the same as in this spec. + * except Prefix, which is just the first bytes of prefix (spec can be longer) + */ + leaf_spec?: LeafOpAmino; + inner_spec?: InnerSpecAmino; + /** + * max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for + * fixed-depth tries) + */ + max_depth?: number; + /** + * min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for + * fixed-depth tries) + */ + min_depth?: number; +} +export interface ProofSpecAminoMsg { + type: "cosmos-sdk/ProofSpec"; + value: ProofSpecAmino; +} +/** + * ProofSpec defines what the expected parameters are for a given proof type. + * This can be stored in the client and used to validate any incoming proofs. + * verify(ProofSpec, Proof) -> Proof | Error + * As demonstrated in tests, if we don't fix the algorithm used to calculate the + * LeafHash for a given tree, there are many possible key-value pairs that can + * generate a given hash (by interpretting the preimage differently). + * We need this for proper security, requires client knows a priori what + * tree format server uses. But not in code, rather a configuration object. + */ +export interface ProofSpecSDKType { + leaf_spec?: LeafOpSDKType; + inner_spec?: InnerSpecSDKType; + max_depth: number; + min_depth: number; +} +/** + * InnerSpec contains all store-specific structure info to determine if two proofs + * from a given store are neighbors. This enables: isLeftMost(spec: InnerSpec, op: + * InnerOp) isRightMost(spec: InnerSpec, op: InnerOp) isLeftNeighbor(spec: + * InnerSpec, left: InnerOp, right: InnerOp) + */ +export interface InnerSpec { + /** + * Child order is the ordering of the children node, must count from 0 + * iavl tree is [0, 1] (left then right) + * merk is [0, 2, 1] (left, right, here) + */ + childOrder: number[]; + childSize: number; + minPrefixLength: number; + maxPrefixLength: number; + /** + * empty child is the prehash image that is used when one child is nil (eg. 20 + * bytes of 0) + */ + emptyChild: Uint8Array; + /** hash is the algorithm that must be used for each InnerOp */ + hash: HashOp; +} +export interface InnerSpecProtoMsg { + typeUrl: "/cosmos.ics23.v1.InnerSpec"; + value: Uint8Array; +} +/** + * InnerSpec contains all store-specific structure info to determine if two proofs + * from a given store are neighbors. This enables: isLeftMost(spec: InnerSpec, op: + * InnerOp) isRightMost(spec: InnerSpec, op: InnerOp) isLeftNeighbor(spec: + * InnerSpec, left: InnerOp, right: InnerOp) + */ +export interface InnerSpecAmino { + /** + * Child order is the ordering of the children node, must count from 0 + * iavl tree is [0, 1] (left then right) + * merk is [0, 2, 1] (left, right, here) + */ + child_order?: number[]; + child_size?: number; + min_prefix_length?: number; + max_prefix_length?: number; + /** + * empty child is the prehash image that is used when one child is nil (eg. 20 + * bytes of 0) + */ + empty_child?: string; + /** hash is the algorithm that must be used for each InnerOp */ + hash?: HashOp; +} +export interface InnerSpecAminoMsg { + type: "cosmos-sdk/InnerSpec"; + value: InnerSpecAmino; +} +/** + * InnerSpec contains all store-specific structure info to determine if two proofs + * from a given store are neighbors. This enables: isLeftMost(spec: InnerSpec, op: + * InnerOp) isRightMost(spec: InnerSpec, op: InnerOp) isLeftNeighbor(spec: + * InnerSpec, left: InnerOp, right: InnerOp) + */ +export interface InnerSpecSDKType { + child_order: number[]; + child_size: number; + min_prefix_length: number; + max_prefix_length: number; + empty_child: Uint8Array; + hash: HashOp; +} +/** BatchProof is a group of multiple proof types than can be compressed */ +export interface BatchProof { + /** BatchProof is a group of multiple proof types than can be compressed */ + entries: BatchEntry[]; +} +export interface BatchProofProtoMsg { + typeUrl: "/cosmos.ics23.v1.BatchProof"; + value: Uint8Array; +} +/** BatchProof is a group of multiple proof types than can be compressed */ +export interface BatchProofAmino { + /** BatchProof is a group of multiple proof types than can be compressed */ + entries?: BatchEntryAmino[]; +} +export interface BatchProofAminoMsg { + type: "cosmos-sdk/BatchProof"; + value: BatchProofAmino; +} +/** BatchProof is a group of multiple proof types than can be compressed */ +export interface BatchProofSDKType { + entries: BatchEntrySDKType[]; +} +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface BatchEntry { + exist?: ExistenceProof; + nonexist?: NonExistenceProof; +} +export interface BatchEntryProtoMsg { + typeUrl: "/cosmos.ics23.v1.BatchEntry"; + value: Uint8Array; +} +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface BatchEntryAmino { + exist?: ExistenceProofAmino; + nonexist?: NonExistenceProofAmino; +} +export interface BatchEntryAminoMsg { + type: "cosmos-sdk/BatchEntry"; + value: BatchEntryAmino; +} +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface BatchEntrySDKType { + exist?: ExistenceProofSDKType; + nonexist?: NonExistenceProofSDKType; +} +/** *** all items here are compressed forms ****** */ +export interface CompressedBatchProof { + entries: CompressedBatchEntry[]; + lookupInners: InnerOp[]; +} +export interface CompressedBatchProofProtoMsg { + typeUrl: "/cosmos.ics23.v1.CompressedBatchProof"; + value: Uint8Array; +} +/** *** all items here are compressed forms ****** */ +export interface CompressedBatchProofAmino { + entries?: CompressedBatchEntryAmino[]; + lookup_inners?: InnerOpAmino[]; +} +export interface CompressedBatchProofAminoMsg { + type: "cosmos-sdk/CompressedBatchProof"; + value: CompressedBatchProofAmino; +} +/** *** all items here are compressed forms ****** */ +export interface CompressedBatchProofSDKType { + entries: CompressedBatchEntrySDKType[]; + lookup_inners: InnerOpSDKType[]; +} +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface CompressedBatchEntry { + exist?: CompressedExistenceProof; + nonexist?: CompressedNonExistenceProof; +} +export interface CompressedBatchEntryProtoMsg { + typeUrl: "/cosmos.ics23.v1.CompressedBatchEntry"; + value: Uint8Array; +} +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface CompressedBatchEntryAmino { + exist?: CompressedExistenceProofAmino; + nonexist?: CompressedNonExistenceProofAmino; +} +export interface CompressedBatchEntryAminoMsg { + type: "cosmos-sdk/CompressedBatchEntry"; + value: CompressedBatchEntryAmino; +} +/** Use BatchEntry not CommitmentProof, to avoid recursion */ +export interface CompressedBatchEntrySDKType { + exist?: CompressedExistenceProofSDKType; + nonexist?: CompressedNonExistenceProofSDKType; +} +export interface CompressedExistenceProof { + key: Uint8Array; + value: Uint8Array; + leaf?: LeafOp; + /** these are indexes into the lookup_inners table in CompressedBatchProof */ + path: number[]; +} +export interface CompressedExistenceProofProtoMsg { + typeUrl: "/cosmos.ics23.v1.CompressedExistenceProof"; + value: Uint8Array; +} +export interface CompressedExistenceProofAmino { + key?: string; + value?: string; + leaf?: LeafOpAmino; + /** these are indexes into the lookup_inners table in CompressedBatchProof */ + path?: number[]; +} +export interface CompressedExistenceProofAminoMsg { + type: "cosmos-sdk/CompressedExistenceProof"; + value: CompressedExistenceProofAmino; +} +export interface CompressedExistenceProofSDKType { + key: Uint8Array; + value: Uint8Array; + leaf?: LeafOpSDKType; + path: number[]; +} +export interface CompressedNonExistenceProof { + /** TODO: remove this as unnecessary??? we prove a range */ + key: Uint8Array; + left?: CompressedExistenceProof; + right?: CompressedExistenceProof; +} +export interface CompressedNonExistenceProofProtoMsg { + typeUrl: "/cosmos.ics23.v1.CompressedNonExistenceProof"; + value: Uint8Array; +} +export interface CompressedNonExistenceProofAmino { + /** TODO: remove this as unnecessary??? we prove a range */ + key?: string; + left?: CompressedExistenceProofAmino; + right?: CompressedExistenceProofAmino; +} +export interface CompressedNonExistenceProofAminoMsg { + type: "cosmos-sdk/CompressedNonExistenceProof"; + value: CompressedNonExistenceProofAmino; +} +export interface CompressedNonExistenceProofSDKType { + key: Uint8Array; + left?: CompressedExistenceProofSDKType; + right?: CompressedExistenceProofSDKType; +} +function createBaseExistenceProof(): ExistenceProof { + return { + key: new Uint8Array(), + value: new Uint8Array(), + leaf: undefined, + path: [] + }; +} +export const ExistenceProof = { + typeUrl: "/cosmos.ics23.v1.ExistenceProof", + encode(message: ExistenceProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + if (message.leaf !== undefined) { + LeafOp.encode(message.leaf, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.path) { + InnerOp.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ExistenceProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExistenceProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + case 3: + message.leaf = LeafOp.decode(reader, reader.uint32()); + break; + case 4: + message.path.push(InnerOp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ExistenceProof { + const message = createBaseExistenceProof(); + message.key = object.key ?? new Uint8Array(); + message.value = object.value ?? new Uint8Array(); + message.leaf = object.leaf !== undefined && object.leaf !== null ? LeafOp.fromPartial(object.leaf) : undefined; + message.path = object.path?.map(e => InnerOp.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ExistenceProofAmino): ExistenceProof { + const message = createBaseExistenceProof(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + if (object.leaf !== undefined && object.leaf !== null) { + message.leaf = LeafOp.fromAmino(object.leaf); + } + message.path = object.path?.map(e => InnerOp.fromAmino(e)) || []; + return message; + }, + toAmino(message: ExistenceProof): ExistenceProofAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; + obj.leaf = message.leaf ? LeafOp.toAmino(message.leaf) : undefined; + if (message.path) { + obj.path = message.path.map(e => e ? InnerOp.toAmino(e) : undefined); + } else { + obj.path = message.path; + } + return obj; + }, + fromAminoMsg(object: ExistenceProofAminoMsg): ExistenceProof { + return ExistenceProof.fromAmino(object.value); + }, + toAminoMsg(message: ExistenceProof): ExistenceProofAminoMsg { + return { + type: "cosmos-sdk/ExistenceProof", + value: ExistenceProof.toAmino(message) + }; + }, + fromProtoMsg(message: ExistenceProofProtoMsg): ExistenceProof { + return ExistenceProof.decode(message.value); + }, + toProto(message: ExistenceProof): Uint8Array { + return ExistenceProof.encode(message).finish(); + }, + toProtoMsg(message: ExistenceProof): ExistenceProofProtoMsg { + return { + typeUrl: "/cosmos.ics23.v1.ExistenceProof", + value: ExistenceProof.encode(message).finish() + }; + } +}; +function createBaseNonExistenceProof(): NonExistenceProof { + return { + key: new Uint8Array(), + left: undefined, + right: undefined + }; +} +export const NonExistenceProof = { + typeUrl: "/cosmos.ics23.v1.NonExistenceProof", + encode(message: NonExistenceProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.left !== undefined) { + ExistenceProof.encode(message.left, writer.uint32(18).fork()).ldelim(); + } + if (message.right !== undefined) { + ExistenceProof.encode(message.right, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): NonExistenceProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNonExistenceProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.left = ExistenceProof.decode(reader, reader.uint32()); + break; + case 3: + message.right = ExistenceProof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): NonExistenceProof { + const message = createBaseNonExistenceProof(); + message.key = object.key ?? new Uint8Array(); + message.left = object.left !== undefined && object.left !== null ? ExistenceProof.fromPartial(object.left) : undefined; + message.right = object.right !== undefined && object.right !== null ? ExistenceProof.fromPartial(object.right) : undefined; + return message; + }, + fromAmino(object: NonExistenceProofAmino): NonExistenceProof { + const message = createBaseNonExistenceProof(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.left !== undefined && object.left !== null) { + message.left = ExistenceProof.fromAmino(object.left); + } + if (object.right !== undefined && object.right !== null) { + message.right = ExistenceProof.fromAmino(object.right); + } + return message; + }, + toAmino(message: NonExistenceProof): NonExistenceProofAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.left = message.left ? ExistenceProof.toAmino(message.left) : undefined; + obj.right = message.right ? ExistenceProof.toAmino(message.right) : undefined; + return obj; + }, + fromAminoMsg(object: NonExistenceProofAminoMsg): NonExistenceProof { + return NonExistenceProof.fromAmino(object.value); + }, + toAminoMsg(message: NonExistenceProof): NonExistenceProofAminoMsg { + return { + type: "cosmos-sdk/NonExistenceProof", + value: NonExistenceProof.toAmino(message) + }; + }, + fromProtoMsg(message: NonExistenceProofProtoMsg): NonExistenceProof { + return NonExistenceProof.decode(message.value); + }, + toProto(message: NonExistenceProof): Uint8Array { + return NonExistenceProof.encode(message).finish(); + }, + toProtoMsg(message: NonExistenceProof): NonExistenceProofProtoMsg { + return { + typeUrl: "/cosmos.ics23.v1.NonExistenceProof", + value: NonExistenceProof.encode(message).finish() + }; + } +}; +function createBaseCommitmentProof(): CommitmentProof { + return { + exist: undefined, + nonexist: undefined, + batch: undefined, + compressed: undefined + }; +} +export const CommitmentProof = { + typeUrl: "/cosmos.ics23.v1.CommitmentProof", + encode(message: CommitmentProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.exist !== undefined) { + ExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim(); + } + if (message.nonexist !== undefined) { + NonExistenceProof.encode(message.nonexist, writer.uint32(18).fork()).ldelim(); + } + if (message.batch !== undefined) { + BatchProof.encode(message.batch, writer.uint32(26).fork()).ldelim(); + } + if (message.compressed !== undefined) { + CompressedBatchProof.encode(message.compressed, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CommitmentProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCommitmentProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exist = ExistenceProof.decode(reader, reader.uint32()); + break; + case 2: + message.nonexist = NonExistenceProof.decode(reader, reader.uint32()); + break; + case 3: + message.batch = BatchProof.decode(reader, reader.uint32()); + break; + case 4: + message.compressed = CompressedBatchProof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CommitmentProof { + const message = createBaseCommitmentProof(); + message.exist = object.exist !== undefined && object.exist !== null ? ExistenceProof.fromPartial(object.exist) : undefined; + message.nonexist = object.nonexist !== undefined && object.nonexist !== null ? NonExistenceProof.fromPartial(object.nonexist) : undefined; + message.batch = object.batch !== undefined && object.batch !== null ? BatchProof.fromPartial(object.batch) : undefined; + message.compressed = object.compressed !== undefined && object.compressed !== null ? CompressedBatchProof.fromPartial(object.compressed) : undefined; + return message; + }, + fromAmino(object: CommitmentProofAmino): CommitmentProof { + const message = createBaseCommitmentProof(); + if (object.exist !== undefined && object.exist !== null) { + message.exist = ExistenceProof.fromAmino(object.exist); + } + if (object.nonexist !== undefined && object.nonexist !== null) { + message.nonexist = NonExistenceProof.fromAmino(object.nonexist); + } + if (object.batch !== undefined && object.batch !== null) { + message.batch = BatchProof.fromAmino(object.batch); + } + if (object.compressed !== undefined && object.compressed !== null) { + message.compressed = CompressedBatchProof.fromAmino(object.compressed); + } + return message; + }, + toAmino(message: CommitmentProof): CommitmentProofAmino { + const obj: any = {}; + obj.exist = message.exist ? ExistenceProof.toAmino(message.exist) : undefined; + obj.nonexist = message.nonexist ? NonExistenceProof.toAmino(message.nonexist) : undefined; + obj.batch = message.batch ? BatchProof.toAmino(message.batch) : undefined; + obj.compressed = message.compressed ? CompressedBatchProof.toAmino(message.compressed) : undefined; + return obj; + }, + fromAminoMsg(object: CommitmentProofAminoMsg): CommitmentProof { + return CommitmentProof.fromAmino(object.value); + }, + toAminoMsg(message: CommitmentProof): CommitmentProofAminoMsg { + return { + type: "cosmos-sdk/CommitmentProof", + value: CommitmentProof.toAmino(message) + }; + }, + fromProtoMsg(message: CommitmentProofProtoMsg): CommitmentProof { + return CommitmentProof.decode(message.value); + }, + toProto(message: CommitmentProof): Uint8Array { + return CommitmentProof.encode(message).finish(); + }, + toProtoMsg(message: CommitmentProof): CommitmentProofProtoMsg { + return { + typeUrl: "/cosmos.ics23.v1.CommitmentProof", + value: CommitmentProof.encode(message).finish() + }; + } +}; +function createBaseLeafOp(): LeafOp { + return { + hash: 0, + prehashKey: 0, + prehashValue: 0, + length: 0, + prefix: new Uint8Array() + }; +} +export const LeafOp = { + typeUrl: "/cosmos.ics23.v1.LeafOp", + encode(message: LeafOp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hash !== 0) { + writer.uint32(8).int32(message.hash); + } + if (message.prehashKey !== 0) { + writer.uint32(16).int32(message.prehashKey); + } + if (message.prehashValue !== 0) { + writer.uint32(24).int32(message.prehashValue); + } + if (message.length !== 0) { + writer.uint32(32).int32(message.length); + } + if (message.prefix.length !== 0) { + writer.uint32(42).bytes(message.prefix); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): LeafOp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLeafOp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = (reader.int32() as any); + break; + case 2: + message.prehashKey = (reader.int32() as any); + break; + case 3: + message.prehashValue = (reader.int32() as any); + break; + case 4: + message.length = (reader.int32() as any); + break; + case 5: + message.prefix = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): LeafOp { + const message = createBaseLeafOp(); + message.hash = object.hash ?? 0; + message.prehashKey = object.prehashKey ?? 0; + message.prehashValue = object.prehashValue ?? 0; + message.length = object.length ?? 0; + message.prefix = object.prefix ?? new Uint8Array(); + return message; + }, + fromAmino(object: LeafOpAmino): LeafOp { + const message = createBaseLeafOp(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } + if (object.prehash_key !== undefined && object.prehash_key !== null) { + message.prehashKey = object.prehash_key; + } + if (object.prehash_value !== undefined && object.prehash_value !== null) { + message.prehashValue = object.prehash_value; + } + if (object.length !== undefined && object.length !== null) { + message.length = object.length; + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = bytesFromBase64(object.prefix); + } + return message; + }, + toAmino(message: LeafOp): LeafOpAmino { + const obj: any = {}; + obj.hash = message.hash === 0 ? undefined : message.hash; + obj.prehash_key = message.prehashKey === 0 ? undefined : message.prehashKey; + obj.prehash_value = message.prehashValue === 0 ? undefined : message.prehashValue; + obj.length = message.length === 0 ? undefined : message.length; + obj.prefix = message.prefix ? base64FromBytes(message.prefix) : undefined; + return obj; + }, + fromAminoMsg(object: LeafOpAminoMsg): LeafOp { + return LeafOp.fromAmino(object.value); + }, + toAminoMsg(message: LeafOp): LeafOpAminoMsg { + return { + type: "cosmos-sdk/LeafOp", + value: LeafOp.toAmino(message) + }; + }, + fromProtoMsg(message: LeafOpProtoMsg): LeafOp { + return LeafOp.decode(message.value); + }, + toProto(message: LeafOp): Uint8Array { + return LeafOp.encode(message).finish(); + }, + toProtoMsg(message: LeafOp): LeafOpProtoMsg { + return { + typeUrl: "/cosmos.ics23.v1.LeafOp", + value: LeafOp.encode(message).finish() + }; + } +}; +function createBaseInnerOp(): InnerOp { + return { + hash: 0, + prefix: new Uint8Array(), + suffix: new Uint8Array() + }; +} +export const InnerOp = { + typeUrl: "/cosmos.ics23.v1.InnerOp", + encode(message: InnerOp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hash !== 0) { + writer.uint32(8).int32(message.hash); + } + if (message.prefix.length !== 0) { + writer.uint32(18).bytes(message.prefix); + } + if (message.suffix.length !== 0) { + writer.uint32(26).bytes(message.suffix); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): InnerOp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInnerOp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = (reader.int32() as any); + break; + case 2: + message.prefix = reader.bytes(); + break; + case 3: + message.suffix = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): InnerOp { + const message = createBaseInnerOp(); + message.hash = object.hash ?? 0; + message.prefix = object.prefix ?? new Uint8Array(); + message.suffix = object.suffix ?? new Uint8Array(); + return message; + }, + fromAmino(object: InnerOpAmino): InnerOp { + const message = createBaseInnerOp(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = bytesFromBase64(object.prefix); + } + if (object.suffix !== undefined && object.suffix !== null) { + message.suffix = bytesFromBase64(object.suffix); + } + return message; + }, + toAmino(message: InnerOp): InnerOpAmino { + const obj: any = {}; + obj.hash = message.hash === 0 ? undefined : message.hash; + obj.prefix = message.prefix ? base64FromBytes(message.prefix) : undefined; + obj.suffix = message.suffix ? base64FromBytes(message.suffix) : undefined; + return obj; + }, + fromAminoMsg(object: InnerOpAminoMsg): InnerOp { + return InnerOp.fromAmino(object.value); + }, + toAminoMsg(message: InnerOp): InnerOpAminoMsg { + return { + type: "cosmos-sdk/InnerOp", + value: InnerOp.toAmino(message) + }; + }, + fromProtoMsg(message: InnerOpProtoMsg): InnerOp { + return InnerOp.decode(message.value); + }, + toProto(message: InnerOp): Uint8Array { + return InnerOp.encode(message).finish(); + }, + toProtoMsg(message: InnerOp): InnerOpProtoMsg { + return { + typeUrl: "/cosmos.ics23.v1.InnerOp", + value: InnerOp.encode(message).finish() + }; + } +}; +function createBaseProofSpec(): ProofSpec { + return { + leafSpec: undefined, + innerSpec: undefined, + maxDepth: 0, + minDepth: 0 + }; +} +export const ProofSpec = { + typeUrl: "/cosmos.ics23.v1.ProofSpec", + encode(message: ProofSpec, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.leafSpec !== undefined) { + LeafOp.encode(message.leafSpec, writer.uint32(10).fork()).ldelim(); + } + if (message.innerSpec !== undefined) { + InnerSpec.encode(message.innerSpec, writer.uint32(18).fork()).ldelim(); + } + if (message.maxDepth !== 0) { + writer.uint32(24).int32(message.maxDepth); + } + if (message.minDepth !== 0) { + writer.uint32(32).int32(message.minDepth); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ProofSpec { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProofSpec(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.leafSpec = LeafOp.decode(reader, reader.uint32()); + break; + case 2: + message.innerSpec = InnerSpec.decode(reader, reader.uint32()); + break; + case 3: + message.maxDepth = reader.int32(); + break; + case 4: + message.minDepth = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ProofSpec { + const message = createBaseProofSpec(); + message.leafSpec = object.leafSpec !== undefined && object.leafSpec !== null ? LeafOp.fromPartial(object.leafSpec) : undefined; + message.innerSpec = object.innerSpec !== undefined && object.innerSpec !== null ? InnerSpec.fromPartial(object.innerSpec) : undefined; + message.maxDepth = object.maxDepth ?? 0; + message.minDepth = object.minDepth ?? 0; + return message; + }, + fromAmino(object: ProofSpecAmino): ProofSpec { + const message = createBaseProofSpec(); + if (object.leaf_spec !== undefined && object.leaf_spec !== null) { + message.leafSpec = LeafOp.fromAmino(object.leaf_spec); + } + if (object.inner_spec !== undefined && object.inner_spec !== null) { + message.innerSpec = InnerSpec.fromAmino(object.inner_spec); + } + if (object.max_depth !== undefined && object.max_depth !== null) { + message.maxDepth = object.max_depth; + } + if (object.min_depth !== undefined && object.min_depth !== null) { + message.minDepth = object.min_depth; + } + return message; + }, + toAmino(message: ProofSpec): ProofSpecAmino { + const obj: any = {}; + obj.leaf_spec = message.leafSpec ? LeafOp.toAmino(message.leafSpec) : undefined; + obj.inner_spec = message.innerSpec ? InnerSpec.toAmino(message.innerSpec) : undefined; + obj.max_depth = message.maxDepth === 0 ? undefined : message.maxDepth; + obj.min_depth = message.minDepth === 0 ? undefined : message.minDepth; + return obj; + }, + fromAminoMsg(object: ProofSpecAminoMsg): ProofSpec { + return ProofSpec.fromAmino(object.value); + }, + toAminoMsg(message: ProofSpec): ProofSpecAminoMsg { + return { + type: "cosmos-sdk/ProofSpec", + value: ProofSpec.toAmino(message) + }; + }, + fromProtoMsg(message: ProofSpecProtoMsg): ProofSpec { + return ProofSpec.decode(message.value); + }, + toProto(message: ProofSpec): Uint8Array { + return ProofSpec.encode(message).finish(); + }, + toProtoMsg(message: ProofSpec): ProofSpecProtoMsg { + return { + typeUrl: "/cosmos.ics23.v1.ProofSpec", + value: ProofSpec.encode(message).finish() + }; + } +}; +function createBaseInnerSpec(): InnerSpec { + return { + childOrder: [], + childSize: 0, + minPrefixLength: 0, + maxPrefixLength: 0, + emptyChild: new Uint8Array(), + hash: 0 + }; +} +export const InnerSpec = { + typeUrl: "/cosmos.ics23.v1.InnerSpec", + encode(message: InnerSpec, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.childOrder) { + writer.int32(v); + } + writer.ldelim(); + if (message.childSize !== 0) { + writer.uint32(16).int32(message.childSize); + } + if (message.minPrefixLength !== 0) { + writer.uint32(24).int32(message.minPrefixLength); + } + if (message.maxPrefixLength !== 0) { + writer.uint32(32).int32(message.maxPrefixLength); + } + if (message.emptyChild.length !== 0) { + writer.uint32(42).bytes(message.emptyChild); + } + if (message.hash !== 0) { + writer.uint32(48).int32(message.hash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): InnerSpec { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInnerSpec(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.childOrder.push(reader.int32()); + } + } else { + message.childOrder.push(reader.int32()); + } + break; + case 2: + message.childSize = reader.int32(); + break; + case 3: + message.minPrefixLength = reader.int32(); + break; + case 4: + message.maxPrefixLength = reader.int32(); + break; + case 5: + message.emptyChild = reader.bytes(); + break; + case 6: + message.hash = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): InnerSpec { + const message = createBaseInnerSpec(); + message.childOrder = object.childOrder?.map(e => e) || []; + message.childSize = object.childSize ?? 0; + message.minPrefixLength = object.minPrefixLength ?? 0; + message.maxPrefixLength = object.maxPrefixLength ?? 0; + message.emptyChild = object.emptyChild ?? new Uint8Array(); + message.hash = object.hash ?? 0; + return message; + }, + fromAmino(object: InnerSpecAmino): InnerSpec { + const message = createBaseInnerSpec(); + message.childOrder = object.child_order?.map(e => e) || []; + if (object.child_size !== undefined && object.child_size !== null) { + message.childSize = object.child_size; + } + if (object.min_prefix_length !== undefined && object.min_prefix_length !== null) { + message.minPrefixLength = object.min_prefix_length; + } + if (object.max_prefix_length !== undefined && object.max_prefix_length !== null) { + message.maxPrefixLength = object.max_prefix_length; + } + if (object.empty_child !== undefined && object.empty_child !== null) { + message.emptyChild = bytesFromBase64(object.empty_child); + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = object.hash; + } + return message; + }, + toAmino(message: InnerSpec): InnerSpecAmino { + const obj: any = {}; + if (message.childOrder) { + obj.child_order = message.childOrder.map(e => e); + } else { + obj.child_order = message.childOrder; + } + obj.child_size = message.childSize === 0 ? undefined : message.childSize; + obj.min_prefix_length = message.minPrefixLength === 0 ? undefined : message.minPrefixLength; + obj.max_prefix_length = message.maxPrefixLength === 0 ? undefined : message.maxPrefixLength; + obj.empty_child = message.emptyChild ? base64FromBytes(message.emptyChild) : undefined; + obj.hash = message.hash === 0 ? undefined : message.hash; + return obj; + }, + fromAminoMsg(object: InnerSpecAminoMsg): InnerSpec { + return InnerSpec.fromAmino(object.value); + }, + toAminoMsg(message: InnerSpec): InnerSpecAminoMsg { + return { + type: "cosmos-sdk/InnerSpec", + value: InnerSpec.toAmino(message) + }; + }, + fromProtoMsg(message: InnerSpecProtoMsg): InnerSpec { + return InnerSpec.decode(message.value); + }, + toProto(message: InnerSpec): Uint8Array { + return InnerSpec.encode(message).finish(); + }, + toProtoMsg(message: InnerSpec): InnerSpecProtoMsg { + return { + typeUrl: "/cosmos.ics23.v1.InnerSpec", + value: InnerSpec.encode(message).finish() + }; + } +}; +function createBaseBatchProof(): BatchProof { + return { + entries: [] + }; +} +export const BatchProof = { + typeUrl: "/cosmos.ics23.v1.BatchProof", + encode(message: BatchProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.entries) { + BatchEntry.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BatchProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBatchProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.entries.push(BatchEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BatchProof { + const message = createBaseBatchProof(); + message.entries = object.entries?.map(e => BatchEntry.fromPartial(e)) || []; + return message; + }, + fromAmino(object: BatchProofAmino): BatchProof { + const message = createBaseBatchProof(); + message.entries = object.entries?.map(e => BatchEntry.fromAmino(e)) || []; + return message; + }, + toAmino(message: BatchProof): BatchProofAmino { + const obj: any = {}; + if (message.entries) { + obj.entries = message.entries.map(e => e ? BatchEntry.toAmino(e) : undefined); + } else { + obj.entries = message.entries; + } + return obj; + }, + fromAminoMsg(object: BatchProofAminoMsg): BatchProof { + return BatchProof.fromAmino(object.value); + }, + toAminoMsg(message: BatchProof): BatchProofAminoMsg { + return { + type: "cosmos-sdk/BatchProof", + value: BatchProof.toAmino(message) + }; + }, + fromProtoMsg(message: BatchProofProtoMsg): BatchProof { + return BatchProof.decode(message.value); + }, + toProto(message: BatchProof): Uint8Array { + return BatchProof.encode(message).finish(); + }, + toProtoMsg(message: BatchProof): BatchProofProtoMsg { + return { + typeUrl: "/cosmos.ics23.v1.BatchProof", + value: BatchProof.encode(message).finish() + }; + } +}; +function createBaseBatchEntry(): BatchEntry { + return { + exist: undefined, + nonexist: undefined + }; +} +export const BatchEntry = { + typeUrl: "/cosmos.ics23.v1.BatchEntry", + encode(message: BatchEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.exist !== undefined) { + ExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim(); + } + if (message.nonexist !== undefined) { + NonExistenceProof.encode(message.nonexist, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BatchEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBatchEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exist = ExistenceProof.decode(reader, reader.uint32()); + break; + case 2: + message.nonexist = NonExistenceProof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BatchEntry { + const message = createBaseBatchEntry(); + message.exist = object.exist !== undefined && object.exist !== null ? ExistenceProof.fromPartial(object.exist) : undefined; + message.nonexist = object.nonexist !== undefined && object.nonexist !== null ? NonExistenceProof.fromPartial(object.nonexist) : undefined; + return message; + }, + fromAmino(object: BatchEntryAmino): BatchEntry { + const message = createBaseBatchEntry(); + if (object.exist !== undefined && object.exist !== null) { + message.exist = ExistenceProof.fromAmino(object.exist); + } + if (object.nonexist !== undefined && object.nonexist !== null) { + message.nonexist = NonExistenceProof.fromAmino(object.nonexist); + } + return message; + }, + toAmino(message: BatchEntry): BatchEntryAmino { + const obj: any = {}; + obj.exist = message.exist ? ExistenceProof.toAmino(message.exist) : undefined; + obj.nonexist = message.nonexist ? NonExistenceProof.toAmino(message.nonexist) : undefined; + return obj; + }, + fromAminoMsg(object: BatchEntryAminoMsg): BatchEntry { + return BatchEntry.fromAmino(object.value); + }, + toAminoMsg(message: BatchEntry): BatchEntryAminoMsg { + return { + type: "cosmos-sdk/BatchEntry", + value: BatchEntry.toAmino(message) + }; + }, + fromProtoMsg(message: BatchEntryProtoMsg): BatchEntry { + return BatchEntry.decode(message.value); + }, + toProto(message: BatchEntry): Uint8Array { + return BatchEntry.encode(message).finish(); + }, + toProtoMsg(message: BatchEntry): BatchEntryProtoMsg { + return { + typeUrl: "/cosmos.ics23.v1.BatchEntry", + value: BatchEntry.encode(message).finish() + }; + } +}; +function createBaseCompressedBatchProof(): CompressedBatchProof { + return { + entries: [], + lookupInners: [] + }; +} +export const CompressedBatchProof = { + typeUrl: "/cosmos.ics23.v1.CompressedBatchProof", + encode(message: CompressedBatchProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.entries) { + CompressedBatchEntry.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.lookupInners) { + InnerOp.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CompressedBatchProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCompressedBatchProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.entries.push(CompressedBatchEntry.decode(reader, reader.uint32())); + break; + case 2: + message.lookupInners.push(InnerOp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CompressedBatchProof { + const message = createBaseCompressedBatchProof(); + message.entries = object.entries?.map(e => CompressedBatchEntry.fromPartial(e)) || []; + message.lookupInners = object.lookupInners?.map(e => InnerOp.fromPartial(e)) || []; + return message; + }, + fromAmino(object: CompressedBatchProofAmino): CompressedBatchProof { + const message = createBaseCompressedBatchProof(); + message.entries = object.entries?.map(e => CompressedBatchEntry.fromAmino(e)) || []; + message.lookupInners = object.lookup_inners?.map(e => InnerOp.fromAmino(e)) || []; + return message; + }, + toAmino(message: CompressedBatchProof): CompressedBatchProofAmino { + const obj: any = {}; + if (message.entries) { + obj.entries = message.entries.map(e => e ? CompressedBatchEntry.toAmino(e) : undefined); + } else { + obj.entries = message.entries; + } + if (message.lookupInners) { + obj.lookup_inners = message.lookupInners.map(e => e ? InnerOp.toAmino(e) : undefined); + } else { + obj.lookup_inners = message.lookupInners; + } + return obj; + }, + fromAminoMsg(object: CompressedBatchProofAminoMsg): CompressedBatchProof { + return CompressedBatchProof.fromAmino(object.value); + }, + toAminoMsg(message: CompressedBatchProof): CompressedBatchProofAminoMsg { + return { + type: "cosmos-sdk/CompressedBatchProof", + value: CompressedBatchProof.toAmino(message) + }; + }, + fromProtoMsg(message: CompressedBatchProofProtoMsg): CompressedBatchProof { + return CompressedBatchProof.decode(message.value); + }, + toProto(message: CompressedBatchProof): Uint8Array { + return CompressedBatchProof.encode(message).finish(); + }, + toProtoMsg(message: CompressedBatchProof): CompressedBatchProofProtoMsg { + return { + typeUrl: "/cosmos.ics23.v1.CompressedBatchProof", + value: CompressedBatchProof.encode(message).finish() + }; + } +}; +function createBaseCompressedBatchEntry(): CompressedBatchEntry { + return { + exist: undefined, + nonexist: undefined + }; +} +export const CompressedBatchEntry = { + typeUrl: "/cosmos.ics23.v1.CompressedBatchEntry", + encode(message: CompressedBatchEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.exist !== undefined) { + CompressedExistenceProof.encode(message.exist, writer.uint32(10).fork()).ldelim(); + } + if (message.nonexist !== undefined) { + CompressedNonExistenceProof.encode(message.nonexist, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CompressedBatchEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCompressedBatchEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.exist = CompressedExistenceProof.decode(reader, reader.uint32()); + break; + case 2: + message.nonexist = CompressedNonExistenceProof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CompressedBatchEntry { + const message = createBaseCompressedBatchEntry(); + message.exist = object.exist !== undefined && object.exist !== null ? CompressedExistenceProof.fromPartial(object.exist) : undefined; + message.nonexist = object.nonexist !== undefined && object.nonexist !== null ? CompressedNonExistenceProof.fromPartial(object.nonexist) : undefined; + return message; + }, + fromAmino(object: CompressedBatchEntryAmino): CompressedBatchEntry { + const message = createBaseCompressedBatchEntry(); + if (object.exist !== undefined && object.exist !== null) { + message.exist = CompressedExistenceProof.fromAmino(object.exist); + } + if (object.nonexist !== undefined && object.nonexist !== null) { + message.nonexist = CompressedNonExistenceProof.fromAmino(object.nonexist); + } + return message; + }, + toAmino(message: CompressedBatchEntry): CompressedBatchEntryAmino { + const obj: any = {}; + obj.exist = message.exist ? CompressedExistenceProof.toAmino(message.exist) : undefined; + obj.nonexist = message.nonexist ? CompressedNonExistenceProof.toAmino(message.nonexist) : undefined; + return obj; + }, + fromAminoMsg(object: CompressedBatchEntryAminoMsg): CompressedBatchEntry { + return CompressedBatchEntry.fromAmino(object.value); + }, + toAminoMsg(message: CompressedBatchEntry): CompressedBatchEntryAminoMsg { + return { + type: "cosmos-sdk/CompressedBatchEntry", + value: CompressedBatchEntry.toAmino(message) + }; + }, + fromProtoMsg(message: CompressedBatchEntryProtoMsg): CompressedBatchEntry { + return CompressedBatchEntry.decode(message.value); + }, + toProto(message: CompressedBatchEntry): Uint8Array { + return CompressedBatchEntry.encode(message).finish(); + }, + toProtoMsg(message: CompressedBatchEntry): CompressedBatchEntryProtoMsg { + return { + typeUrl: "/cosmos.ics23.v1.CompressedBatchEntry", + value: CompressedBatchEntry.encode(message).finish() + }; + } +}; +function createBaseCompressedExistenceProof(): CompressedExistenceProof { + return { + key: new Uint8Array(), + value: new Uint8Array(), + leaf: undefined, + path: [] + }; +} +export const CompressedExistenceProof = { + typeUrl: "/cosmos.ics23.v1.CompressedExistenceProof", + encode(message: CompressedExistenceProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + if (message.leaf !== undefined) { + LeafOp.encode(message.leaf, writer.uint32(26).fork()).ldelim(); + } + writer.uint32(34).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CompressedExistenceProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCompressedExistenceProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + case 3: + message.leaf = LeafOp.decode(reader, reader.uint32()); + break; + case 4: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + } else { + message.path.push(reader.int32()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CompressedExistenceProof { + const message = createBaseCompressedExistenceProof(); + message.key = object.key ?? new Uint8Array(); + message.value = object.value ?? new Uint8Array(); + message.leaf = object.leaf !== undefined && object.leaf !== null ? LeafOp.fromPartial(object.leaf) : undefined; + message.path = object.path?.map(e => e) || []; + return message; + }, + fromAmino(object: CompressedExistenceProofAmino): CompressedExistenceProof { + const message = createBaseCompressedExistenceProof(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + if (object.leaf !== undefined && object.leaf !== null) { + message.leaf = LeafOp.fromAmino(object.leaf); + } + message.path = object.path?.map(e => e) || []; + return message; + }, + toAmino(message: CompressedExistenceProof): CompressedExistenceProofAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; + obj.leaf = message.leaf ? LeafOp.toAmino(message.leaf) : undefined; + if (message.path) { + obj.path = message.path.map(e => e); + } else { + obj.path = message.path; + } + return obj; + }, + fromAminoMsg(object: CompressedExistenceProofAminoMsg): CompressedExistenceProof { + return CompressedExistenceProof.fromAmino(object.value); + }, + toAminoMsg(message: CompressedExistenceProof): CompressedExistenceProofAminoMsg { + return { + type: "cosmos-sdk/CompressedExistenceProof", + value: CompressedExistenceProof.toAmino(message) + }; + }, + fromProtoMsg(message: CompressedExistenceProofProtoMsg): CompressedExistenceProof { + return CompressedExistenceProof.decode(message.value); + }, + toProto(message: CompressedExistenceProof): Uint8Array { + return CompressedExistenceProof.encode(message).finish(); + }, + toProtoMsg(message: CompressedExistenceProof): CompressedExistenceProofProtoMsg { + return { + typeUrl: "/cosmos.ics23.v1.CompressedExistenceProof", + value: CompressedExistenceProof.encode(message).finish() + }; + } +}; +function createBaseCompressedNonExistenceProof(): CompressedNonExistenceProof { + return { + key: new Uint8Array(), + left: undefined, + right: undefined + }; +} +export const CompressedNonExistenceProof = { + typeUrl: "/cosmos.ics23.v1.CompressedNonExistenceProof", + encode(message: CompressedNonExistenceProof, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.left !== undefined) { + CompressedExistenceProof.encode(message.left, writer.uint32(18).fork()).ldelim(); + } + if (message.right !== undefined) { + CompressedExistenceProof.encode(message.right, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CompressedNonExistenceProof { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCompressedNonExistenceProof(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.left = CompressedExistenceProof.decode(reader, reader.uint32()); + break; + case 3: + message.right = CompressedExistenceProof.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CompressedNonExistenceProof { + const message = createBaseCompressedNonExistenceProof(); + message.key = object.key ?? new Uint8Array(); + message.left = object.left !== undefined && object.left !== null ? CompressedExistenceProof.fromPartial(object.left) : undefined; + message.right = object.right !== undefined && object.right !== null ? CompressedExistenceProof.fromPartial(object.right) : undefined; + return message; + }, + fromAmino(object: CompressedNonExistenceProofAmino): CompressedNonExistenceProof { + const message = createBaseCompressedNonExistenceProof(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.left !== undefined && object.left !== null) { + message.left = CompressedExistenceProof.fromAmino(object.left); + } + if (object.right !== undefined && object.right !== null) { + message.right = CompressedExistenceProof.fromAmino(object.right); + } + return message; + }, + toAmino(message: CompressedNonExistenceProof): CompressedNonExistenceProofAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.left = message.left ? CompressedExistenceProof.toAmino(message.left) : undefined; + obj.right = message.right ? CompressedExistenceProof.toAmino(message.right) : undefined; + return obj; + }, + fromAminoMsg(object: CompressedNonExistenceProofAminoMsg): CompressedNonExistenceProof { + return CompressedNonExistenceProof.fromAmino(object.value); + }, + toAminoMsg(message: CompressedNonExistenceProof): CompressedNonExistenceProofAminoMsg { + return { + type: "cosmos-sdk/CompressedNonExistenceProof", + value: CompressedNonExistenceProof.toAmino(message) + }; + }, + fromProtoMsg(message: CompressedNonExistenceProofProtoMsg): CompressedNonExistenceProof { + return CompressedNonExistenceProof.decode(message.value); + }, + toProto(message: CompressedNonExistenceProof): Uint8Array { + return CompressedNonExistenceProof.encode(message).finish(); + }, + toProtoMsg(message: CompressedNonExistenceProof): CompressedNonExistenceProofProtoMsg { + return { + typeUrl: "/cosmos.ics23.v1.CompressedNonExistenceProof", + value: CompressedNonExistenceProof.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/lcd.ts b/src/codegen/cosmos/lcd.ts index 9dade04..31ff41c 100644 --- a/src/codegen/cosmos/lcd.ts +++ b/src/codegen/cosmos/lcd.ts @@ -36,6 +36,16 @@ export const createLCDClient = async ({ }) } }, + circuit: { + v1: new (await import("./circuit/v1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, + consensus: { + v1: new (await import("./consensus/v1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, distribution: { v1beta1: new (await import("./distribution/v1beta1/query.lcd")).LCDQueryClient({ requestClient @@ -52,15 +62,28 @@ export const createLCDClient = async ({ }) }, gov: { + v1: new (await import("./gov/v1/query.lcd")).LCDQueryClient({ + requestClient + }), v1beta1: new (await import("./gov/v1beta1/query.lcd")).LCDQueryClient({ requestClient }) }, + group: { + v1: new (await import("./group/v1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, mint: { v1beta1: new (await import("./mint/v1beta1/query.lcd")).LCDQueryClient({ requestClient }) }, + nft: { + v1beta1: new (await import("./nft/v1beta1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, params: { v1beta1: new (await import("./params/v1beta1/query.lcd")).LCDQueryClient({ requestClient diff --git a/src/codegen/cosmos/mint/v1beta1/genesis.ts b/src/codegen/cosmos/mint/v1beta1/genesis.ts index b0cf028..4f9f0e8 100644 --- a/src/codegen/cosmos/mint/v1beta1/genesis.ts +++ b/src/codegen/cosmos/mint/v1beta1/genesis.ts @@ -4,7 +4,7 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; export interface GenesisState { /** minter is a space for holding current inflation information. */ minter: Minter; - /** params defines all the paramaters of the module. */ + /** params defines all the parameters of the module. */ params: Params; } export interface GenesisStateProtoMsg { @@ -14,9 +14,9 @@ export interface GenesisStateProtoMsg { /** GenesisState defines the mint module's genesis state. */ export interface GenesisStateAmino { /** minter is a space for holding current inflation information. */ - minter?: MinterAmino; - /** params defines all the paramaters of the module. */ - params?: ParamsAmino; + minter: MinterAmino; + /** params defines all the parameters of the module. */ + params: ParamsAmino; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -82,8 +82,8 @@ export const GenesisState = { }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; - obj.minter = message.minter ? Minter.toAmino(message.minter) : undefined; - obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.minter = message.minter ? Minter.toAmino(message.minter) : Minter.toAmino(Minter.fromPartial({})); + obj.params = message.params ? Params.toAmino(message.params) : Params.toAmino(Params.fromPartial({})); return obj; }, fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { diff --git a/src/codegen/cosmos/mint/v1beta1/mint.ts b/src/codegen/cosmos/mint/v1beta1/mint.ts index a5e9634..ebca4d3 100644 --- a/src/codegen/cosmos/mint/v1beta1/mint.ts +++ b/src/codegen/cosmos/mint/v1beta1/mint.ts @@ -27,7 +27,7 @@ export interface MinterSDKType { inflation: string; annual_provisions: string; } -/** Params holds parameters for the mint module. */ +/** Params defines the parameters for the x/mint module. */ export interface Params { /** type of coin to mint */ mintDenom: string; @@ -46,26 +46,26 @@ export interface ParamsProtoMsg { typeUrl: "/cosmos.mint.v1beta1.Params"; value: Uint8Array; } -/** Params holds parameters for the mint module. */ +/** Params defines the parameters for the x/mint module. */ export interface ParamsAmino { /** type of coin to mint */ mint_denom?: string; /** maximum annual change in inflation rate */ - inflation_rate_change?: string; + inflation_rate_change: string; /** maximum inflation rate */ - inflation_max?: string; + inflation_max: string; /** minimum inflation rate */ - inflation_min?: string; + inflation_min: string; /** goal of percent bonded atoms */ - goal_bonded?: string; + goal_bonded: string; /** expected blocks per year */ blocks_per_year?: string; } export interface ParamsAminoMsg { - type: "cosmos-sdk/Params"; + type: "cosmos-sdk/x/mint/Params"; value: ParamsAmino; } -/** Params holds parameters for the mint module. */ +/** Params defines the parameters for the x/mint module. */ export interface ParamsSDKType { mint_denom: string; inflation_rate_change: string; @@ -255,10 +255,10 @@ export const Params = { toAmino(message: Params): ParamsAmino { const obj: any = {}; obj.mint_denom = message.mintDenom === "" ? undefined : message.mintDenom; - obj.inflation_rate_change = message.inflationRateChange === "" ? undefined : message.inflationRateChange; - obj.inflation_max = message.inflationMax === "" ? undefined : message.inflationMax; - obj.inflation_min = message.inflationMin === "" ? undefined : message.inflationMin; - obj.goal_bonded = message.goalBonded === "" ? undefined : message.goalBonded; + obj.inflation_rate_change = message.inflationRateChange ?? ""; + obj.inflation_max = message.inflationMax ?? ""; + obj.inflation_min = message.inflationMin ?? ""; + obj.goal_bonded = message.goalBonded ?? ""; obj.blocks_per_year = message.blocksPerYear !== BigInt(0) ? message.blocksPerYear.toString() : undefined; return obj; }, @@ -267,7 +267,7 @@ export const Params = { }, toAminoMsg(message: Params): ParamsAminoMsg { return { - type: "cosmos-sdk/Params", + type: "cosmos-sdk/x/mint/Params", value: Params.toAmino(message) }; }, diff --git a/src/codegen/cosmos/mint/v1beta1/query.ts b/src/codegen/cosmos/mint/v1beta1/query.ts index 5039128..f44f3be 100644 --- a/src/codegen/cosmos/mint/v1beta1/query.ts +++ b/src/codegen/cosmos/mint/v1beta1/query.ts @@ -27,7 +27,7 @@ export interface QueryParamsResponseProtoMsg { /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseAmino { /** params defines the parameters of the module. */ - params?: ParamsAmino; + params: ParamsAmino; } export interface QueryParamsResponseAminoMsg { type: "cosmos-sdk/QueryParamsResponse"; @@ -69,7 +69,7 @@ export interface QueryInflationResponseProtoMsg { */ export interface QueryInflationResponseAmino { /** inflation is the current minting inflation value. */ - inflation?: string; + inflation: string; } export interface QueryInflationResponseAminoMsg { type: "cosmos-sdk/QueryInflationResponse"; @@ -123,7 +123,7 @@ export interface QueryAnnualProvisionsResponseProtoMsg { */ export interface QueryAnnualProvisionsResponseAmino { /** annual_provisions is the current minting annual provisions value. */ - annual_provisions?: string; + annual_provisions: string; } export interface QueryAnnualProvisionsResponseAminoMsg { type: "cosmos-sdk/QueryAnnualProvisionsResponse"; @@ -236,7 +236,7 @@ export const QueryParamsResponse = { }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.params = message.params ? Params.toAmino(message.params) : Params.toAmino(Params.fromPartial({})); return obj; }, fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { @@ -361,7 +361,7 @@ export const QueryInflationResponse = { }, toAmino(message: QueryInflationResponse): QueryInflationResponseAmino { const obj: any = {}; - obj.inflation = message.inflation ? base64FromBytes(message.inflation) : undefined; + obj.inflation = message.inflation ? base64FromBytes(message.inflation) : ""; return obj; }, fromAminoMsg(object: QueryInflationResponseAminoMsg): QueryInflationResponse { @@ -486,7 +486,7 @@ export const QueryAnnualProvisionsResponse = { }, toAmino(message: QueryAnnualProvisionsResponse): QueryAnnualProvisionsResponseAmino { const obj: any = {}; - obj.annual_provisions = message.annualProvisions ? base64FromBytes(message.annualProvisions) : undefined; + obj.annual_provisions = message.annualProvisions ? base64FromBytes(message.annualProvisions) : ""; return obj; }, fromAminoMsg(object: QueryAnnualProvisionsResponseAminoMsg): QueryAnnualProvisionsResponse { diff --git a/src/codegen/cosmos/mint/v1beta1/tx.amino.ts b/src/codegen/cosmos/mint/v1beta1/tx.amino.ts new file mode 100644 index 0000000..8298dfa --- /dev/null +++ b/src/codegen/cosmos/mint/v1beta1/tx.amino.ts @@ -0,0 +1,8 @@ +import { MsgUpdateParams } from "./tx"; +export const AminoConverter = { + "/cosmos.mint.v1beta1.MsgUpdateParams": { + aminoType: "cosmos-sdk/x/mint/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/mint/v1beta1/tx.registry.ts b/src/codegen/cosmos/mint/v1beta1/tx.registry.ts new file mode 100644 index 0000000..3684618 --- /dev/null +++ b/src/codegen/cosmos/mint/v1beta1/tx.registry.ts @@ -0,0 +1,34 @@ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.mint.v1beta1.MsgUpdateParams", MsgUpdateParams]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.mint.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + } + }, + withTypeUrl: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.mint.v1beta1.MsgUpdateParams", + value + }; + } + }, + fromPartial: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.mint.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/mint/v1beta1/tx.rpc.msg.ts b/src/codegen/cosmos/mint/v1beta1/tx.rpc.msg.ts new file mode 100644 index 0000000..929c9da --- /dev/null +++ b/src/codegen/cosmos/mint/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,25 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; +/** Msg defines the x/mint Msg service. */ +export interface Msg { + /** + * UpdateParams defines a governance operation for updating the x/mint module + * parameters. The authority is defaults to the x/gov module account. + * + * Since: cosmos-sdk 0.47 + */ + updateParams(request: MsgUpdateParams): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.updateParams = this.updateParams.bind(this); + } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("cosmos.mint.v1beta1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/src/codegen/cosmos/mint/v1beta1/tx.ts b/src/codegen/cosmos/mint/v1beta1/tx.ts new file mode 100644 index 0000000..94fc308 --- /dev/null +++ b/src/codegen/cosmos/mint/v1beta1/tx.ts @@ -0,0 +1,215 @@ +import { Params, ParamsAmino, ParamsSDKType } from "./mint"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** + * params defines the x/mint parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/cosmos.mint.v1beta1.MsgUpdateParams"; + value: Uint8Array; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; + /** + * params defines the x/mint parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/x/mint/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsSDKType; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/cosmos.mint.v1beta1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseSDKType {} +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/cosmos.mint.v1beta1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.params = message.params ? Params.toAmino(message.params) : Params.toAmino(Params.fromPartial({})); + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/x/mint/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/cosmos.mint.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/cosmos.mint.v1beta1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/cosmos.mint.v1beta1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/msg/textual/v1/textual.ts b/src/codegen/cosmos/msg/textual/v1/textual.ts new file mode 100644 index 0000000..693da49 --- /dev/null +++ b/src/codegen/cosmos/msg/textual/v1/textual.ts @@ -0,0 +1 @@ +export {} \ No newline at end of file diff --git a/src/codegen/cosmos/msg/v1/msg.ts b/src/codegen/cosmos/msg/v1/msg.ts new file mode 100644 index 0000000..693da49 --- /dev/null +++ b/src/codegen/cosmos/msg/v1/msg.ts @@ -0,0 +1 @@ +export {} \ No newline at end of file diff --git a/src/codegen/cosmos/nft/v1beta1/event.ts b/src/codegen/cosmos/nft/v1beta1/event.ts new file mode 100644 index 0000000..fdc54fd --- /dev/null +++ b/src/codegen/cosmos/nft/v1beta1/event.ts @@ -0,0 +1,393 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** EventSend is emitted on Msg/Send */ +export interface EventSend { + /** class_id associated with the nft */ + classId: string; + /** id is a unique identifier of the nft */ + id: string; + /** sender is the address of the owner of nft */ + sender: string; + /** receiver is the receiver address of nft */ + receiver: string; +} +export interface EventSendProtoMsg { + typeUrl: "/cosmos.nft.v1beta1.EventSend"; + value: Uint8Array; +} +/** EventSend is emitted on Msg/Send */ +export interface EventSendAmino { + /** class_id associated with the nft */ + class_id?: string; + /** id is a unique identifier of the nft */ + id?: string; + /** sender is the address of the owner of nft */ + sender?: string; + /** receiver is the receiver address of nft */ + receiver?: string; +} +export interface EventSendAminoMsg { + type: "cosmos-sdk/EventSend"; + value: EventSendAmino; +} +/** EventSend is emitted on Msg/Send */ +export interface EventSendSDKType { + class_id: string; + id: string; + sender: string; + receiver: string; +} +/** EventMint is emitted on Mint */ +export interface EventMint { + /** class_id associated with the nft */ + classId: string; + /** id is a unique identifier of the nft */ + id: string; + /** owner is the owner address of the nft */ + owner: string; +} +export interface EventMintProtoMsg { + typeUrl: "/cosmos.nft.v1beta1.EventMint"; + value: Uint8Array; +} +/** EventMint is emitted on Mint */ +export interface EventMintAmino { + /** class_id associated with the nft */ + class_id?: string; + /** id is a unique identifier of the nft */ + id?: string; + /** owner is the owner address of the nft */ + owner?: string; +} +export interface EventMintAminoMsg { + type: "cosmos-sdk/EventMint"; + value: EventMintAmino; +} +/** EventMint is emitted on Mint */ +export interface EventMintSDKType { + class_id: string; + id: string; + owner: string; +} +/** EventBurn is emitted on Burn */ +export interface EventBurn { + /** class_id associated with the nft */ + classId: string; + /** id is a unique identifier of the nft */ + id: string; + /** owner is the owner address of the nft */ + owner: string; +} +export interface EventBurnProtoMsg { + typeUrl: "/cosmos.nft.v1beta1.EventBurn"; + value: Uint8Array; +} +/** EventBurn is emitted on Burn */ +export interface EventBurnAmino { + /** class_id associated with the nft */ + class_id?: string; + /** id is a unique identifier of the nft */ + id?: string; + /** owner is the owner address of the nft */ + owner?: string; +} +export interface EventBurnAminoMsg { + type: "cosmos-sdk/EventBurn"; + value: EventBurnAmino; +} +/** EventBurn is emitted on Burn */ +export interface EventBurnSDKType { + class_id: string; + id: string; + owner: string; +} +function createBaseEventSend(): EventSend { + return { + classId: "", + id: "", + sender: "", + receiver: "" + }; +} +export const EventSend = { + typeUrl: "/cosmos.nft.v1beta1.EventSend", + encode(message: EventSend, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.classId !== "") { + writer.uint32(10).string(message.classId); + } + if (message.id !== "") { + writer.uint32(18).string(message.id); + } + if (message.sender !== "") { + writer.uint32(26).string(message.sender); + } + if (message.receiver !== "") { + writer.uint32(34).string(message.receiver); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventSend { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventSend(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.classId = reader.string(); + break; + case 2: + message.id = reader.string(); + break; + case 3: + message.sender = reader.string(); + break; + case 4: + message.receiver = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EventSend { + const message = createBaseEventSend(); + message.classId = object.classId ?? ""; + message.id = object.id ?? ""; + message.sender = object.sender ?? ""; + message.receiver = object.receiver ?? ""; + return message; + }, + fromAmino(object: EventSendAmino): EventSend { + const message = createBaseEventSend(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.receiver !== undefined && object.receiver !== null) { + message.receiver = object.receiver; + } + return message; + }, + toAmino(message: EventSend): EventSendAmino { + const obj: any = {}; + obj.class_id = message.classId === "" ? undefined : message.classId; + obj.id = message.id === "" ? undefined : message.id; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.receiver = message.receiver === "" ? undefined : message.receiver; + return obj; + }, + fromAminoMsg(object: EventSendAminoMsg): EventSend { + return EventSend.fromAmino(object.value); + }, + toAminoMsg(message: EventSend): EventSendAminoMsg { + return { + type: "cosmos-sdk/EventSend", + value: EventSend.toAmino(message) + }; + }, + fromProtoMsg(message: EventSendProtoMsg): EventSend { + return EventSend.decode(message.value); + }, + toProto(message: EventSend): Uint8Array { + return EventSend.encode(message).finish(); + }, + toProtoMsg(message: EventSend): EventSendProtoMsg { + return { + typeUrl: "/cosmos.nft.v1beta1.EventSend", + value: EventSend.encode(message).finish() + }; + } +}; +function createBaseEventMint(): EventMint { + return { + classId: "", + id: "", + owner: "" + }; +} +export const EventMint = { + typeUrl: "/cosmos.nft.v1beta1.EventMint", + encode(message: EventMint, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.classId !== "") { + writer.uint32(10).string(message.classId); + } + if (message.id !== "") { + writer.uint32(18).string(message.id); + } + if (message.owner !== "") { + writer.uint32(26).string(message.owner); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventMint { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventMint(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.classId = reader.string(); + break; + case 2: + message.id = reader.string(); + break; + case 3: + message.owner = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EventMint { + const message = createBaseEventMint(); + message.classId = object.classId ?? ""; + message.id = object.id ?? ""; + message.owner = object.owner ?? ""; + return message; + }, + fromAmino(object: EventMintAmino): EventMint { + const message = createBaseEventMint(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + return message; + }, + toAmino(message: EventMint): EventMintAmino { + const obj: any = {}; + obj.class_id = message.classId === "" ? undefined : message.classId; + obj.id = message.id === "" ? undefined : message.id; + obj.owner = message.owner === "" ? undefined : message.owner; + return obj; + }, + fromAminoMsg(object: EventMintAminoMsg): EventMint { + return EventMint.fromAmino(object.value); + }, + toAminoMsg(message: EventMint): EventMintAminoMsg { + return { + type: "cosmos-sdk/EventMint", + value: EventMint.toAmino(message) + }; + }, + fromProtoMsg(message: EventMintProtoMsg): EventMint { + return EventMint.decode(message.value); + }, + toProto(message: EventMint): Uint8Array { + return EventMint.encode(message).finish(); + }, + toProtoMsg(message: EventMint): EventMintProtoMsg { + return { + typeUrl: "/cosmos.nft.v1beta1.EventMint", + value: EventMint.encode(message).finish() + }; + } +}; +function createBaseEventBurn(): EventBurn { + return { + classId: "", + id: "", + owner: "" + }; +} +export const EventBurn = { + typeUrl: "/cosmos.nft.v1beta1.EventBurn", + encode(message: EventBurn, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.classId !== "") { + writer.uint32(10).string(message.classId); + } + if (message.id !== "") { + writer.uint32(18).string(message.id); + } + if (message.owner !== "") { + writer.uint32(26).string(message.owner); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): EventBurn { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEventBurn(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.classId = reader.string(); + break; + case 2: + message.id = reader.string(); + break; + case 3: + message.owner = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): EventBurn { + const message = createBaseEventBurn(); + message.classId = object.classId ?? ""; + message.id = object.id ?? ""; + message.owner = object.owner ?? ""; + return message; + }, + fromAmino(object: EventBurnAmino): EventBurn { + const message = createBaseEventBurn(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + return message; + }, + toAmino(message: EventBurn): EventBurnAmino { + const obj: any = {}; + obj.class_id = message.classId === "" ? undefined : message.classId; + obj.id = message.id === "" ? undefined : message.id; + obj.owner = message.owner === "" ? undefined : message.owner; + return obj; + }, + fromAminoMsg(object: EventBurnAminoMsg): EventBurn { + return EventBurn.fromAmino(object.value); + }, + toAminoMsg(message: EventBurn): EventBurnAminoMsg { + return { + type: "cosmos-sdk/EventBurn", + value: EventBurn.toAmino(message) + }; + }, + fromProtoMsg(message: EventBurnProtoMsg): EventBurn { + return EventBurn.decode(message.value); + }, + toProto(message: EventBurn): Uint8Array { + return EventBurn.encode(message).finish(); + }, + toProtoMsg(message: EventBurn): EventBurnProtoMsg { + return { + typeUrl: "/cosmos.nft.v1beta1.EventBurn", + value: EventBurn.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/nft/v1beta1/genesis.ts b/src/codegen/cosmos/nft/v1beta1/genesis.ts new file mode 100644 index 0000000..6da7db4 --- /dev/null +++ b/src/codegen/cosmos/nft/v1beta1/genesis.ts @@ -0,0 +1,224 @@ +import { Class, ClassAmino, ClassSDKType, NFT, NFTAmino, NFTSDKType } from "./nft"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** GenesisState defines the nft module's genesis state. */ +export interface GenesisState { + /** class defines the class of the nft type. */ + classes: Class[]; + /** entry defines all nft owned by a person. */ + entries: Entry[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmos.nft.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the nft module's genesis state. */ +export interface GenesisStateAmino { + /** class defines the class of the nft type. */ + classes?: ClassAmino[]; + /** entry defines all nft owned by a person. */ + entries?: EntryAmino[]; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the nft module's genesis state. */ +export interface GenesisStateSDKType { + classes: ClassSDKType[]; + entries: EntrySDKType[]; +} +/** Entry Defines all nft owned by a person */ +export interface Entry { + /** owner is the owner address of the following nft */ + owner: string; + /** nfts is a group of nfts of the same owner */ + nfts: NFT[]; +} +export interface EntryProtoMsg { + typeUrl: "/cosmos.nft.v1beta1.Entry"; + value: Uint8Array; +} +/** Entry Defines all nft owned by a person */ +export interface EntryAmino { + /** owner is the owner address of the following nft */ + owner?: string; + /** nfts is a group of nfts of the same owner */ + nfts?: NFTAmino[]; +} +export interface EntryAminoMsg { + type: "cosmos-sdk/Entry"; + value: EntryAmino; +} +/** Entry Defines all nft owned by a person */ +export interface EntrySDKType { + owner: string; + nfts: NFTSDKType[]; +} +function createBaseGenesisState(): GenesisState { + return { + classes: [], + entries: [] + }; +} +export const GenesisState = { + typeUrl: "/cosmos.nft.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.classes) { + Class.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.entries) { + Entry.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.classes.push(Class.decode(reader, reader.uint32())); + break; + case 2: + message.entries.push(Entry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.classes = object.classes?.map(e => Class.fromPartial(e)) || []; + message.entries = object.entries?.map(e => Entry.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + message.classes = object.classes?.map(e => Class.fromAmino(e)) || []; + message.entries = object.entries?.map(e => Entry.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + if (message.classes) { + obj.classes = message.classes.map(e => e ? Class.toAmino(e) : undefined); + } else { + obj.classes = message.classes; + } + if (message.entries) { + obj.entries = message.entries.map(e => e ? Entry.toAmino(e) : undefined); + } else { + obj.entries = message.entries; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: "cosmos-sdk/GenesisState", + value: GenesisState.toAmino(message) + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/cosmos.nft.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +function createBaseEntry(): Entry { + return { + owner: "", + nfts: [] + }; +} +export const Entry = { + typeUrl: "/cosmos.nft.v1beta1.Entry", + encode(message: Entry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.owner !== "") { + writer.uint32(10).string(message.owner); + } + for (const v of message.nfts) { + NFT.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Entry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + case 2: + message.nfts.push(NFT.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Entry { + const message = createBaseEntry(); + message.owner = object.owner ?? ""; + message.nfts = object.nfts?.map(e => NFT.fromPartial(e)) || []; + return message; + }, + fromAmino(object: EntryAmino): Entry { + const message = createBaseEntry(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + message.nfts = object.nfts?.map(e => NFT.fromAmino(e)) || []; + return message; + }, + toAmino(message: Entry): EntryAmino { + const obj: any = {}; + obj.owner = message.owner === "" ? undefined : message.owner; + if (message.nfts) { + obj.nfts = message.nfts.map(e => e ? NFT.toAmino(e) : undefined); + } else { + obj.nfts = message.nfts; + } + return obj; + }, + fromAminoMsg(object: EntryAminoMsg): Entry { + return Entry.fromAmino(object.value); + }, + toAminoMsg(message: Entry): EntryAminoMsg { + return { + type: "cosmos-sdk/Entry", + value: Entry.toAmino(message) + }; + }, + fromProtoMsg(message: EntryProtoMsg): Entry { + return Entry.decode(message.value); + }, + toProto(message: Entry): Uint8Array { + return Entry.encode(message).finish(); + }, + toProtoMsg(message: Entry): EntryProtoMsg { + return { + typeUrl: "/cosmos.nft.v1beta1.Entry", + value: Entry.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/nft/v1beta1/nft.ts b/src/codegen/cosmos/nft/v1beta1/nft.ts new file mode 100644 index 0000000..5ca5bf2 --- /dev/null +++ b/src/codegen/cosmos/nft/v1beta1/nft.ts @@ -0,0 +1,354 @@ +import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** Class defines the class of the nft type. */ +export interface Class { + /** id defines the unique identifier of the NFT classification, similar to the contract address of ERC721 */ + id: string; + /** name defines the human-readable name of the NFT classification. Optional */ + name: string; + /** symbol is an abbreviated name for nft classification. Optional */ + symbol: string; + /** description is a brief description of nft classification. Optional */ + description: string; + /** uri for the class metadata stored off chain. It can define schema for Class and NFT `Data` attributes. Optional */ + uri: string; + /** uri_hash is a hash of the document pointed by uri. Optional */ + uriHash: string; + /** data is the app specific metadata of the NFT class. Optional */ + data?: Any; +} +export interface ClassProtoMsg { + typeUrl: "/cosmos.nft.v1beta1.Class"; + value: Uint8Array; +} +/** Class defines the class of the nft type. */ +export interface ClassAmino { + /** id defines the unique identifier of the NFT classification, similar to the contract address of ERC721 */ + id?: string; + /** name defines the human-readable name of the NFT classification. Optional */ + name?: string; + /** symbol is an abbreviated name for nft classification. Optional */ + symbol?: string; + /** description is a brief description of nft classification. Optional */ + description?: string; + /** uri for the class metadata stored off chain. It can define schema for Class and NFT `Data` attributes. Optional */ + uri?: string; + /** uri_hash is a hash of the document pointed by uri. Optional */ + uri_hash?: string; + /** data is the app specific metadata of the NFT class. Optional */ + data?: AnyAmino; +} +export interface ClassAminoMsg { + type: "cosmos-sdk/Class"; + value: ClassAmino; +} +/** Class defines the class of the nft type. */ +export interface ClassSDKType { + id: string; + name: string; + symbol: string; + description: string; + uri: string; + uri_hash: string; + data?: AnySDKType; +} +/** NFT defines the NFT. */ +export interface NFT { + /** class_id associated with the NFT, similar to the contract address of ERC721 */ + classId: string; + /** id is a unique identifier of the NFT */ + id: string; + /** uri for the NFT metadata stored off chain */ + uri: string; + /** uri_hash is a hash of the document pointed by uri */ + uriHash: string; + /** data is an app specific data of the NFT. Optional */ + data?: Any; +} +export interface NFTProtoMsg { + typeUrl: "/cosmos.nft.v1beta1.NFT"; + value: Uint8Array; +} +/** NFT defines the NFT. */ +export interface NFTAmino { + /** class_id associated with the NFT, similar to the contract address of ERC721 */ + class_id?: string; + /** id is a unique identifier of the NFT */ + id?: string; + /** uri for the NFT metadata stored off chain */ + uri?: string; + /** uri_hash is a hash of the document pointed by uri */ + uri_hash?: string; + /** data is an app specific data of the NFT. Optional */ + data?: AnyAmino; +} +export interface NFTAminoMsg { + type: "cosmos-sdk/NFT"; + value: NFTAmino; +} +/** NFT defines the NFT. */ +export interface NFTSDKType { + class_id: string; + id: string; + uri: string; + uri_hash: string; + data?: AnySDKType; +} +function createBaseClass(): Class { + return { + id: "", + name: "", + symbol: "", + description: "", + uri: "", + uriHash: "", + data: undefined + }; +} +export const Class = { + typeUrl: "/cosmos.nft.v1beta1.Class", + encode(message: Class, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.symbol !== "") { + writer.uint32(26).string(message.symbol); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + if (message.uri !== "") { + writer.uint32(42).string(message.uri); + } + if (message.uriHash !== "") { + writer.uint32(50).string(message.uriHash); + } + if (message.data !== undefined) { + Any.encode(message.data, writer.uint32(58).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Class { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClass(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.symbol = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + message.uri = reader.string(); + break; + case 6: + message.uriHash = reader.string(); + break; + case 7: + message.data = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Class { + const message = createBaseClass(); + message.id = object.id ?? ""; + message.name = object.name ?? ""; + message.symbol = object.symbol ?? ""; + message.description = object.description ?? ""; + message.uri = object.uri ?? ""; + message.uriHash = object.uriHash ?? ""; + message.data = object.data !== undefined && object.data !== null ? Any.fromPartial(object.data) : undefined; + return message; + }, + fromAmino(object: ClassAmino): Class { + const message = createBaseClass(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.symbol !== undefined && object.symbol !== null) { + message.symbol = object.symbol; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.uri !== undefined && object.uri !== null) { + message.uri = object.uri; + } + if (object.uri_hash !== undefined && object.uri_hash !== null) { + message.uriHash = object.uri_hash; + } + if (object.data !== undefined && object.data !== null) { + message.data = Any.fromAmino(object.data); + } + return message; + }, + toAmino(message: Class): ClassAmino { + const obj: any = {}; + obj.id = message.id === "" ? undefined : message.id; + obj.name = message.name === "" ? undefined : message.name; + obj.symbol = message.symbol === "" ? undefined : message.symbol; + obj.description = message.description === "" ? undefined : message.description; + obj.uri = message.uri === "" ? undefined : message.uri; + obj.uri_hash = message.uriHash === "" ? undefined : message.uriHash; + obj.data = message.data ? Any.toAmino(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: ClassAminoMsg): Class { + return Class.fromAmino(object.value); + }, + toAminoMsg(message: Class): ClassAminoMsg { + return { + type: "cosmos-sdk/Class", + value: Class.toAmino(message) + }; + }, + fromProtoMsg(message: ClassProtoMsg): Class { + return Class.decode(message.value); + }, + toProto(message: Class): Uint8Array { + return Class.encode(message).finish(); + }, + toProtoMsg(message: Class): ClassProtoMsg { + return { + typeUrl: "/cosmos.nft.v1beta1.Class", + value: Class.encode(message).finish() + }; + } +}; +function createBaseNFT(): NFT { + return { + classId: "", + id: "", + uri: "", + uriHash: "", + data: undefined + }; +} +export const NFT = { + typeUrl: "/cosmos.nft.v1beta1.NFT", + encode(message: NFT, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.classId !== "") { + writer.uint32(10).string(message.classId); + } + if (message.id !== "") { + writer.uint32(18).string(message.id); + } + if (message.uri !== "") { + writer.uint32(26).string(message.uri); + } + if (message.uriHash !== "") { + writer.uint32(34).string(message.uriHash); + } + if (message.data !== undefined) { + Any.encode(message.data, writer.uint32(82).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): NFT { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNFT(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.classId = reader.string(); + break; + case 2: + message.id = reader.string(); + break; + case 3: + message.uri = reader.string(); + break; + case 4: + message.uriHash = reader.string(); + break; + case 10: + message.data = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): NFT { + const message = createBaseNFT(); + message.classId = object.classId ?? ""; + message.id = object.id ?? ""; + message.uri = object.uri ?? ""; + message.uriHash = object.uriHash ?? ""; + message.data = object.data !== undefined && object.data !== null ? Any.fromPartial(object.data) : undefined; + return message; + }, + fromAmino(object: NFTAmino): NFT { + const message = createBaseNFT(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.uri !== undefined && object.uri !== null) { + message.uri = object.uri; + } + if (object.uri_hash !== undefined && object.uri_hash !== null) { + message.uriHash = object.uri_hash; + } + if (object.data !== undefined && object.data !== null) { + message.data = Any.fromAmino(object.data); + } + return message; + }, + toAmino(message: NFT): NFTAmino { + const obj: any = {}; + obj.class_id = message.classId === "" ? undefined : message.classId; + obj.id = message.id === "" ? undefined : message.id; + obj.uri = message.uri === "" ? undefined : message.uri; + obj.uri_hash = message.uriHash === "" ? undefined : message.uriHash; + obj.data = message.data ? Any.toAmino(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: NFTAminoMsg): NFT { + return NFT.fromAmino(object.value); + }, + toAminoMsg(message: NFT): NFTAminoMsg { + return { + type: "cosmos-sdk/NFT", + value: NFT.toAmino(message) + }; + }, + fromProtoMsg(message: NFTProtoMsg): NFT { + return NFT.decode(message.value); + }, + toProto(message: NFT): Uint8Array { + return NFT.encode(message).finish(); + }, + toProtoMsg(message: NFT): NFTProtoMsg { + return { + typeUrl: "/cosmos.nft.v1beta1.NFT", + value: NFT.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/nft/v1beta1/query.lcd.ts b/src/codegen/cosmos/nft/v1beta1/query.lcd.ts new file mode 100644 index 0000000..a8dec9f --- /dev/null +++ b/src/codegen/cosmos/nft/v1beta1/query.lcd.ts @@ -0,0 +1,76 @@ +import { setPaginationParams } from "../../../helpers"; +import { LCDClient } from "@cosmology/lcd"; +import { QueryBalanceRequest, QueryBalanceResponseSDKType, QueryOwnerRequest, QueryOwnerResponseSDKType, QuerySupplyRequest, QuerySupplyResponseSDKType, QueryNFTsRequest, QueryNFTsResponseSDKType, QueryNFTRequest, QueryNFTResponseSDKType, QueryClassRequest, QueryClassResponseSDKType, QueryClassesRequest, QueryClassesResponseSDKType } from "./query"; +export class LCDQueryClient { + req: LCDClient; + constructor({ + requestClient + }: { + requestClient: LCDClient; + }) { + this.req = requestClient; + this.balance = this.balance.bind(this); + this.owner = this.owner.bind(this); + this.supply = this.supply.bind(this); + this.nFTs = this.nFTs.bind(this); + this.nFT = this.nFT.bind(this); + this.class = this.class.bind(this); + this.classes = this.classes.bind(this); + } + /* Balance queries the number of NFTs of a given class owned by the owner, same as balanceOf in ERC721 */ + async balance(params: QueryBalanceRequest): Promise { + const endpoint = `cosmos/nft/v1beta1/balance/${params.owner}/${params.classId}`; + return await this.req.get(endpoint); + } + /* Owner queries the owner of the NFT based on its class and id, same as ownerOf in ERC721 */ + async owner(params: QueryOwnerRequest): Promise { + const endpoint = `cosmos/nft/v1beta1/owner/${params.classId}/${params.id}`; + return await this.req.get(endpoint); + } + /* Supply queries the number of NFTs from the given class, same as totalSupply of ERC721. */ + async supply(params: QuerySupplyRequest): Promise { + const endpoint = `cosmos/nft/v1beta1/supply/${params.classId}`; + return await this.req.get(endpoint); + } + /* NFTs queries all NFTs of a given class or owner,choose at least one of the two, similar to tokenByIndex in + ERC721Enumerable */ + async nFTs(params: QueryNFTsRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.classId !== "undefined") { + options.params.class_id = params.classId; + } + if (typeof params?.owner !== "undefined") { + options.params.owner = params.owner; + } + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + const endpoint = `cosmos/nft/v1beta1/nfts`; + return await this.req.get(endpoint, options); + } + /* NFT queries an NFT based on its class and id. */ + async nFT(params: QueryNFTRequest): Promise { + const endpoint = `cosmos/nft/v1beta1/nfts/${params.classId}/${params.id}`; + return await this.req.get(endpoint); + } + /* Class queries an NFT class based on its id */ + async class(params: QueryClassRequest): Promise { + const endpoint = `cosmos/nft/v1beta1/classes/${params.classId}`; + return await this.req.get(endpoint); + } + /* Classes queries all NFT classes */ + async classes(params: QueryClassesRequest = { + pagination: undefined + }): Promise { + const options: any = { + params: {} + }; + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + const endpoint = `cosmos/nft/v1beta1/classes`; + return await this.req.get(endpoint, options); + } +} \ No newline at end of file diff --git a/src/codegen/cosmos/nft/v1beta1/query.rpc.Query.ts b/src/codegen/cosmos/nft/v1beta1/query.rpc.Query.ts new file mode 100644 index 0000000..4b96e9e --- /dev/null +++ b/src/codegen/cosmos/nft/v1beta1/query.rpc.Query.ts @@ -0,0 +1,101 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryBalanceRequest, QueryBalanceResponse, QueryOwnerRequest, QueryOwnerResponse, QuerySupplyRequest, QuerySupplyResponse, QueryNFTsRequest, QueryNFTsResponse, QueryNFTRequest, QueryNFTResponse, QueryClassRequest, QueryClassResponse, QueryClassesRequest, QueryClassesResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** Balance queries the number of NFTs of a given class owned by the owner, same as balanceOf in ERC721 */ + balance(request: QueryBalanceRequest): Promise; + /** Owner queries the owner of the NFT based on its class and id, same as ownerOf in ERC721 */ + owner(request: QueryOwnerRequest): Promise; + /** Supply queries the number of NFTs from the given class, same as totalSupply of ERC721. */ + supply(request: QuerySupplyRequest): Promise; + /** + * NFTs queries all NFTs of a given class or owner,choose at least one of the two, similar to tokenByIndex in + * ERC721Enumerable + */ + nFTs(request: QueryNFTsRequest): Promise; + /** NFT queries an NFT based on its class and id. */ + nFT(request: QueryNFTRequest): Promise; + /** Class queries an NFT class based on its id */ + class(request: QueryClassRequest): Promise; + /** Classes queries all NFT classes */ + classes(request?: QueryClassesRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.balance = this.balance.bind(this); + this.owner = this.owner.bind(this); + this.supply = this.supply.bind(this); + this.nFTs = this.nFTs.bind(this); + this.nFT = this.nFT.bind(this); + this.class = this.class.bind(this); + this.classes = this.classes.bind(this); + } + balance(request: QueryBalanceRequest): Promise { + const data = QueryBalanceRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.nft.v1beta1.Query", "Balance", data); + return promise.then(data => QueryBalanceResponse.decode(new BinaryReader(data))); + } + owner(request: QueryOwnerRequest): Promise { + const data = QueryOwnerRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.nft.v1beta1.Query", "Owner", data); + return promise.then(data => QueryOwnerResponse.decode(new BinaryReader(data))); + } + supply(request: QuerySupplyRequest): Promise { + const data = QuerySupplyRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.nft.v1beta1.Query", "Supply", data); + return promise.then(data => QuerySupplyResponse.decode(new BinaryReader(data))); + } + nFTs(request: QueryNFTsRequest): Promise { + const data = QueryNFTsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.nft.v1beta1.Query", "NFTs", data); + return promise.then(data => QueryNFTsResponse.decode(new BinaryReader(data))); + } + nFT(request: QueryNFTRequest): Promise { + const data = QueryNFTRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.nft.v1beta1.Query", "NFT", data); + return promise.then(data => QueryNFTResponse.decode(new BinaryReader(data))); + } + class(request: QueryClassRequest): Promise { + const data = QueryClassRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.nft.v1beta1.Query", "Class", data); + return promise.then(data => QueryClassResponse.decode(new BinaryReader(data))); + } + classes(request: QueryClassesRequest = { + pagination: undefined + }): Promise { + const data = QueryClassesRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.nft.v1beta1.Query", "Classes", data); + return promise.then(data => QueryClassesResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + balance(request: QueryBalanceRequest): Promise { + return queryService.balance(request); + }, + owner(request: QueryOwnerRequest): Promise { + return queryService.owner(request); + }, + supply(request: QuerySupplyRequest): Promise { + return queryService.supply(request); + }, + nFTs(request: QueryNFTsRequest): Promise { + return queryService.nFTs(request); + }, + nFT(request: QueryNFTRequest): Promise { + return queryService.nFT(request); + }, + class(request: QueryClassRequest): Promise { + return queryService.class(request); + }, + classes(request?: QueryClassesRequest): Promise { + return queryService.classes(request); + } + }; +}; \ No newline at end of file diff --git a/src/codegen/cosmos/nft/v1beta1/query.ts b/src/codegen/cosmos/nft/v1beta1/query.ts new file mode 100644 index 0000000..ac406c3 --- /dev/null +++ b/src/codegen/cosmos/nft/v1beta1/query.ts @@ -0,0 +1,1400 @@ +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../base/query/v1beta1/pagination"; +import { NFT, NFTAmino, NFTSDKType, Class, ClassAmino, ClassSDKType } from "./nft"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** QueryBalanceRequest is the request type for the Query/Balance RPC method */ +export interface QueryBalanceRequest { + /** class_id associated with the nft */ + classId: string; + /** owner is the owner address of the nft */ + owner: string; +} +export interface QueryBalanceRequestProtoMsg { + typeUrl: "/cosmos.nft.v1beta1.QueryBalanceRequest"; + value: Uint8Array; +} +/** QueryBalanceRequest is the request type for the Query/Balance RPC method */ +export interface QueryBalanceRequestAmino { + /** class_id associated with the nft */ + class_id?: string; + /** owner is the owner address of the nft */ + owner?: string; +} +export interface QueryBalanceRequestAminoMsg { + type: "cosmos-sdk/QueryBalanceRequest"; + value: QueryBalanceRequestAmino; +} +/** QueryBalanceRequest is the request type for the Query/Balance RPC method */ +export interface QueryBalanceRequestSDKType { + class_id: string; + owner: string; +} +/** QueryBalanceResponse is the response type for the Query/Balance RPC method */ +export interface QueryBalanceResponse { + /** amount is the number of all NFTs of a given class owned by the owner */ + amount: bigint; +} +export interface QueryBalanceResponseProtoMsg { + typeUrl: "/cosmos.nft.v1beta1.QueryBalanceResponse"; + value: Uint8Array; +} +/** QueryBalanceResponse is the response type for the Query/Balance RPC method */ +export interface QueryBalanceResponseAmino { + /** amount is the number of all NFTs of a given class owned by the owner */ + amount?: string; +} +export interface QueryBalanceResponseAminoMsg { + type: "cosmos-sdk/QueryBalanceResponse"; + value: QueryBalanceResponseAmino; +} +/** QueryBalanceResponse is the response type for the Query/Balance RPC method */ +export interface QueryBalanceResponseSDKType { + amount: bigint; +} +/** QueryOwnerRequest is the request type for the Query/Owner RPC method */ +export interface QueryOwnerRequest { + /** class_id associated with the nft */ + classId: string; + /** id is a unique identifier of the NFT */ + id: string; +} +export interface QueryOwnerRequestProtoMsg { + typeUrl: "/cosmos.nft.v1beta1.QueryOwnerRequest"; + value: Uint8Array; +} +/** QueryOwnerRequest is the request type for the Query/Owner RPC method */ +export interface QueryOwnerRequestAmino { + /** class_id associated with the nft */ + class_id?: string; + /** id is a unique identifier of the NFT */ + id?: string; +} +export interface QueryOwnerRequestAminoMsg { + type: "cosmos-sdk/QueryOwnerRequest"; + value: QueryOwnerRequestAmino; +} +/** QueryOwnerRequest is the request type for the Query/Owner RPC method */ +export interface QueryOwnerRequestSDKType { + class_id: string; + id: string; +} +/** QueryOwnerResponse is the response type for the Query/Owner RPC method */ +export interface QueryOwnerResponse { + /** owner is the owner address of the nft */ + owner: string; +} +export interface QueryOwnerResponseProtoMsg { + typeUrl: "/cosmos.nft.v1beta1.QueryOwnerResponse"; + value: Uint8Array; +} +/** QueryOwnerResponse is the response type for the Query/Owner RPC method */ +export interface QueryOwnerResponseAmino { + /** owner is the owner address of the nft */ + owner?: string; +} +export interface QueryOwnerResponseAminoMsg { + type: "cosmos-sdk/QueryOwnerResponse"; + value: QueryOwnerResponseAmino; +} +/** QueryOwnerResponse is the response type for the Query/Owner RPC method */ +export interface QueryOwnerResponseSDKType { + owner: string; +} +/** QuerySupplyRequest is the request type for the Query/Supply RPC method */ +export interface QuerySupplyRequest { + /** class_id associated with the nft */ + classId: string; +} +export interface QuerySupplyRequestProtoMsg { + typeUrl: "/cosmos.nft.v1beta1.QuerySupplyRequest"; + value: Uint8Array; +} +/** QuerySupplyRequest is the request type for the Query/Supply RPC method */ +export interface QuerySupplyRequestAmino { + /** class_id associated with the nft */ + class_id?: string; +} +export interface QuerySupplyRequestAminoMsg { + type: "cosmos-sdk/QuerySupplyRequest"; + value: QuerySupplyRequestAmino; +} +/** QuerySupplyRequest is the request type for the Query/Supply RPC method */ +export interface QuerySupplyRequestSDKType { + class_id: string; +} +/** QuerySupplyResponse is the response type for the Query/Supply RPC method */ +export interface QuerySupplyResponse { + /** amount is the number of all NFTs from the given class */ + amount: bigint; +} +export interface QuerySupplyResponseProtoMsg { + typeUrl: "/cosmos.nft.v1beta1.QuerySupplyResponse"; + value: Uint8Array; +} +/** QuerySupplyResponse is the response type for the Query/Supply RPC method */ +export interface QuerySupplyResponseAmino { + /** amount is the number of all NFTs from the given class */ + amount?: string; +} +export interface QuerySupplyResponseAminoMsg { + type: "cosmos-sdk/QuerySupplyResponse"; + value: QuerySupplyResponseAmino; +} +/** QuerySupplyResponse is the response type for the Query/Supply RPC method */ +export interface QuerySupplyResponseSDKType { + amount: bigint; +} +/** QueryNFTstRequest is the request type for the Query/NFTs RPC method */ +export interface QueryNFTsRequest { + /** class_id associated with the nft */ + classId: string; + /** owner is the owner address of the nft */ + owner: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryNFTsRequestProtoMsg { + typeUrl: "/cosmos.nft.v1beta1.QueryNFTsRequest"; + value: Uint8Array; +} +/** QueryNFTstRequest is the request type for the Query/NFTs RPC method */ +export interface QueryNFTsRequestAmino { + /** class_id associated with the nft */ + class_id?: string; + /** owner is the owner address of the nft */ + owner?: string; + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryNFTsRequestAminoMsg { + type: "cosmos-sdk/QueryNFTsRequest"; + value: QueryNFTsRequestAmino; +} +/** QueryNFTstRequest is the request type for the Query/NFTs RPC method */ +export interface QueryNFTsRequestSDKType { + class_id: string; + owner: string; + pagination?: PageRequestSDKType; +} +/** QueryNFTsResponse is the response type for the Query/NFTs RPC methods */ +export interface QueryNFTsResponse { + /** NFT defines the NFT */ + nfts: NFT[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryNFTsResponseProtoMsg { + typeUrl: "/cosmos.nft.v1beta1.QueryNFTsResponse"; + value: Uint8Array; +} +/** QueryNFTsResponse is the response type for the Query/NFTs RPC methods */ +export interface QueryNFTsResponseAmino { + /** NFT defines the NFT */ + nfts?: NFTAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryNFTsResponseAminoMsg { + type: "cosmos-sdk/QueryNFTsResponse"; + value: QueryNFTsResponseAmino; +} +/** QueryNFTsResponse is the response type for the Query/NFTs RPC methods */ +export interface QueryNFTsResponseSDKType { + nfts: NFTSDKType[]; + pagination?: PageResponseSDKType; +} +/** QueryNFTRequest is the request type for the Query/NFT RPC method */ +export interface QueryNFTRequest { + /** class_id associated with the nft */ + classId: string; + /** id is a unique identifier of the NFT */ + id: string; +} +export interface QueryNFTRequestProtoMsg { + typeUrl: "/cosmos.nft.v1beta1.QueryNFTRequest"; + value: Uint8Array; +} +/** QueryNFTRequest is the request type for the Query/NFT RPC method */ +export interface QueryNFTRequestAmino { + /** class_id associated with the nft */ + class_id?: string; + /** id is a unique identifier of the NFT */ + id?: string; +} +export interface QueryNFTRequestAminoMsg { + type: "cosmos-sdk/QueryNFTRequest"; + value: QueryNFTRequestAmino; +} +/** QueryNFTRequest is the request type for the Query/NFT RPC method */ +export interface QueryNFTRequestSDKType { + class_id: string; + id: string; +} +/** QueryNFTResponse is the response type for the Query/NFT RPC method */ +export interface QueryNFTResponse { + /** owner is the owner address of the nft */ + nft?: NFT; +} +export interface QueryNFTResponseProtoMsg { + typeUrl: "/cosmos.nft.v1beta1.QueryNFTResponse"; + value: Uint8Array; +} +/** QueryNFTResponse is the response type for the Query/NFT RPC method */ +export interface QueryNFTResponseAmino { + /** owner is the owner address of the nft */ + nft?: NFTAmino; +} +export interface QueryNFTResponseAminoMsg { + type: "cosmos-sdk/QueryNFTResponse"; + value: QueryNFTResponseAmino; +} +/** QueryNFTResponse is the response type for the Query/NFT RPC method */ +export interface QueryNFTResponseSDKType { + nft?: NFTSDKType; +} +/** QueryClassRequest is the request type for the Query/Class RPC method */ +export interface QueryClassRequest { + /** class_id associated with the nft */ + classId: string; +} +export interface QueryClassRequestProtoMsg { + typeUrl: "/cosmos.nft.v1beta1.QueryClassRequest"; + value: Uint8Array; +} +/** QueryClassRequest is the request type for the Query/Class RPC method */ +export interface QueryClassRequestAmino { + /** class_id associated with the nft */ + class_id?: string; +} +export interface QueryClassRequestAminoMsg { + type: "cosmos-sdk/QueryClassRequest"; + value: QueryClassRequestAmino; +} +/** QueryClassRequest is the request type for the Query/Class RPC method */ +export interface QueryClassRequestSDKType { + class_id: string; +} +/** QueryClassResponse is the response type for the Query/Class RPC method */ +export interface QueryClassResponse { + /** class defines the class of the nft type. */ + class?: Class; +} +export interface QueryClassResponseProtoMsg { + typeUrl: "/cosmos.nft.v1beta1.QueryClassResponse"; + value: Uint8Array; +} +/** QueryClassResponse is the response type for the Query/Class RPC method */ +export interface QueryClassResponseAmino { + /** class defines the class of the nft type. */ + class?: ClassAmino; +} +export interface QueryClassResponseAminoMsg { + type: "cosmos-sdk/QueryClassResponse"; + value: QueryClassResponseAmino; +} +/** QueryClassResponse is the response type for the Query/Class RPC method */ +export interface QueryClassResponseSDKType { + class?: ClassSDKType; +} +/** QueryClassesRequest is the request type for the Query/Classes RPC method */ +export interface QueryClassesRequest { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryClassesRequestProtoMsg { + typeUrl: "/cosmos.nft.v1beta1.QueryClassesRequest"; + value: Uint8Array; +} +/** QueryClassesRequest is the request type for the Query/Classes RPC method */ +export interface QueryClassesRequestAmino { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryClassesRequestAminoMsg { + type: "cosmos-sdk/QueryClassesRequest"; + value: QueryClassesRequestAmino; +} +/** QueryClassesRequest is the request type for the Query/Classes RPC method */ +export interface QueryClassesRequestSDKType { + pagination?: PageRequestSDKType; +} +/** QueryClassesResponse is the response type for the Query/Classes RPC method */ +export interface QueryClassesResponse { + /** class defines the class of the nft type. */ + classes: Class[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryClassesResponseProtoMsg { + typeUrl: "/cosmos.nft.v1beta1.QueryClassesResponse"; + value: Uint8Array; +} +/** QueryClassesResponse is the response type for the Query/Classes RPC method */ +export interface QueryClassesResponseAmino { + /** class defines the class of the nft type. */ + classes?: ClassAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryClassesResponseAminoMsg { + type: "cosmos-sdk/QueryClassesResponse"; + value: QueryClassesResponseAmino; +} +/** QueryClassesResponse is the response type for the Query/Classes RPC method */ +export interface QueryClassesResponseSDKType { + classes: ClassSDKType[]; + pagination?: PageResponseSDKType; +} +function createBaseQueryBalanceRequest(): QueryBalanceRequest { + return { + classId: "", + owner: "" + }; +} +export const QueryBalanceRequest = { + typeUrl: "/cosmos.nft.v1beta1.QueryBalanceRequest", + encode(message: QueryBalanceRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.classId !== "") { + writer.uint32(10).string(message.classId); + } + if (message.owner !== "") { + writer.uint32(18).string(message.owner); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBalanceRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBalanceRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.classId = reader.string(); + break; + case 2: + message.owner = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryBalanceRequest { + const message = createBaseQueryBalanceRequest(); + message.classId = object.classId ?? ""; + message.owner = object.owner ?? ""; + return message; + }, + fromAmino(object: QueryBalanceRequestAmino): QueryBalanceRequest { + const message = createBaseQueryBalanceRequest(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + return message; + }, + toAmino(message: QueryBalanceRequest): QueryBalanceRequestAmino { + const obj: any = {}; + obj.class_id = message.classId === "" ? undefined : message.classId; + obj.owner = message.owner === "" ? undefined : message.owner; + return obj; + }, + fromAminoMsg(object: QueryBalanceRequestAminoMsg): QueryBalanceRequest { + return QueryBalanceRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryBalanceRequest): QueryBalanceRequestAminoMsg { + return { + type: "cosmos-sdk/QueryBalanceRequest", + value: QueryBalanceRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryBalanceRequestProtoMsg): QueryBalanceRequest { + return QueryBalanceRequest.decode(message.value); + }, + toProto(message: QueryBalanceRequest): Uint8Array { + return QueryBalanceRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryBalanceRequest): QueryBalanceRequestProtoMsg { + return { + typeUrl: "/cosmos.nft.v1beta1.QueryBalanceRequest", + value: QueryBalanceRequest.encode(message).finish() + }; + } +}; +function createBaseQueryBalanceResponse(): QueryBalanceResponse { + return { + amount: BigInt(0) + }; +} +export const QueryBalanceResponse = { + typeUrl: "/cosmos.nft.v1beta1.QueryBalanceResponse", + encode(message: QueryBalanceResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.amount !== BigInt(0)) { + writer.uint32(8).uint64(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBalanceResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBalanceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryBalanceResponse { + const message = createBaseQueryBalanceResponse(); + message.amount = object.amount !== undefined && object.amount !== null ? BigInt(object.amount.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryBalanceResponseAmino): QueryBalanceResponse { + const message = createBaseQueryBalanceResponse(); + if (object.amount !== undefined && object.amount !== null) { + message.amount = BigInt(object.amount); + } + return message; + }, + toAmino(message: QueryBalanceResponse): QueryBalanceResponseAmino { + const obj: any = {}; + obj.amount = message.amount !== BigInt(0) ? message.amount.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryBalanceResponseAminoMsg): QueryBalanceResponse { + return QueryBalanceResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryBalanceResponse): QueryBalanceResponseAminoMsg { + return { + type: "cosmos-sdk/QueryBalanceResponse", + value: QueryBalanceResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryBalanceResponseProtoMsg): QueryBalanceResponse { + return QueryBalanceResponse.decode(message.value); + }, + toProto(message: QueryBalanceResponse): Uint8Array { + return QueryBalanceResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryBalanceResponse): QueryBalanceResponseProtoMsg { + return { + typeUrl: "/cosmos.nft.v1beta1.QueryBalanceResponse", + value: QueryBalanceResponse.encode(message).finish() + }; + } +}; +function createBaseQueryOwnerRequest(): QueryOwnerRequest { + return { + classId: "", + id: "" + }; +} +export const QueryOwnerRequest = { + typeUrl: "/cosmos.nft.v1beta1.QueryOwnerRequest", + encode(message: QueryOwnerRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.classId !== "") { + writer.uint32(10).string(message.classId); + } + if (message.id !== "") { + writer.uint32(18).string(message.id); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryOwnerRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOwnerRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.classId = reader.string(); + break; + case 2: + message.id = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryOwnerRequest { + const message = createBaseQueryOwnerRequest(); + message.classId = object.classId ?? ""; + message.id = object.id ?? ""; + return message; + }, + fromAmino(object: QueryOwnerRequestAmino): QueryOwnerRequest { + const message = createBaseQueryOwnerRequest(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + return message; + }, + toAmino(message: QueryOwnerRequest): QueryOwnerRequestAmino { + const obj: any = {}; + obj.class_id = message.classId === "" ? undefined : message.classId; + obj.id = message.id === "" ? undefined : message.id; + return obj; + }, + fromAminoMsg(object: QueryOwnerRequestAminoMsg): QueryOwnerRequest { + return QueryOwnerRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryOwnerRequest): QueryOwnerRequestAminoMsg { + return { + type: "cosmos-sdk/QueryOwnerRequest", + value: QueryOwnerRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryOwnerRequestProtoMsg): QueryOwnerRequest { + return QueryOwnerRequest.decode(message.value); + }, + toProto(message: QueryOwnerRequest): Uint8Array { + return QueryOwnerRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryOwnerRequest): QueryOwnerRequestProtoMsg { + return { + typeUrl: "/cosmos.nft.v1beta1.QueryOwnerRequest", + value: QueryOwnerRequest.encode(message).finish() + }; + } +}; +function createBaseQueryOwnerResponse(): QueryOwnerResponse { + return { + owner: "" + }; +} +export const QueryOwnerResponse = { + typeUrl: "/cosmos.nft.v1beta1.QueryOwnerResponse", + encode(message: QueryOwnerResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.owner !== "") { + writer.uint32(10).string(message.owner); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryOwnerResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryOwnerResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryOwnerResponse { + const message = createBaseQueryOwnerResponse(); + message.owner = object.owner ?? ""; + return message; + }, + fromAmino(object: QueryOwnerResponseAmino): QueryOwnerResponse { + const message = createBaseQueryOwnerResponse(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + return message; + }, + toAmino(message: QueryOwnerResponse): QueryOwnerResponseAmino { + const obj: any = {}; + obj.owner = message.owner === "" ? undefined : message.owner; + return obj; + }, + fromAminoMsg(object: QueryOwnerResponseAminoMsg): QueryOwnerResponse { + return QueryOwnerResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryOwnerResponse): QueryOwnerResponseAminoMsg { + return { + type: "cosmos-sdk/QueryOwnerResponse", + value: QueryOwnerResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryOwnerResponseProtoMsg): QueryOwnerResponse { + return QueryOwnerResponse.decode(message.value); + }, + toProto(message: QueryOwnerResponse): Uint8Array { + return QueryOwnerResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryOwnerResponse): QueryOwnerResponseProtoMsg { + return { + typeUrl: "/cosmos.nft.v1beta1.QueryOwnerResponse", + value: QueryOwnerResponse.encode(message).finish() + }; + } +}; +function createBaseQuerySupplyRequest(): QuerySupplyRequest { + return { + classId: "" + }; +} +export const QuerySupplyRequest = { + typeUrl: "/cosmos.nft.v1beta1.QuerySupplyRequest", + encode(message: QuerySupplyRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.classId !== "") { + writer.uint32(10).string(message.classId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySupplyRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySupplyRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.classId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QuerySupplyRequest { + const message = createBaseQuerySupplyRequest(); + message.classId = object.classId ?? ""; + return message; + }, + fromAmino(object: QuerySupplyRequestAmino): QuerySupplyRequest { + const message = createBaseQuerySupplyRequest(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + return message; + }, + toAmino(message: QuerySupplyRequest): QuerySupplyRequestAmino { + const obj: any = {}; + obj.class_id = message.classId === "" ? undefined : message.classId; + return obj; + }, + fromAminoMsg(object: QuerySupplyRequestAminoMsg): QuerySupplyRequest { + return QuerySupplyRequest.fromAmino(object.value); + }, + toAminoMsg(message: QuerySupplyRequest): QuerySupplyRequestAminoMsg { + return { + type: "cosmos-sdk/QuerySupplyRequest", + value: QuerySupplyRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySupplyRequestProtoMsg): QuerySupplyRequest { + return QuerySupplyRequest.decode(message.value); + }, + toProto(message: QuerySupplyRequest): Uint8Array { + return QuerySupplyRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySupplyRequest): QuerySupplyRequestProtoMsg { + return { + typeUrl: "/cosmos.nft.v1beta1.QuerySupplyRequest", + value: QuerySupplyRequest.encode(message).finish() + }; + } +}; +function createBaseQuerySupplyResponse(): QuerySupplyResponse { + return { + amount: BigInt(0) + }; +} +export const QuerySupplyResponse = { + typeUrl: "/cosmos.nft.v1beta1.QuerySupplyResponse", + encode(message: QuerySupplyResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.amount !== BigInt(0)) { + writer.uint32(8).uint64(message.amount); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySupplyResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySupplyResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QuerySupplyResponse { + const message = createBaseQuerySupplyResponse(); + message.amount = object.amount !== undefined && object.amount !== null ? BigInt(object.amount.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QuerySupplyResponseAmino): QuerySupplyResponse { + const message = createBaseQuerySupplyResponse(); + if (object.amount !== undefined && object.amount !== null) { + message.amount = BigInt(object.amount); + } + return message; + }, + toAmino(message: QuerySupplyResponse): QuerySupplyResponseAmino { + const obj: any = {}; + obj.amount = message.amount !== BigInt(0) ? message.amount.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QuerySupplyResponseAminoMsg): QuerySupplyResponse { + return QuerySupplyResponse.fromAmino(object.value); + }, + toAminoMsg(message: QuerySupplyResponse): QuerySupplyResponseAminoMsg { + return { + type: "cosmos-sdk/QuerySupplyResponse", + value: QuerySupplyResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySupplyResponseProtoMsg): QuerySupplyResponse { + return QuerySupplyResponse.decode(message.value); + }, + toProto(message: QuerySupplyResponse): Uint8Array { + return QuerySupplyResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySupplyResponse): QuerySupplyResponseProtoMsg { + return { + typeUrl: "/cosmos.nft.v1beta1.QuerySupplyResponse", + value: QuerySupplyResponse.encode(message).finish() + }; + } +}; +function createBaseQueryNFTsRequest(): QueryNFTsRequest { + return { + classId: "", + owner: "", + pagination: undefined + }; +} +export const QueryNFTsRequest = { + typeUrl: "/cosmos.nft.v1beta1.QueryNFTsRequest", + encode(message: QueryNFTsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.classId !== "") { + writer.uint32(10).string(message.classId); + } + if (message.owner !== "") { + writer.uint32(18).string(message.owner); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryNFTsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNFTsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.classId = reader.string(); + break; + case 2: + message.owner = reader.string(); + break; + case 3: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryNFTsRequest { + const message = createBaseQueryNFTsRequest(); + message.classId = object.classId ?? ""; + message.owner = object.owner ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryNFTsRequestAmino): QueryNFTsRequest { + const message = createBaseQueryNFTsRequest(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryNFTsRequest): QueryNFTsRequestAmino { + const obj: any = {}; + obj.class_id = message.classId === "" ? undefined : message.classId; + obj.owner = message.owner === "" ? undefined : message.owner; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryNFTsRequestAminoMsg): QueryNFTsRequest { + return QueryNFTsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryNFTsRequest): QueryNFTsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryNFTsRequest", + value: QueryNFTsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryNFTsRequestProtoMsg): QueryNFTsRequest { + return QueryNFTsRequest.decode(message.value); + }, + toProto(message: QueryNFTsRequest): Uint8Array { + return QueryNFTsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryNFTsRequest): QueryNFTsRequestProtoMsg { + return { + typeUrl: "/cosmos.nft.v1beta1.QueryNFTsRequest", + value: QueryNFTsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryNFTsResponse(): QueryNFTsResponse { + return { + nfts: [], + pagination: undefined + }; +} +export const QueryNFTsResponse = { + typeUrl: "/cosmos.nft.v1beta1.QueryNFTsResponse", + encode(message: QueryNFTsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.nfts) { + NFT.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryNFTsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNFTsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nfts.push(NFT.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryNFTsResponse { + const message = createBaseQueryNFTsResponse(); + message.nfts = object.nfts?.map(e => NFT.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryNFTsResponseAmino): QueryNFTsResponse { + const message = createBaseQueryNFTsResponse(); + message.nfts = object.nfts?.map(e => NFT.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryNFTsResponse): QueryNFTsResponseAmino { + const obj: any = {}; + if (message.nfts) { + obj.nfts = message.nfts.map(e => e ? NFT.toAmino(e) : undefined); + } else { + obj.nfts = message.nfts; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryNFTsResponseAminoMsg): QueryNFTsResponse { + return QueryNFTsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryNFTsResponse): QueryNFTsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryNFTsResponse", + value: QueryNFTsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryNFTsResponseProtoMsg): QueryNFTsResponse { + return QueryNFTsResponse.decode(message.value); + }, + toProto(message: QueryNFTsResponse): Uint8Array { + return QueryNFTsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryNFTsResponse): QueryNFTsResponseProtoMsg { + return { + typeUrl: "/cosmos.nft.v1beta1.QueryNFTsResponse", + value: QueryNFTsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryNFTRequest(): QueryNFTRequest { + return { + classId: "", + id: "" + }; +} +export const QueryNFTRequest = { + typeUrl: "/cosmos.nft.v1beta1.QueryNFTRequest", + encode(message: QueryNFTRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.classId !== "") { + writer.uint32(10).string(message.classId); + } + if (message.id !== "") { + writer.uint32(18).string(message.id); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryNFTRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNFTRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.classId = reader.string(); + break; + case 2: + message.id = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryNFTRequest { + const message = createBaseQueryNFTRequest(); + message.classId = object.classId ?? ""; + message.id = object.id ?? ""; + return message; + }, + fromAmino(object: QueryNFTRequestAmino): QueryNFTRequest { + const message = createBaseQueryNFTRequest(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + return message; + }, + toAmino(message: QueryNFTRequest): QueryNFTRequestAmino { + const obj: any = {}; + obj.class_id = message.classId === "" ? undefined : message.classId; + obj.id = message.id === "" ? undefined : message.id; + return obj; + }, + fromAminoMsg(object: QueryNFTRequestAminoMsg): QueryNFTRequest { + return QueryNFTRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryNFTRequest): QueryNFTRequestAminoMsg { + return { + type: "cosmos-sdk/QueryNFTRequest", + value: QueryNFTRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryNFTRequestProtoMsg): QueryNFTRequest { + return QueryNFTRequest.decode(message.value); + }, + toProto(message: QueryNFTRequest): Uint8Array { + return QueryNFTRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryNFTRequest): QueryNFTRequestProtoMsg { + return { + typeUrl: "/cosmos.nft.v1beta1.QueryNFTRequest", + value: QueryNFTRequest.encode(message).finish() + }; + } +}; +function createBaseQueryNFTResponse(): QueryNFTResponse { + return { + nft: undefined + }; +} +export const QueryNFTResponse = { + typeUrl: "/cosmos.nft.v1beta1.QueryNFTResponse", + encode(message: QueryNFTResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.nft !== undefined) { + NFT.encode(message.nft, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryNFTResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNFTResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nft = NFT.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryNFTResponse { + const message = createBaseQueryNFTResponse(); + message.nft = object.nft !== undefined && object.nft !== null ? NFT.fromPartial(object.nft) : undefined; + return message; + }, + fromAmino(object: QueryNFTResponseAmino): QueryNFTResponse { + const message = createBaseQueryNFTResponse(); + if (object.nft !== undefined && object.nft !== null) { + message.nft = NFT.fromAmino(object.nft); + } + return message; + }, + toAmino(message: QueryNFTResponse): QueryNFTResponseAmino { + const obj: any = {}; + obj.nft = message.nft ? NFT.toAmino(message.nft) : undefined; + return obj; + }, + fromAminoMsg(object: QueryNFTResponseAminoMsg): QueryNFTResponse { + return QueryNFTResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryNFTResponse): QueryNFTResponseAminoMsg { + return { + type: "cosmos-sdk/QueryNFTResponse", + value: QueryNFTResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryNFTResponseProtoMsg): QueryNFTResponse { + return QueryNFTResponse.decode(message.value); + }, + toProto(message: QueryNFTResponse): Uint8Array { + return QueryNFTResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryNFTResponse): QueryNFTResponseProtoMsg { + return { + typeUrl: "/cosmos.nft.v1beta1.QueryNFTResponse", + value: QueryNFTResponse.encode(message).finish() + }; + } +}; +function createBaseQueryClassRequest(): QueryClassRequest { + return { + classId: "" + }; +} +export const QueryClassRequest = { + typeUrl: "/cosmos.nft.v1beta1.QueryClassRequest", + encode(message: QueryClassRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.classId !== "") { + writer.uint32(10).string(message.classId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryClassRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClassRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.classId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryClassRequest { + const message = createBaseQueryClassRequest(); + message.classId = object.classId ?? ""; + return message; + }, + fromAmino(object: QueryClassRequestAmino): QueryClassRequest { + const message = createBaseQueryClassRequest(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + return message; + }, + toAmino(message: QueryClassRequest): QueryClassRequestAmino { + const obj: any = {}; + obj.class_id = message.classId === "" ? undefined : message.classId; + return obj; + }, + fromAminoMsg(object: QueryClassRequestAminoMsg): QueryClassRequest { + return QueryClassRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryClassRequest): QueryClassRequestAminoMsg { + return { + type: "cosmos-sdk/QueryClassRequest", + value: QueryClassRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryClassRequestProtoMsg): QueryClassRequest { + return QueryClassRequest.decode(message.value); + }, + toProto(message: QueryClassRequest): Uint8Array { + return QueryClassRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryClassRequest): QueryClassRequestProtoMsg { + return { + typeUrl: "/cosmos.nft.v1beta1.QueryClassRequest", + value: QueryClassRequest.encode(message).finish() + }; + } +}; +function createBaseQueryClassResponse(): QueryClassResponse { + return { + class: undefined + }; +} +export const QueryClassResponse = { + typeUrl: "/cosmos.nft.v1beta1.QueryClassResponse", + encode(message: QueryClassResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.class !== undefined) { + Class.encode(message.class, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryClassResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClassResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.class = Class.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryClassResponse { + const message = createBaseQueryClassResponse(); + message.class = object.class !== undefined && object.class !== null ? Class.fromPartial(object.class) : undefined; + return message; + }, + fromAmino(object: QueryClassResponseAmino): QueryClassResponse { + const message = createBaseQueryClassResponse(); + if (object.class !== undefined && object.class !== null) { + message.class = Class.fromAmino(object.class); + } + return message; + }, + toAmino(message: QueryClassResponse): QueryClassResponseAmino { + const obj: any = {}; + obj.class = message.class ? Class.toAmino(message.class) : undefined; + return obj; + }, + fromAminoMsg(object: QueryClassResponseAminoMsg): QueryClassResponse { + return QueryClassResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryClassResponse): QueryClassResponseAminoMsg { + return { + type: "cosmos-sdk/QueryClassResponse", + value: QueryClassResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryClassResponseProtoMsg): QueryClassResponse { + return QueryClassResponse.decode(message.value); + }, + toProto(message: QueryClassResponse): Uint8Array { + return QueryClassResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryClassResponse): QueryClassResponseProtoMsg { + return { + typeUrl: "/cosmos.nft.v1beta1.QueryClassResponse", + value: QueryClassResponse.encode(message).finish() + }; + } +}; +function createBaseQueryClassesRequest(): QueryClassesRequest { + return { + pagination: undefined + }; +} +export const QueryClassesRequest = { + typeUrl: "/cosmos.nft.v1beta1.QueryClassesRequest", + encode(message: QueryClassesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryClassesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClassesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryClassesRequest { + const message = createBaseQueryClassesRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryClassesRequestAmino): QueryClassesRequest { + const message = createBaseQueryClassesRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryClassesRequest): QueryClassesRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryClassesRequestAminoMsg): QueryClassesRequest { + return QueryClassesRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryClassesRequest): QueryClassesRequestAminoMsg { + return { + type: "cosmos-sdk/QueryClassesRequest", + value: QueryClassesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryClassesRequestProtoMsg): QueryClassesRequest { + return QueryClassesRequest.decode(message.value); + }, + toProto(message: QueryClassesRequest): Uint8Array { + return QueryClassesRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryClassesRequest): QueryClassesRequestProtoMsg { + return { + typeUrl: "/cosmos.nft.v1beta1.QueryClassesRequest", + value: QueryClassesRequest.encode(message).finish() + }; + } +}; +function createBaseQueryClassesResponse(): QueryClassesResponse { + return { + classes: [], + pagination: undefined + }; +} +export const QueryClassesResponse = { + typeUrl: "/cosmos.nft.v1beta1.QueryClassesResponse", + encode(message: QueryClassesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.classes) { + Class.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryClassesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryClassesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.classes.push(Class.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryClassesResponse { + const message = createBaseQueryClassesResponse(); + message.classes = object.classes?.map(e => Class.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryClassesResponseAmino): QueryClassesResponse { + const message = createBaseQueryClassesResponse(); + message.classes = object.classes?.map(e => Class.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryClassesResponse): QueryClassesResponseAmino { + const obj: any = {}; + if (message.classes) { + obj.classes = message.classes.map(e => e ? Class.toAmino(e) : undefined); + } else { + obj.classes = message.classes; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryClassesResponseAminoMsg): QueryClassesResponse { + return QueryClassesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryClassesResponse): QueryClassesResponseAminoMsg { + return { + type: "cosmos-sdk/QueryClassesResponse", + value: QueryClassesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryClassesResponseProtoMsg): QueryClassesResponse { + return QueryClassesResponse.decode(message.value); + }, + toProto(message: QueryClassesResponse): Uint8Array { + return QueryClassesResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryClassesResponse): QueryClassesResponseProtoMsg { + return { + typeUrl: "/cosmos.nft.v1beta1.QueryClassesResponse", + value: QueryClassesResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/nft/v1beta1/tx.amino.ts b/src/codegen/cosmos/nft/v1beta1/tx.amino.ts new file mode 100644 index 0000000..a10e415 --- /dev/null +++ b/src/codegen/cosmos/nft/v1beta1/tx.amino.ts @@ -0,0 +1,8 @@ +import { MsgSend } from "./tx"; +export const AminoConverter = { + "/cosmos.nft.v1beta1.MsgSend": { + aminoType: "cosmos-sdk/MsgNFTSend", + toAmino: MsgSend.toAmino, + fromAmino: MsgSend.fromAmino + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/nft/v1beta1/tx.registry.ts b/src/codegen/cosmos/nft/v1beta1/tx.registry.ts new file mode 100644 index 0000000..d8c4062 --- /dev/null +++ b/src/codegen/cosmos/nft/v1beta1/tx.registry.ts @@ -0,0 +1,34 @@ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgSend } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.nft.v1beta1.MsgSend", MsgSend]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + send(value: MsgSend) { + return { + typeUrl: "/cosmos.nft.v1beta1.MsgSend", + value: MsgSend.encode(value).finish() + }; + } + }, + withTypeUrl: { + send(value: MsgSend) { + return { + typeUrl: "/cosmos.nft.v1beta1.MsgSend", + value + }; + } + }, + fromPartial: { + send(value: MsgSend) { + return { + typeUrl: "/cosmos.nft.v1beta1.MsgSend", + value: MsgSend.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/nft/v1beta1/tx.rpc.msg.ts b/src/codegen/cosmos/nft/v1beta1/tx.rpc.msg.ts new file mode 100644 index 0000000..5461819 --- /dev/null +++ b/src/codegen/cosmos/nft/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,20 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgSend, MsgSendResponse } from "./tx"; +/** Msg defines the nft Msg service. */ +export interface Msg { + /** Send defines a method to send a nft from one account to another account. */ + send(request: MsgSend): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.send = this.send.bind(this); + } + send(request: MsgSend): Promise { + const data = MsgSend.encode(request).finish(); + const promise = this.rpc.request("cosmos.nft.v1beta1.Msg", "Send", data); + return promise.then(data => MsgSendResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/src/codegen/cosmos/nft/v1beta1/tx.ts b/src/codegen/cosmos/nft/v1beta1/tx.ts new file mode 100644 index 0000000..7c9750b --- /dev/null +++ b/src/codegen/cosmos/nft/v1beta1/tx.ts @@ -0,0 +1,213 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** MsgSend represents a message to send a nft from one account to another account. */ +export interface MsgSend { + /** class_id defines the unique identifier of the nft classification, similar to the contract address of ERC721 */ + classId: string; + /** id defines the unique identification of nft */ + id: string; + /** sender is the address of the owner of nft */ + sender: string; + /** receiver is the receiver address of nft */ + receiver: string; +} +export interface MsgSendProtoMsg { + typeUrl: "/cosmos.nft.v1beta1.MsgSend"; + value: Uint8Array; +} +/** MsgSend represents a message to send a nft from one account to another account. */ +export interface MsgSendAmino { + /** class_id defines the unique identifier of the nft classification, similar to the contract address of ERC721 */ + class_id?: string; + /** id defines the unique identification of nft */ + id?: string; + /** sender is the address of the owner of nft */ + sender?: string; + /** receiver is the receiver address of nft */ + receiver?: string; +} +export interface MsgSendAminoMsg { + type: "cosmos-sdk/MsgNFTSend"; + value: MsgSendAmino; +} +/** MsgSend represents a message to send a nft from one account to another account. */ +export interface MsgSendSDKType { + class_id: string; + id: string; + sender: string; + receiver: string; +} +/** MsgSendResponse defines the Msg/Send response type. */ +export interface MsgSendResponse {} +export interface MsgSendResponseProtoMsg { + typeUrl: "/cosmos.nft.v1beta1.MsgSendResponse"; + value: Uint8Array; +} +/** MsgSendResponse defines the Msg/Send response type. */ +export interface MsgSendResponseAmino {} +export interface MsgSendResponseAminoMsg { + type: "cosmos-sdk/MsgSendResponse"; + value: MsgSendResponseAmino; +} +/** MsgSendResponse defines the Msg/Send response type. */ +export interface MsgSendResponseSDKType {} +function createBaseMsgSend(): MsgSend { + return { + classId: "", + id: "", + sender: "", + receiver: "" + }; +} +export const MsgSend = { + typeUrl: "/cosmos.nft.v1beta1.MsgSend", + encode(message: MsgSend, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.classId !== "") { + writer.uint32(10).string(message.classId); + } + if (message.id !== "") { + writer.uint32(18).string(message.id); + } + if (message.sender !== "") { + writer.uint32(26).string(message.sender); + } + if (message.receiver !== "") { + writer.uint32(34).string(message.receiver); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSend { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSend(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.classId = reader.string(); + break; + case 2: + message.id = reader.string(); + break; + case 3: + message.sender = reader.string(); + break; + case 4: + message.receiver = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSend { + const message = createBaseMsgSend(); + message.classId = object.classId ?? ""; + message.id = object.id ?? ""; + message.sender = object.sender ?? ""; + message.receiver = object.receiver ?? ""; + return message; + }, + fromAmino(object: MsgSendAmino): MsgSend { + const message = createBaseMsgSend(); + if (object.class_id !== undefined && object.class_id !== null) { + message.classId = object.class_id; + } + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.receiver !== undefined && object.receiver !== null) { + message.receiver = object.receiver; + } + return message; + }, + toAmino(message: MsgSend): MsgSendAmino { + const obj: any = {}; + obj.class_id = message.classId === "" ? undefined : message.classId; + obj.id = message.id === "" ? undefined : message.id; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.receiver = message.receiver === "" ? undefined : message.receiver; + return obj; + }, + fromAminoMsg(object: MsgSendAminoMsg): MsgSend { + return MsgSend.fromAmino(object.value); + }, + toAminoMsg(message: MsgSend): MsgSendAminoMsg { + return { + type: "cosmos-sdk/MsgNFTSend", + value: MsgSend.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSendProtoMsg): MsgSend { + return MsgSend.decode(message.value); + }, + toProto(message: MsgSend): Uint8Array { + return MsgSend.encode(message).finish(); + }, + toProtoMsg(message: MsgSend): MsgSendProtoMsg { + return { + typeUrl: "/cosmos.nft.v1beta1.MsgSend", + value: MsgSend.encode(message).finish() + }; + } +}; +function createBaseMsgSendResponse(): MsgSendResponse { + return {}; +} +export const MsgSendResponse = { + typeUrl: "/cosmos.nft.v1beta1.MsgSendResponse", + encode(_: MsgSendResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSendResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSendResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSendResponse { + const message = createBaseMsgSendResponse(); + return message; + }, + fromAmino(_: MsgSendResponseAmino): MsgSendResponse { + const message = createBaseMsgSendResponse(); + return message; + }, + toAmino(_: MsgSendResponse): MsgSendResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSendResponseAminoMsg): MsgSendResponse { + return MsgSendResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSendResponse): MsgSendResponseAminoMsg { + return { + type: "cosmos-sdk/MsgSendResponse", + value: MsgSendResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSendResponseProtoMsg): MsgSendResponse { + return MsgSendResponse.decode(message.value); + }, + toProto(message: MsgSendResponse): Uint8Array { + return MsgSendResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSendResponse): MsgSendResponseProtoMsg { + return { + typeUrl: "/cosmos.nft.v1beta1.MsgSendResponse", + value: MsgSendResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/orm/query/v1alpha1/query.rpc.Query.ts b/src/codegen/cosmos/orm/query/v1alpha1/query.rpc.Query.ts new file mode 100644 index 0000000..e4eca2d --- /dev/null +++ b/src/codegen/cosmos/orm/query/v1alpha1/query.rpc.Query.ts @@ -0,0 +1,41 @@ +import { Rpc } from "../../../../helpers"; +import { BinaryReader } from "../../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { GetRequest, GetResponse, ListRequest, ListResponse } from "./query"; +/** Query is a generic gRPC service for querying ORM data. */ +export interface Query { + /** Get queries an ORM table against an unique index. */ + get(request: GetRequest): Promise; + /** List queries an ORM table against an index. */ + list(request: ListRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.get = this.get.bind(this); + this.list = this.list.bind(this); + } + get(request: GetRequest): Promise { + const data = GetRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.orm.query.v1alpha1.Query", "Get", data); + return promise.then(data => GetResponse.decode(new BinaryReader(data))); + } + list(request: ListRequest): Promise { + const data = ListRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.orm.query.v1alpha1.Query", "List", data); + return promise.then(data => ListResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + get(request: GetRequest): Promise { + return queryService.get(request); + }, + list(request: ListRequest): Promise { + return queryService.list(request); + } + }; +}; \ No newline at end of file diff --git a/src/codegen/cosmos/orm/query/v1alpha1/query.ts b/src/codegen/cosmos/orm/query/v1alpha1/query.ts new file mode 100644 index 0000000..ace798e --- /dev/null +++ b/src/codegen/cosmos/orm/query/v1alpha1/query.ts @@ -0,0 +1,972 @@ +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../base/query/v1beta1/pagination"; +import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; +import { Duration, DurationAmino, DurationSDKType } from "../../../../google/protobuf/duration"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { toTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** GetRequest is the Query/Get request type. */ +export interface GetRequest { + /** message_name is the fully-qualified message name of the ORM table being queried. */ + messageName: string; + /** + * index is the index fields expression used in orm definitions. If it + * is empty, the table's primary key is assumed. If it is non-empty, it must + * refer to an unique index. + */ + index: string; + /** + * values are the values of the fields corresponding to the requested index. + * There must be as many values provided as there are fields in the index and + * these values must correspond to the index field types. + */ + values: IndexValue[]; +} +export interface GetRequestProtoMsg { + typeUrl: "/cosmos.orm.query.v1alpha1.GetRequest"; + value: Uint8Array; +} +/** GetRequest is the Query/Get request type. */ +export interface GetRequestAmino { + /** message_name is the fully-qualified message name of the ORM table being queried. */ + message_name?: string; + /** + * index is the index fields expression used in orm definitions. If it + * is empty, the table's primary key is assumed. If it is non-empty, it must + * refer to an unique index. + */ + index?: string; + /** + * values are the values of the fields corresponding to the requested index. + * There must be as many values provided as there are fields in the index and + * these values must correspond to the index field types. + */ + values?: IndexValueAmino[]; +} +export interface GetRequestAminoMsg { + type: "cosmos-sdk/GetRequest"; + value: GetRequestAmino; +} +/** GetRequest is the Query/Get request type. */ +export interface GetRequestSDKType { + message_name: string; + index: string; + values: IndexValueSDKType[]; +} +/** GetResponse is the Query/Get response type. */ +export interface GetResponse { + /** + * result is the result of the get query. If no value is found, the gRPC + * status code NOT_FOUND will be returned. + */ + result?: Any; +} +export interface GetResponseProtoMsg { + typeUrl: "/cosmos.orm.query.v1alpha1.GetResponse"; + value: Uint8Array; +} +/** GetResponse is the Query/Get response type. */ +export interface GetResponseAmino { + /** + * result is the result of the get query. If no value is found, the gRPC + * status code NOT_FOUND will be returned. + */ + result?: AnyAmino; +} +export interface GetResponseAminoMsg { + type: "cosmos-sdk/GetResponse"; + value: GetResponseAmino; +} +/** GetResponse is the Query/Get response type. */ +export interface GetResponseSDKType { + result?: AnySDKType; +} +/** ListRequest is the Query/List request type. */ +export interface ListRequest { + /** message_name is the fully-qualified message name of the ORM table being queried. */ + messageName: string; + /** + * index is the index fields expression used in orm definitions. If it + * is empty, the table's primary key is assumed. + */ + index: string; + /** prefix defines a prefix query. */ + prefix?: ListRequest_Prefix; + /** range defines a range query. */ + range?: ListRequest_Range; + /** pagination is the pagination request. */ + pagination?: PageRequest; +} +export interface ListRequestProtoMsg { + typeUrl: "/cosmos.orm.query.v1alpha1.ListRequest"; + value: Uint8Array; +} +/** ListRequest is the Query/List request type. */ +export interface ListRequestAmino { + /** message_name is the fully-qualified message name of the ORM table being queried. */ + message_name?: string; + /** + * index is the index fields expression used in orm definitions. If it + * is empty, the table's primary key is assumed. + */ + index?: string; + /** prefix defines a prefix query. */ + prefix?: ListRequest_PrefixAmino; + /** range defines a range query. */ + range?: ListRequest_RangeAmino; + /** pagination is the pagination request. */ + pagination?: PageRequestAmino; +} +export interface ListRequestAminoMsg { + type: "cosmos-sdk/ListRequest"; + value: ListRequestAmino; +} +/** ListRequest is the Query/List request type. */ +export interface ListRequestSDKType { + message_name: string; + index: string; + prefix?: ListRequest_PrefixSDKType; + range?: ListRequest_RangeSDKType; + pagination?: PageRequestSDKType; +} +/** Prefix specifies the arguments to a prefix query. */ +export interface ListRequest_Prefix { + /** + * values specifies the index values for the prefix query. + * It is valid to special a partial prefix with fewer values than + * the number of fields in the index. + */ + values: IndexValue[]; +} +export interface ListRequest_PrefixProtoMsg { + typeUrl: "/cosmos.orm.query.v1alpha1.Prefix"; + value: Uint8Array; +} +/** Prefix specifies the arguments to a prefix query. */ +export interface ListRequest_PrefixAmino { + /** + * values specifies the index values for the prefix query. + * It is valid to special a partial prefix with fewer values than + * the number of fields in the index. + */ + values?: IndexValueAmino[]; +} +export interface ListRequest_PrefixAminoMsg { + type: "cosmos-sdk/Prefix"; + value: ListRequest_PrefixAmino; +} +/** Prefix specifies the arguments to a prefix query. */ +export interface ListRequest_PrefixSDKType { + values: IndexValueSDKType[]; +} +/** Range specifies the arguments to a range query. */ +export interface ListRequest_Range { + /** + * start specifies the starting index values for the range query. + * It is valid to provide fewer values than the number of fields in the + * index. + */ + start: IndexValue[]; + /** + * end specifies the inclusive ending index values for the range query. + * It is valid to provide fewer values than the number of fields in the + * index. + */ + end: IndexValue[]; +} +export interface ListRequest_RangeProtoMsg { + typeUrl: "/cosmos.orm.query.v1alpha1.Range"; + value: Uint8Array; +} +/** Range specifies the arguments to a range query. */ +export interface ListRequest_RangeAmino { + /** + * start specifies the starting index values for the range query. + * It is valid to provide fewer values than the number of fields in the + * index. + */ + start?: IndexValueAmino[]; + /** + * end specifies the inclusive ending index values for the range query. + * It is valid to provide fewer values than the number of fields in the + * index. + */ + end?: IndexValueAmino[]; +} +export interface ListRequest_RangeAminoMsg { + type: "cosmos-sdk/Range"; + value: ListRequest_RangeAmino; +} +/** Range specifies the arguments to a range query. */ +export interface ListRequest_RangeSDKType { + start: IndexValueSDKType[]; + end: IndexValueSDKType[]; +} +/** ListResponse is the Query/List response type. */ +export interface ListResponse { + /** results are the results of the query. */ + results: Any[]; + /** pagination is the pagination response. */ + pagination?: PageResponse; +} +export interface ListResponseProtoMsg { + typeUrl: "/cosmos.orm.query.v1alpha1.ListResponse"; + value: Uint8Array; +} +/** ListResponse is the Query/List response type. */ +export interface ListResponseAmino { + /** results are the results of the query. */ + results?: AnyAmino[]; + /** pagination is the pagination response. */ + pagination?: PageResponseAmino; +} +export interface ListResponseAminoMsg { + type: "cosmos-sdk/ListResponse"; + value: ListResponseAmino; +} +/** ListResponse is the Query/List response type. */ +export interface ListResponseSDKType { + results: AnySDKType[]; + pagination?: PageResponseSDKType; +} +/** IndexValue represents the value of a field in an ORM index expression. */ +export interface IndexValue { + /** + * uint specifies a value for an uint32, fixed32, uint64, or fixed64 + * index field. + */ + uint?: bigint; + /** + * int64 specifies a value for an int32, sfixed32, int64, or sfixed64 + * index field. + */ + int?: bigint; + /** str specifies a value for a string index field. */ + str?: string; + /** bytes specifies a value for a bytes index field. */ + bytes?: Uint8Array; + /** enum specifies a value for an enum index field. */ + enum?: string; + /** bool specifies a value for a bool index field. */ + bool?: boolean; + /** timestamp specifies a value for a timestamp index field. */ + timestamp?: Date; + /** duration specifies a value for a duration index field. */ + duration?: Duration; +} +export interface IndexValueProtoMsg { + typeUrl: "/cosmos.orm.query.v1alpha1.IndexValue"; + value: Uint8Array; +} +/** IndexValue represents the value of a field in an ORM index expression. */ +export interface IndexValueAmino { + /** + * uint specifies a value for an uint32, fixed32, uint64, or fixed64 + * index field. + */ + uint?: string; + /** + * int64 specifies a value for an int32, sfixed32, int64, or sfixed64 + * index field. + */ + int?: string; + /** str specifies a value for a string index field. */ + str?: string; + /** bytes specifies a value for a bytes index field. */ + bytes?: string; + /** enum specifies a value for an enum index field. */ + enum?: string; + /** bool specifies a value for a bool index field. */ + bool?: boolean; + /** timestamp specifies a value for a timestamp index field. */ + timestamp?: string; + /** duration specifies a value for a duration index field. */ + duration?: DurationAmino; +} +export interface IndexValueAminoMsg { + type: "cosmos-sdk/IndexValue"; + value: IndexValueAmino; +} +/** IndexValue represents the value of a field in an ORM index expression. */ +export interface IndexValueSDKType { + uint?: bigint; + int?: bigint; + str?: string; + bytes?: Uint8Array; + enum?: string; + bool?: boolean; + timestamp?: Date; + duration?: DurationSDKType; +} +function createBaseGetRequest(): GetRequest { + return { + messageName: "", + index: "", + values: [] + }; +} +export const GetRequest = { + typeUrl: "/cosmos.orm.query.v1alpha1.GetRequest", + encode(message: GetRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.messageName !== "") { + writer.uint32(10).string(message.messageName); + } + if (message.index !== "") { + writer.uint32(18).string(message.index); + } + for (const v of message.values) { + IndexValue.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messageName = reader.string(); + break; + case 2: + message.index = reader.string(); + break; + case 3: + message.values.push(IndexValue.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetRequest { + const message = createBaseGetRequest(); + message.messageName = object.messageName ?? ""; + message.index = object.index ?? ""; + message.values = object.values?.map(e => IndexValue.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GetRequestAmino): GetRequest { + const message = createBaseGetRequest(); + if (object.message_name !== undefined && object.message_name !== null) { + message.messageName = object.message_name; + } + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } + message.values = object.values?.map(e => IndexValue.fromAmino(e)) || []; + return message; + }, + toAmino(message: GetRequest): GetRequestAmino { + const obj: any = {}; + obj.message_name = message.messageName === "" ? undefined : message.messageName; + obj.index = message.index === "" ? undefined : message.index; + if (message.values) { + obj.values = message.values.map(e => e ? IndexValue.toAmino(e) : undefined); + } else { + obj.values = message.values; + } + return obj; + }, + fromAminoMsg(object: GetRequestAminoMsg): GetRequest { + return GetRequest.fromAmino(object.value); + }, + toAminoMsg(message: GetRequest): GetRequestAminoMsg { + return { + type: "cosmos-sdk/GetRequest", + value: GetRequest.toAmino(message) + }; + }, + fromProtoMsg(message: GetRequestProtoMsg): GetRequest { + return GetRequest.decode(message.value); + }, + toProto(message: GetRequest): Uint8Array { + return GetRequest.encode(message).finish(); + }, + toProtoMsg(message: GetRequest): GetRequestProtoMsg { + return { + typeUrl: "/cosmos.orm.query.v1alpha1.GetRequest", + value: GetRequest.encode(message).finish() + }; + } +}; +function createBaseGetResponse(): GetResponse { + return { + result: undefined + }; +} +export const GetResponse = { + typeUrl: "/cosmos.orm.query.v1alpha1.GetResponse", + encode(message: GetResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.result !== undefined) { + Any.encode(message.result, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GetResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.result = Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GetResponse { + const message = createBaseGetResponse(); + message.result = object.result !== undefined && object.result !== null ? Any.fromPartial(object.result) : undefined; + return message; + }, + fromAmino(object: GetResponseAmino): GetResponse { + const message = createBaseGetResponse(); + if (object.result !== undefined && object.result !== null) { + message.result = Any.fromAmino(object.result); + } + return message; + }, + toAmino(message: GetResponse): GetResponseAmino { + const obj: any = {}; + obj.result = message.result ? Any.toAmino(message.result) : undefined; + return obj; + }, + fromAminoMsg(object: GetResponseAminoMsg): GetResponse { + return GetResponse.fromAmino(object.value); + }, + toAminoMsg(message: GetResponse): GetResponseAminoMsg { + return { + type: "cosmos-sdk/GetResponse", + value: GetResponse.toAmino(message) + }; + }, + fromProtoMsg(message: GetResponseProtoMsg): GetResponse { + return GetResponse.decode(message.value); + }, + toProto(message: GetResponse): Uint8Array { + return GetResponse.encode(message).finish(); + }, + toProtoMsg(message: GetResponse): GetResponseProtoMsg { + return { + typeUrl: "/cosmos.orm.query.v1alpha1.GetResponse", + value: GetResponse.encode(message).finish() + }; + } +}; +function createBaseListRequest(): ListRequest { + return { + messageName: "", + index: "", + prefix: undefined, + range: undefined, + pagination: undefined + }; +} +export const ListRequest = { + typeUrl: "/cosmos.orm.query.v1alpha1.ListRequest", + encode(message: ListRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.messageName !== "") { + writer.uint32(10).string(message.messageName); + } + if (message.index !== "") { + writer.uint32(18).string(message.index); + } + if (message.prefix !== undefined) { + ListRequest_Prefix.encode(message.prefix, writer.uint32(26).fork()).ldelim(); + } + if (message.range !== undefined) { + ListRequest_Range.encode(message.range, writer.uint32(34).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ListRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messageName = reader.string(); + break; + case 2: + message.index = reader.string(); + break; + case 3: + message.prefix = ListRequest_Prefix.decode(reader, reader.uint32()); + break; + case 4: + message.range = ListRequest_Range.decode(reader, reader.uint32()); + break; + case 5: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ListRequest { + const message = createBaseListRequest(); + message.messageName = object.messageName ?? ""; + message.index = object.index ?? ""; + message.prefix = object.prefix !== undefined && object.prefix !== null ? ListRequest_Prefix.fromPartial(object.prefix) : undefined; + message.range = object.range !== undefined && object.range !== null ? ListRequest_Range.fromPartial(object.range) : undefined; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: ListRequestAmino): ListRequest { + const message = createBaseListRequest(); + if (object.message_name !== undefined && object.message_name !== null) { + message.messageName = object.message_name; + } + if (object.index !== undefined && object.index !== null) { + message.index = object.index; + } + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = ListRequest_Prefix.fromAmino(object.prefix); + } + if (object.range !== undefined && object.range !== null) { + message.range = ListRequest_Range.fromAmino(object.range); + } + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: ListRequest): ListRequestAmino { + const obj: any = {}; + obj.message_name = message.messageName === "" ? undefined : message.messageName; + obj.index = message.index === "" ? undefined : message.index; + obj.prefix = message.prefix ? ListRequest_Prefix.toAmino(message.prefix) : undefined; + obj.range = message.range ? ListRequest_Range.toAmino(message.range) : undefined; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: ListRequestAminoMsg): ListRequest { + return ListRequest.fromAmino(object.value); + }, + toAminoMsg(message: ListRequest): ListRequestAminoMsg { + return { + type: "cosmos-sdk/ListRequest", + value: ListRequest.toAmino(message) + }; + }, + fromProtoMsg(message: ListRequestProtoMsg): ListRequest { + return ListRequest.decode(message.value); + }, + toProto(message: ListRequest): Uint8Array { + return ListRequest.encode(message).finish(); + }, + toProtoMsg(message: ListRequest): ListRequestProtoMsg { + return { + typeUrl: "/cosmos.orm.query.v1alpha1.ListRequest", + value: ListRequest.encode(message).finish() + }; + } +}; +function createBaseListRequest_Prefix(): ListRequest_Prefix { + return { + values: [] + }; +} +export const ListRequest_Prefix = { + typeUrl: "/cosmos.orm.query.v1alpha1.Prefix", + encode(message: ListRequest_Prefix, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.values) { + IndexValue.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ListRequest_Prefix { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListRequest_Prefix(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.values.push(IndexValue.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ListRequest_Prefix { + const message = createBaseListRequest_Prefix(); + message.values = object.values?.map(e => IndexValue.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ListRequest_PrefixAmino): ListRequest_Prefix { + const message = createBaseListRequest_Prefix(); + message.values = object.values?.map(e => IndexValue.fromAmino(e)) || []; + return message; + }, + toAmino(message: ListRequest_Prefix): ListRequest_PrefixAmino { + const obj: any = {}; + if (message.values) { + obj.values = message.values.map(e => e ? IndexValue.toAmino(e) : undefined); + } else { + obj.values = message.values; + } + return obj; + }, + fromAminoMsg(object: ListRequest_PrefixAminoMsg): ListRequest_Prefix { + return ListRequest_Prefix.fromAmino(object.value); + }, + toAminoMsg(message: ListRequest_Prefix): ListRequest_PrefixAminoMsg { + return { + type: "cosmos-sdk/Prefix", + value: ListRequest_Prefix.toAmino(message) + }; + }, + fromProtoMsg(message: ListRequest_PrefixProtoMsg): ListRequest_Prefix { + return ListRequest_Prefix.decode(message.value); + }, + toProto(message: ListRequest_Prefix): Uint8Array { + return ListRequest_Prefix.encode(message).finish(); + }, + toProtoMsg(message: ListRequest_Prefix): ListRequest_PrefixProtoMsg { + return { + typeUrl: "/cosmos.orm.query.v1alpha1.Prefix", + value: ListRequest_Prefix.encode(message).finish() + }; + } +}; +function createBaseListRequest_Range(): ListRequest_Range { + return { + start: [], + end: [] + }; +} +export const ListRequest_Range = { + typeUrl: "/cosmos.orm.query.v1alpha1.Range", + encode(message: ListRequest_Range, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.start) { + IndexValue.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.end) { + IndexValue.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ListRequest_Range { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListRequest_Range(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start.push(IndexValue.decode(reader, reader.uint32())); + break; + case 2: + message.end.push(IndexValue.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ListRequest_Range { + const message = createBaseListRequest_Range(); + message.start = object.start?.map(e => IndexValue.fromPartial(e)) || []; + message.end = object.end?.map(e => IndexValue.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ListRequest_RangeAmino): ListRequest_Range { + const message = createBaseListRequest_Range(); + message.start = object.start?.map(e => IndexValue.fromAmino(e)) || []; + message.end = object.end?.map(e => IndexValue.fromAmino(e)) || []; + return message; + }, + toAmino(message: ListRequest_Range): ListRequest_RangeAmino { + const obj: any = {}; + if (message.start) { + obj.start = message.start.map(e => e ? IndexValue.toAmino(e) : undefined); + } else { + obj.start = message.start; + } + if (message.end) { + obj.end = message.end.map(e => e ? IndexValue.toAmino(e) : undefined); + } else { + obj.end = message.end; + } + return obj; + }, + fromAminoMsg(object: ListRequest_RangeAminoMsg): ListRequest_Range { + return ListRequest_Range.fromAmino(object.value); + }, + toAminoMsg(message: ListRequest_Range): ListRequest_RangeAminoMsg { + return { + type: "cosmos-sdk/Range", + value: ListRequest_Range.toAmino(message) + }; + }, + fromProtoMsg(message: ListRequest_RangeProtoMsg): ListRequest_Range { + return ListRequest_Range.decode(message.value); + }, + toProto(message: ListRequest_Range): Uint8Array { + return ListRequest_Range.encode(message).finish(); + }, + toProtoMsg(message: ListRequest_Range): ListRequest_RangeProtoMsg { + return { + typeUrl: "/cosmos.orm.query.v1alpha1.Range", + value: ListRequest_Range.encode(message).finish() + }; + } +}; +function createBaseListResponse(): ListResponse { + return { + results: [], + pagination: undefined + }; +} +export const ListResponse = { + typeUrl: "/cosmos.orm.query.v1alpha1.ListResponse", + encode(message: ListResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.results) { + Any.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ListResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.results.push(Any.decode(reader, reader.uint32())); + break; + case 5: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ListResponse { + const message = createBaseListResponse(); + message.results = object.results?.map(e => Any.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: ListResponseAmino): ListResponse { + const message = createBaseListResponse(); + message.results = object.results?.map(e => Any.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: ListResponse): ListResponseAmino { + const obj: any = {}; + if (message.results) { + obj.results = message.results.map(e => e ? Any.toAmino(e) : undefined); + } else { + obj.results = message.results; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: ListResponseAminoMsg): ListResponse { + return ListResponse.fromAmino(object.value); + }, + toAminoMsg(message: ListResponse): ListResponseAminoMsg { + return { + type: "cosmos-sdk/ListResponse", + value: ListResponse.toAmino(message) + }; + }, + fromProtoMsg(message: ListResponseProtoMsg): ListResponse { + return ListResponse.decode(message.value); + }, + toProto(message: ListResponse): Uint8Array { + return ListResponse.encode(message).finish(); + }, + toProtoMsg(message: ListResponse): ListResponseProtoMsg { + return { + typeUrl: "/cosmos.orm.query.v1alpha1.ListResponse", + value: ListResponse.encode(message).finish() + }; + } +}; +function createBaseIndexValue(): IndexValue { + return { + uint: undefined, + int: undefined, + str: undefined, + bytes: undefined, + enum: undefined, + bool: undefined, + timestamp: undefined, + duration: undefined + }; +} +export const IndexValue = { + typeUrl: "/cosmos.orm.query.v1alpha1.IndexValue", + encode(message: IndexValue, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.uint !== undefined) { + writer.uint32(8).uint64(message.uint); + } + if (message.int !== undefined) { + writer.uint32(16).int64(message.int); + } + if (message.str !== undefined) { + writer.uint32(26).string(message.str); + } + if (message.bytes !== undefined) { + writer.uint32(34).bytes(message.bytes); + } + if (message.enum !== undefined) { + writer.uint32(42).string(message.enum); + } + if (message.bool !== undefined) { + writer.uint32(48).bool(message.bool); + } + if (message.timestamp !== undefined) { + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(58).fork()).ldelim(); + } + if (message.duration !== undefined) { + Duration.encode(message.duration, writer.uint32(66).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): IndexValue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIndexValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uint = reader.uint64(); + break; + case 2: + message.int = reader.int64(); + break; + case 3: + message.str = reader.string(); + break; + case 4: + message.bytes = reader.bytes(); + break; + case 5: + message.enum = reader.string(); + break; + case 6: + message.bool = reader.bool(); + break; + case 7: + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 8: + message.duration = Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): IndexValue { + const message = createBaseIndexValue(); + message.uint = object.uint !== undefined && object.uint !== null ? BigInt(object.uint.toString()) : undefined; + message.int = object.int !== undefined && object.int !== null ? BigInt(object.int.toString()) : undefined; + message.str = object.str ?? undefined; + message.bytes = object.bytes ?? undefined; + message.enum = object.enum ?? undefined; + message.bool = object.bool ?? undefined; + message.timestamp = object.timestamp ?? undefined; + message.duration = object.duration !== undefined && object.duration !== null ? Duration.fromPartial(object.duration) : undefined; + return message; + }, + fromAmino(object: IndexValueAmino): IndexValue { + const message = createBaseIndexValue(); + if (object.uint !== undefined && object.uint !== null) { + message.uint = BigInt(object.uint); + } + if (object.int !== undefined && object.int !== null) { + message.int = BigInt(object.int); + } + if (object.str !== undefined && object.str !== null) { + message.str = object.str; + } + if (object.bytes !== undefined && object.bytes !== null) { + message.bytes = bytesFromBase64(object.bytes); + } + if (object.enum !== undefined && object.enum !== null) { + message.enum = object.enum; + } + if (object.bool !== undefined && object.bool !== null) { + message.bool = object.bool; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + if (object.duration !== undefined && object.duration !== null) { + message.duration = Duration.fromAmino(object.duration); + } + return message; + }, + toAmino(message: IndexValue): IndexValueAmino { + const obj: any = {}; + obj.uint = message.uint !== BigInt(0) ? message.uint.toString() : undefined; + obj.int = message.int !== BigInt(0) ? message.int.toString() : undefined; + obj.str = message.str === null ? undefined : message.str; + obj.bytes = message.bytes ? base64FromBytes(message.bytes) : undefined; + obj.enum = message.enum === null ? undefined : message.enum; + obj.bool = message.bool === null ? undefined : message.bool; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; + obj.duration = message.duration ? Duration.toAmino(message.duration) : undefined; + return obj; + }, + fromAminoMsg(object: IndexValueAminoMsg): IndexValue { + return IndexValue.fromAmino(object.value); + }, + toAminoMsg(message: IndexValue): IndexValueAminoMsg { + return { + type: "cosmos-sdk/IndexValue", + value: IndexValue.toAmino(message) + }; + }, + fromProtoMsg(message: IndexValueProtoMsg): IndexValue { + return IndexValue.decode(message.value); + }, + toProto(message: IndexValue): Uint8Array { + return IndexValue.encode(message).finish(); + }, + toProtoMsg(message: IndexValue): IndexValueProtoMsg { + return { + typeUrl: "/cosmos.orm.query.v1alpha1.IndexValue", + value: IndexValue.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/orm/v1/orm.ts b/src/codegen/cosmos/orm/v1/orm.ts new file mode 100644 index 0000000..9ea2a64 --- /dev/null +++ b/src/codegen/cosmos/orm/v1/orm.ts @@ -0,0 +1,572 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** TableDescriptor describes an ORM table. */ +export interface TableDescriptor { + /** primary_key defines the primary key for the table. */ + primaryKey?: PrimaryKeyDescriptor; + /** index defines one or more secondary indexes. */ + index: SecondaryIndexDescriptor[]; + /** + * id is a non-zero integer ID that must be unique within the + * tables and singletons in this file. It may be deprecated in the future when this + * can be auto-generated. + */ + id: number; +} +export interface TableDescriptorProtoMsg { + typeUrl: "/cosmos.orm.v1.TableDescriptor"; + value: Uint8Array; +} +/** TableDescriptor describes an ORM table. */ +export interface TableDescriptorAmino { + /** primary_key defines the primary key for the table. */ + primary_key?: PrimaryKeyDescriptorAmino; + /** index defines one or more secondary indexes. */ + index?: SecondaryIndexDescriptorAmino[]; + /** + * id is a non-zero integer ID that must be unique within the + * tables and singletons in this file. It may be deprecated in the future when this + * can be auto-generated. + */ + id?: number; +} +export interface TableDescriptorAminoMsg { + type: "cosmos-sdk/TableDescriptor"; + value: TableDescriptorAmino; +} +/** TableDescriptor describes an ORM table. */ +export interface TableDescriptorSDKType { + primary_key?: PrimaryKeyDescriptorSDKType; + index: SecondaryIndexDescriptorSDKType[]; + id: number; +} +/** PrimaryKeyDescriptor describes a table primary key. */ +export interface PrimaryKeyDescriptor { + /** + * fields is a comma-separated list of fields in the primary key. Spaces are + * not allowed. Supported field types, their encodings, and any applicable constraints + * are described below. + * - uint32 are encoded as 2,3,4 or 5 bytes using a compact encoding that + * is suitable for sorted iteration (not varint encoding). This type is + * well-suited for small integers. + * - uint64 are encoded as 2,4,6 or 9 bytes using a compact encoding that + * is suitable for sorted iteration (not varint encoding). This type is + * well-suited for small integers such as auto-incrementing sequences. + * - fixed32, fixed64 are encoded as big-endian fixed width bytes and support + * sorted iteration. These types are well-suited for encoding fixed with + * decimals as integers. + * - string's are encoded as raw bytes in terminal key segments and null-terminated + * in non-terminal segments. Null characters are thus forbidden in strings. + * string fields support sorted iteration. + * - bytes are encoded as raw bytes in terminal segments and length-prefixed + * with a 32-bit unsigned varint in non-terminal segments. + * - int32, sint32, int64, sint64, sfixed32, sfixed64 are encoded as fixed width bytes with + * an encoding that enables sorted iteration. + * - google.protobuf.Timestamp is encoded such that values with only seconds occupy 6 bytes, + * values including nanos occupy 9 bytes, and nil values occupy 1 byte. When iterating, nil + * values will always be ordered last. Seconds and nanos values must conform to the officially + * specified ranges of 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z and 0 to 999,999,999 respectively. + * - google.protobuf.Duration is encoded as 12 bytes using an encoding that enables sorted iteration. + * - enum fields are encoded using varint encoding and do not support sorted + * iteration. + * - bool fields are encoded as a single byte 0 or 1. + * + * All other fields types are unsupported in keys including repeated and + * oneof fields. + * + * Primary keys are prefixed by the varint encoded table id and the byte 0x0 + * plus any additional prefix specified by the schema. + */ + fields: string; + /** + * auto_increment specifies that the primary key is generated by an + * auto-incrementing integer. If this is set to true fields must only + * contain one field of that is of type uint64. + */ + autoIncrement: boolean; +} +export interface PrimaryKeyDescriptorProtoMsg { + typeUrl: "/cosmos.orm.v1.PrimaryKeyDescriptor"; + value: Uint8Array; +} +/** PrimaryKeyDescriptor describes a table primary key. */ +export interface PrimaryKeyDescriptorAmino { + /** + * fields is a comma-separated list of fields in the primary key. Spaces are + * not allowed. Supported field types, their encodings, and any applicable constraints + * are described below. + * - uint32 are encoded as 2,3,4 or 5 bytes using a compact encoding that + * is suitable for sorted iteration (not varint encoding). This type is + * well-suited for small integers. + * - uint64 are encoded as 2,4,6 or 9 bytes using a compact encoding that + * is suitable for sorted iteration (not varint encoding). This type is + * well-suited for small integers such as auto-incrementing sequences. + * - fixed32, fixed64 are encoded as big-endian fixed width bytes and support + * sorted iteration. These types are well-suited for encoding fixed with + * decimals as integers. + * - string's are encoded as raw bytes in terminal key segments and null-terminated + * in non-terminal segments. Null characters are thus forbidden in strings. + * string fields support sorted iteration. + * - bytes are encoded as raw bytes in terminal segments and length-prefixed + * with a 32-bit unsigned varint in non-terminal segments. + * - int32, sint32, int64, sint64, sfixed32, sfixed64 are encoded as fixed width bytes with + * an encoding that enables sorted iteration. + * - google.protobuf.Timestamp is encoded such that values with only seconds occupy 6 bytes, + * values including nanos occupy 9 bytes, and nil values occupy 1 byte. When iterating, nil + * values will always be ordered last. Seconds and nanos values must conform to the officially + * specified ranges of 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z and 0 to 999,999,999 respectively. + * - google.protobuf.Duration is encoded as 12 bytes using an encoding that enables sorted iteration. + * - enum fields are encoded using varint encoding and do not support sorted + * iteration. + * - bool fields are encoded as a single byte 0 or 1. + * + * All other fields types are unsupported in keys including repeated and + * oneof fields. + * + * Primary keys are prefixed by the varint encoded table id and the byte 0x0 + * plus any additional prefix specified by the schema. + */ + fields?: string; + /** + * auto_increment specifies that the primary key is generated by an + * auto-incrementing integer. If this is set to true fields must only + * contain one field of that is of type uint64. + */ + auto_increment?: boolean; +} +export interface PrimaryKeyDescriptorAminoMsg { + type: "cosmos-sdk/PrimaryKeyDescriptor"; + value: PrimaryKeyDescriptorAmino; +} +/** PrimaryKeyDescriptor describes a table primary key. */ +export interface PrimaryKeyDescriptorSDKType { + fields: string; + auto_increment: boolean; +} +/** PrimaryKeyDescriptor describes a table secondary index. */ +export interface SecondaryIndexDescriptor { + /** + * fields is a comma-separated list of fields in the index. The supported + * field types are the same as those for PrimaryKeyDescriptor.fields. + * Index keys are prefixed by the varint encoded table id and the varint + * encoded index id plus any additional prefix specified by the schema. + * + * In addition the field segments, non-unique index keys are suffixed with + * any additional primary key fields not present in the index fields so that the + * primary key can be reconstructed. Unique indexes instead of being suffixed + * store the remaining primary key fields in the value.. + */ + fields: string; + /** + * id is a non-zero integer ID that must be unique within the indexes for this + * table and less than 32768. It may be deprecated in the future when this can + * be auto-generated. + */ + id: number; + /** unique specifies that this an unique index. */ + unique: boolean; +} +export interface SecondaryIndexDescriptorProtoMsg { + typeUrl: "/cosmos.orm.v1.SecondaryIndexDescriptor"; + value: Uint8Array; +} +/** PrimaryKeyDescriptor describes a table secondary index. */ +export interface SecondaryIndexDescriptorAmino { + /** + * fields is a comma-separated list of fields in the index. The supported + * field types are the same as those for PrimaryKeyDescriptor.fields. + * Index keys are prefixed by the varint encoded table id and the varint + * encoded index id plus any additional prefix specified by the schema. + * + * In addition the field segments, non-unique index keys are suffixed with + * any additional primary key fields not present in the index fields so that the + * primary key can be reconstructed. Unique indexes instead of being suffixed + * store the remaining primary key fields in the value.. + */ + fields?: string; + /** + * id is a non-zero integer ID that must be unique within the indexes for this + * table and less than 32768. It may be deprecated in the future when this can + * be auto-generated. + */ + id?: number; + /** unique specifies that this an unique index. */ + unique?: boolean; +} +export interface SecondaryIndexDescriptorAminoMsg { + type: "cosmos-sdk/SecondaryIndexDescriptor"; + value: SecondaryIndexDescriptorAmino; +} +/** PrimaryKeyDescriptor describes a table secondary index. */ +export interface SecondaryIndexDescriptorSDKType { + fields: string; + id: number; + unique: boolean; +} +/** TableDescriptor describes an ORM singleton table which has at most one instance. */ +export interface SingletonDescriptor { + /** + * id is a non-zero integer ID that must be unique within the + * tables and singletons in this file. It may be deprecated in the future when this + * can be auto-generated. + */ + id: number; +} +export interface SingletonDescriptorProtoMsg { + typeUrl: "/cosmos.orm.v1.SingletonDescriptor"; + value: Uint8Array; +} +/** TableDescriptor describes an ORM singleton table which has at most one instance. */ +export interface SingletonDescriptorAmino { + /** + * id is a non-zero integer ID that must be unique within the + * tables and singletons in this file. It may be deprecated in the future when this + * can be auto-generated. + */ + id?: number; +} +export interface SingletonDescriptorAminoMsg { + type: "cosmos-sdk/SingletonDescriptor"; + value: SingletonDescriptorAmino; +} +/** TableDescriptor describes an ORM singleton table which has at most one instance. */ +export interface SingletonDescriptorSDKType { + id: number; +} +function createBaseTableDescriptor(): TableDescriptor { + return { + primaryKey: undefined, + index: [], + id: 0 + }; +} +export const TableDescriptor = { + typeUrl: "/cosmos.orm.v1.TableDescriptor", + encode(message: TableDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.primaryKey !== undefined) { + PrimaryKeyDescriptor.encode(message.primaryKey, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.index) { + SecondaryIndexDescriptor.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.id !== 0) { + writer.uint32(24).uint32(message.id); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TableDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTableDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.primaryKey = PrimaryKeyDescriptor.decode(reader, reader.uint32()); + break; + case 2: + message.index.push(SecondaryIndexDescriptor.decode(reader, reader.uint32())); + break; + case 3: + message.id = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TableDescriptor { + const message = createBaseTableDescriptor(); + message.primaryKey = object.primaryKey !== undefined && object.primaryKey !== null ? PrimaryKeyDescriptor.fromPartial(object.primaryKey) : undefined; + message.index = object.index?.map(e => SecondaryIndexDescriptor.fromPartial(e)) || []; + message.id = object.id ?? 0; + return message; + }, + fromAmino(object: TableDescriptorAmino): TableDescriptor { + const message = createBaseTableDescriptor(); + if (object.primary_key !== undefined && object.primary_key !== null) { + message.primaryKey = PrimaryKeyDescriptor.fromAmino(object.primary_key); + } + message.index = object.index?.map(e => SecondaryIndexDescriptor.fromAmino(e)) || []; + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + return message; + }, + toAmino(message: TableDescriptor): TableDescriptorAmino { + const obj: any = {}; + obj.primary_key = message.primaryKey ? PrimaryKeyDescriptor.toAmino(message.primaryKey) : undefined; + if (message.index) { + obj.index = message.index.map(e => e ? SecondaryIndexDescriptor.toAmino(e) : undefined); + } else { + obj.index = message.index; + } + obj.id = message.id === 0 ? undefined : message.id; + return obj; + }, + fromAminoMsg(object: TableDescriptorAminoMsg): TableDescriptor { + return TableDescriptor.fromAmino(object.value); + }, + toAminoMsg(message: TableDescriptor): TableDescriptorAminoMsg { + return { + type: "cosmos-sdk/TableDescriptor", + value: TableDescriptor.toAmino(message) + }; + }, + fromProtoMsg(message: TableDescriptorProtoMsg): TableDescriptor { + return TableDescriptor.decode(message.value); + }, + toProto(message: TableDescriptor): Uint8Array { + return TableDescriptor.encode(message).finish(); + }, + toProtoMsg(message: TableDescriptor): TableDescriptorProtoMsg { + return { + typeUrl: "/cosmos.orm.v1.TableDescriptor", + value: TableDescriptor.encode(message).finish() + }; + } +}; +function createBasePrimaryKeyDescriptor(): PrimaryKeyDescriptor { + return { + fields: "", + autoIncrement: false + }; +} +export const PrimaryKeyDescriptor = { + typeUrl: "/cosmos.orm.v1.PrimaryKeyDescriptor", + encode(message: PrimaryKeyDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.fields !== "") { + writer.uint32(10).string(message.fields); + } + if (message.autoIncrement === true) { + writer.uint32(16).bool(message.autoIncrement); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PrimaryKeyDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePrimaryKeyDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fields = reader.string(); + break; + case 2: + message.autoIncrement = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PrimaryKeyDescriptor { + const message = createBasePrimaryKeyDescriptor(); + message.fields = object.fields ?? ""; + message.autoIncrement = object.autoIncrement ?? false; + return message; + }, + fromAmino(object: PrimaryKeyDescriptorAmino): PrimaryKeyDescriptor { + const message = createBasePrimaryKeyDescriptor(); + if (object.fields !== undefined && object.fields !== null) { + message.fields = object.fields; + } + if (object.auto_increment !== undefined && object.auto_increment !== null) { + message.autoIncrement = object.auto_increment; + } + return message; + }, + toAmino(message: PrimaryKeyDescriptor): PrimaryKeyDescriptorAmino { + const obj: any = {}; + obj.fields = message.fields === "" ? undefined : message.fields; + obj.auto_increment = message.autoIncrement === false ? undefined : message.autoIncrement; + return obj; + }, + fromAminoMsg(object: PrimaryKeyDescriptorAminoMsg): PrimaryKeyDescriptor { + return PrimaryKeyDescriptor.fromAmino(object.value); + }, + toAminoMsg(message: PrimaryKeyDescriptor): PrimaryKeyDescriptorAminoMsg { + return { + type: "cosmos-sdk/PrimaryKeyDescriptor", + value: PrimaryKeyDescriptor.toAmino(message) + }; + }, + fromProtoMsg(message: PrimaryKeyDescriptorProtoMsg): PrimaryKeyDescriptor { + return PrimaryKeyDescriptor.decode(message.value); + }, + toProto(message: PrimaryKeyDescriptor): Uint8Array { + return PrimaryKeyDescriptor.encode(message).finish(); + }, + toProtoMsg(message: PrimaryKeyDescriptor): PrimaryKeyDescriptorProtoMsg { + return { + typeUrl: "/cosmos.orm.v1.PrimaryKeyDescriptor", + value: PrimaryKeyDescriptor.encode(message).finish() + }; + } +}; +function createBaseSecondaryIndexDescriptor(): SecondaryIndexDescriptor { + return { + fields: "", + id: 0, + unique: false + }; +} +export const SecondaryIndexDescriptor = { + typeUrl: "/cosmos.orm.v1.SecondaryIndexDescriptor", + encode(message: SecondaryIndexDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.fields !== "") { + writer.uint32(10).string(message.fields); + } + if (message.id !== 0) { + writer.uint32(16).uint32(message.id); + } + if (message.unique === true) { + writer.uint32(24).bool(message.unique); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SecondaryIndexDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSecondaryIndexDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fields = reader.string(); + break; + case 2: + message.id = reader.uint32(); + break; + case 3: + message.unique = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SecondaryIndexDescriptor { + const message = createBaseSecondaryIndexDescriptor(); + message.fields = object.fields ?? ""; + message.id = object.id ?? 0; + message.unique = object.unique ?? false; + return message; + }, + fromAmino(object: SecondaryIndexDescriptorAmino): SecondaryIndexDescriptor { + const message = createBaseSecondaryIndexDescriptor(); + if (object.fields !== undefined && object.fields !== null) { + message.fields = object.fields; + } + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.unique !== undefined && object.unique !== null) { + message.unique = object.unique; + } + return message; + }, + toAmino(message: SecondaryIndexDescriptor): SecondaryIndexDescriptorAmino { + const obj: any = {}; + obj.fields = message.fields === "" ? undefined : message.fields; + obj.id = message.id === 0 ? undefined : message.id; + obj.unique = message.unique === false ? undefined : message.unique; + return obj; + }, + fromAminoMsg(object: SecondaryIndexDescriptorAminoMsg): SecondaryIndexDescriptor { + return SecondaryIndexDescriptor.fromAmino(object.value); + }, + toAminoMsg(message: SecondaryIndexDescriptor): SecondaryIndexDescriptorAminoMsg { + return { + type: "cosmos-sdk/SecondaryIndexDescriptor", + value: SecondaryIndexDescriptor.toAmino(message) + }; + }, + fromProtoMsg(message: SecondaryIndexDescriptorProtoMsg): SecondaryIndexDescriptor { + return SecondaryIndexDescriptor.decode(message.value); + }, + toProto(message: SecondaryIndexDescriptor): Uint8Array { + return SecondaryIndexDescriptor.encode(message).finish(); + }, + toProtoMsg(message: SecondaryIndexDescriptor): SecondaryIndexDescriptorProtoMsg { + return { + typeUrl: "/cosmos.orm.v1.SecondaryIndexDescriptor", + value: SecondaryIndexDescriptor.encode(message).finish() + }; + } +}; +function createBaseSingletonDescriptor(): SingletonDescriptor { + return { + id: 0 + }; +} +export const SingletonDescriptor = { + typeUrl: "/cosmos.orm.v1.SingletonDescriptor", + encode(message: SingletonDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== 0) { + writer.uint32(8).uint32(message.id); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SingletonDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSingletonDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SingletonDescriptor { + const message = createBaseSingletonDescriptor(); + message.id = object.id ?? 0; + return message; + }, + fromAmino(object: SingletonDescriptorAmino): SingletonDescriptor { + const message = createBaseSingletonDescriptor(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + return message; + }, + toAmino(message: SingletonDescriptor): SingletonDescriptorAmino { + const obj: any = {}; + obj.id = message.id === 0 ? undefined : message.id; + return obj; + }, + fromAminoMsg(object: SingletonDescriptorAminoMsg): SingletonDescriptor { + return SingletonDescriptor.fromAmino(object.value); + }, + toAminoMsg(message: SingletonDescriptor): SingletonDescriptorAminoMsg { + return { + type: "cosmos-sdk/SingletonDescriptor", + value: SingletonDescriptor.toAmino(message) + }; + }, + fromProtoMsg(message: SingletonDescriptorProtoMsg): SingletonDescriptor { + return SingletonDescriptor.decode(message.value); + }, + toProto(message: SingletonDescriptor): Uint8Array { + return SingletonDescriptor.encode(message).finish(); + }, + toProtoMsg(message: SingletonDescriptor): SingletonDescriptorProtoMsg { + return { + typeUrl: "/cosmos.orm.v1.SingletonDescriptor", + value: SingletonDescriptor.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/orm/v1alpha1/schema.ts b/src/codegen/cosmos/orm/v1alpha1/schema.ts new file mode 100644 index 0000000..9f38f32 --- /dev/null +++ b/src/codegen/cosmos/orm/v1alpha1/schema.ts @@ -0,0 +1,318 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +/** StorageType */ +export enum StorageType { + /** + * STORAGE_TYPE_DEFAULT_UNSPECIFIED - STORAGE_TYPE_DEFAULT_UNSPECIFIED indicates the persistent storage where all + * data is stored in the regular Merkle-tree backed KV-store. + */ + STORAGE_TYPE_DEFAULT_UNSPECIFIED = 0, + /** + * STORAGE_TYPE_MEMORY - STORAGE_TYPE_MEMORY indicates in-memory storage that will be + * reloaded every time an app restarts. Tables with this type of storage + * will by default be ignored when importing and exporting a module's + * state from JSON. + */ + STORAGE_TYPE_MEMORY = 1, + /** + * STORAGE_TYPE_TRANSIENT - STORAGE_TYPE_TRANSIENT indicates transient storage that is reset + * at the end of every block. Tables with this type of storage + * will by default be ignored when importing and exporting a module's + * state from JSON. + */ + STORAGE_TYPE_TRANSIENT = 2, + UNRECOGNIZED = -1, +} +export const StorageTypeSDKType = StorageType; +export const StorageTypeAmino = StorageType; +export function storageTypeFromJSON(object: any): StorageType { + switch (object) { + case 0: + case "STORAGE_TYPE_DEFAULT_UNSPECIFIED": + return StorageType.STORAGE_TYPE_DEFAULT_UNSPECIFIED; + case 1: + case "STORAGE_TYPE_MEMORY": + return StorageType.STORAGE_TYPE_MEMORY; + case 2: + case "STORAGE_TYPE_TRANSIENT": + return StorageType.STORAGE_TYPE_TRANSIENT; + case -1: + case "UNRECOGNIZED": + default: + return StorageType.UNRECOGNIZED; + } +} +export function storageTypeToJSON(object: StorageType): string { + switch (object) { + case StorageType.STORAGE_TYPE_DEFAULT_UNSPECIFIED: + return "STORAGE_TYPE_DEFAULT_UNSPECIFIED"; + case StorageType.STORAGE_TYPE_MEMORY: + return "STORAGE_TYPE_MEMORY"; + case StorageType.STORAGE_TYPE_TRANSIENT: + return "STORAGE_TYPE_TRANSIENT"; + case StorageType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** ModuleSchemaDescriptor describe's a module's ORM schema. */ +export interface ModuleSchemaDescriptor { + schemaFile: ModuleSchemaDescriptor_FileEntry[]; + /** + * prefix is an optional prefix that precedes all keys in this module's + * store. + */ + prefix: Uint8Array; +} +export interface ModuleSchemaDescriptorProtoMsg { + typeUrl: "/cosmos.orm.v1alpha1.ModuleSchemaDescriptor"; + value: Uint8Array; +} +/** ModuleSchemaDescriptor describe's a module's ORM schema. */ +export interface ModuleSchemaDescriptorAmino { + schema_file?: ModuleSchemaDescriptor_FileEntryAmino[]; + /** + * prefix is an optional prefix that precedes all keys in this module's + * store. + */ + prefix?: string; +} +export interface ModuleSchemaDescriptorAminoMsg { + type: "cosmos-sdk/ModuleSchemaDescriptor"; + value: ModuleSchemaDescriptorAmino; +} +/** ModuleSchemaDescriptor describe's a module's ORM schema. */ +export interface ModuleSchemaDescriptorSDKType { + schema_file: ModuleSchemaDescriptor_FileEntrySDKType[]; + prefix: Uint8Array; +} +/** FileEntry describes an ORM file used in a module. */ +export interface ModuleSchemaDescriptor_FileEntry { + /** + * id is a prefix that will be varint encoded and prepended to all the + * table keys specified in the file's tables. + */ + id: number; + /** + * proto_file_name is the name of a file .proto in that contains + * table definitions. The .proto file must be in a package that the + * module has referenced using cosmos.app.v1.ModuleDescriptor.use_package. + */ + protoFileName: string; + /** + * storage_type optionally indicates the type of storage this file's + * tables should used. If it is left unspecified, the default KV-storage + * of the app will be used. + */ + storageType: StorageType; +} +export interface ModuleSchemaDescriptor_FileEntryProtoMsg { + typeUrl: "/cosmos.orm.v1alpha1.FileEntry"; + value: Uint8Array; +} +/** FileEntry describes an ORM file used in a module. */ +export interface ModuleSchemaDescriptor_FileEntryAmino { + /** + * id is a prefix that will be varint encoded and prepended to all the + * table keys specified in the file's tables. + */ + id?: number; + /** + * proto_file_name is the name of a file .proto in that contains + * table definitions. The .proto file must be in a package that the + * module has referenced using cosmos.app.v1.ModuleDescriptor.use_package. + */ + proto_file_name?: string; + /** + * storage_type optionally indicates the type of storage this file's + * tables should used. If it is left unspecified, the default KV-storage + * of the app will be used. + */ + storage_type?: StorageType; +} +export interface ModuleSchemaDescriptor_FileEntryAminoMsg { + type: "cosmos-sdk/FileEntry"; + value: ModuleSchemaDescriptor_FileEntryAmino; +} +/** FileEntry describes an ORM file used in a module. */ +export interface ModuleSchemaDescriptor_FileEntrySDKType { + id: number; + proto_file_name: string; + storage_type: StorageType; +} +function createBaseModuleSchemaDescriptor(): ModuleSchemaDescriptor { + return { + schemaFile: [], + prefix: new Uint8Array() + }; +} +export const ModuleSchemaDescriptor = { + typeUrl: "/cosmos.orm.v1alpha1.ModuleSchemaDescriptor", + encode(message: ModuleSchemaDescriptor, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.schemaFile) { + ModuleSchemaDescriptor_FileEntry.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.prefix.length !== 0) { + writer.uint32(18).bytes(message.prefix); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModuleSchemaDescriptor { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleSchemaDescriptor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.schemaFile.push(ModuleSchemaDescriptor_FileEntry.decode(reader, reader.uint32())); + break; + case 2: + message.prefix = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ModuleSchemaDescriptor { + const message = createBaseModuleSchemaDescriptor(); + message.schemaFile = object.schemaFile?.map(e => ModuleSchemaDescriptor_FileEntry.fromPartial(e)) || []; + message.prefix = object.prefix ?? new Uint8Array(); + return message; + }, + fromAmino(object: ModuleSchemaDescriptorAmino): ModuleSchemaDescriptor { + const message = createBaseModuleSchemaDescriptor(); + message.schemaFile = object.schema_file?.map(e => ModuleSchemaDescriptor_FileEntry.fromAmino(e)) || []; + if (object.prefix !== undefined && object.prefix !== null) { + message.prefix = bytesFromBase64(object.prefix); + } + return message; + }, + toAmino(message: ModuleSchemaDescriptor): ModuleSchemaDescriptorAmino { + const obj: any = {}; + if (message.schemaFile) { + obj.schema_file = message.schemaFile.map(e => e ? ModuleSchemaDescriptor_FileEntry.toAmino(e) : undefined); + } else { + obj.schema_file = message.schemaFile; + } + obj.prefix = message.prefix ? base64FromBytes(message.prefix) : undefined; + return obj; + }, + fromAminoMsg(object: ModuleSchemaDescriptorAminoMsg): ModuleSchemaDescriptor { + return ModuleSchemaDescriptor.fromAmino(object.value); + }, + toAminoMsg(message: ModuleSchemaDescriptor): ModuleSchemaDescriptorAminoMsg { + return { + type: "cosmos-sdk/ModuleSchemaDescriptor", + value: ModuleSchemaDescriptor.toAmino(message) + }; + }, + fromProtoMsg(message: ModuleSchemaDescriptorProtoMsg): ModuleSchemaDescriptor { + return ModuleSchemaDescriptor.decode(message.value); + }, + toProto(message: ModuleSchemaDescriptor): Uint8Array { + return ModuleSchemaDescriptor.encode(message).finish(); + }, + toProtoMsg(message: ModuleSchemaDescriptor): ModuleSchemaDescriptorProtoMsg { + return { + typeUrl: "/cosmos.orm.v1alpha1.ModuleSchemaDescriptor", + value: ModuleSchemaDescriptor.encode(message).finish() + }; + } +}; +function createBaseModuleSchemaDescriptor_FileEntry(): ModuleSchemaDescriptor_FileEntry { + return { + id: 0, + protoFileName: "", + storageType: 0 + }; +} +export const ModuleSchemaDescriptor_FileEntry = { + typeUrl: "/cosmos.orm.v1alpha1.FileEntry", + encode(message: ModuleSchemaDescriptor_FileEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.id !== 0) { + writer.uint32(8).uint32(message.id); + } + if (message.protoFileName !== "") { + writer.uint32(18).string(message.protoFileName); + } + if (message.storageType !== 0) { + writer.uint32(24).int32(message.storageType); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ModuleSchemaDescriptor_FileEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModuleSchemaDescriptor_FileEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.uint32(); + break; + case 2: + message.protoFileName = reader.string(); + break; + case 3: + message.storageType = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ModuleSchemaDescriptor_FileEntry { + const message = createBaseModuleSchemaDescriptor_FileEntry(); + message.id = object.id ?? 0; + message.protoFileName = object.protoFileName ?? ""; + message.storageType = object.storageType ?? 0; + return message; + }, + fromAmino(object: ModuleSchemaDescriptor_FileEntryAmino): ModuleSchemaDescriptor_FileEntry { + const message = createBaseModuleSchemaDescriptor_FileEntry(); + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } + if (object.proto_file_name !== undefined && object.proto_file_name !== null) { + message.protoFileName = object.proto_file_name; + } + if (object.storage_type !== undefined && object.storage_type !== null) { + message.storageType = object.storage_type; + } + return message; + }, + toAmino(message: ModuleSchemaDescriptor_FileEntry): ModuleSchemaDescriptor_FileEntryAmino { + const obj: any = {}; + obj.id = message.id === 0 ? undefined : message.id; + obj.proto_file_name = message.protoFileName === "" ? undefined : message.protoFileName; + obj.storage_type = message.storageType === 0 ? undefined : message.storageType; + return obj; + }, + fromAminoMsg(object: ModuleSchemaDescriptor_FileEntryAminoMsg): ModuleSchemaDescriptor_FileEntry { + return ModuleSchemaDescriptor_FileEntry.fromAmino(object.value); + }, + toAminoMsg(message: ModuleSchemaDescriptor_FileEntry): ModuleSchemaDescriptor_FileEntryAminoMsg { + return { + type: "cosmos-sdk/FileEntry", + value: ModuleSchemaDescriptor_FileEntry.toAmino(message) + }; + }, + fromProtoMsg(message: ModuleSchemaDescriptor_FileEntryProtoMsg): ModuleSchemaDescriptor_FileEntry { + return ModuleSchemaDescriptor_FileEntry.decode(message.value); + }, + toProto(message: ModuleSchemaDescriptor_FileEntry): Uint8Array { + return ModuleSchemaDescriptor_FileEntry.encode(message).finish(); + }, + toProtoMsg(message: ModuleSchemaDescriptor_FileEntry): ModuleSchemaDescriptor_FileEntryProtoMsg { + return { + typeUrl: "/cosmos.orm.v1alpha1.FileEntry", + value: ModuleSchemaDescriptor_FileEntry.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/params/v1beta1/params.ts b/src/codegen/cosmos/params/v1beta1/params.ts index a3c2890..2637381 100644 --- a/src/codegen/cosmos/params/v1beta1/params.ts +++ b/src/codegen/cosmos/params/v1beta1/params.ts @@ -13,7 +13,7 @@ export interface ParameterChangeProposalProtoMsg { export interface ParameterChangeProposalAmino { title?: string; description?: string; - changes?: ParamChangeAmino[]; + changes: ParamChangeAmino[]; } export interface ParameterChangeProposalAminoMsg { type: "cosmos-sdk/ParameterChangeProposal"; diff --git a/src/codegen/cosmos/params/v1beta1/query.lcd.ts b/src/codegen/cosmos/params/v1beta1/query.lcd.ts index 1358ee5..30dd12e 100644 --- a/src/codegen/cosmos/params/v1beta1/query.lcd.ts +++ b/src/codegen/cosmos/params/v1beta1/query.lcd.ts @@ -1,5 +1,5 @@ import { LCDClient } from "@cosmology/lcd"; -import { QueryParamsRequest, QueryParamsResponseSDKType } from "./query"; +import { QueryParamsRequest, QueryParamsResponseSDKType, QuerySubspacesRequest, QuerySubspacesResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -9,6 +9,7 @@ export class LCDQueryClient { }) { this.req = requestClient; this.params = this.params.bind(this); + this.subspaces = this.subspaces.bind(this); } /* Params queries a specific parameter of a module, given its subspace and key. */ @@ -25,4 +26,11 @@ export class LCDQueryClient { const endpoint = `cosmos/params/v1beta1/params`; return await this.req.get(endpoint, options); } + /* Subspaces queries for all registered subspaces and all keys for a subspace. + + Since: cosmos-sdk 0.46 */ + async subspaces(_params: QuerySubspacesRequest = {}): Promise { + const endpoint = `cosmos/params/v1beta1/subspaces`; + return await this.req.get(endpoint); + } } \ No newline at end of file diff --git a/src/codegen/cosmos/params/v1beta1/query.rpc.Query.ts b/src/codegen/cosmos/params/v1beta1/query.rpc.Query.ts index a9ac5e5..a432f94 100644 --- a/src/codegen/cosmos/params/v1beta1/query.rpc.Query.ts +++ b/src/codegen/cosmos/params/v1beta1/query.rpc.Query.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryParamsRequest, QueryParamsResponse } from "./query"; +import { QueryParamsRequest, QueryParamsResponse, QuerySubspacesRequest, QuerySubspacesResponse } from "./query"; /** Query defines the gRPC querier service. */ export interface Query { /** @@ -9,18 +9,30 @@ export interface Query { * key. */ params(request: QueryParamsRequest): Promise; + /** + * Subspaces queries for all registered subspaces and all keys for a subspace. + * + * Since: cosmos-sdk 0.46 + */ + subspaces(request?: QuerySubspacesRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; this.params = this.params.bind(this); + this.subspaces = this.subspaces.bind(this); } params(request: QueryParamsRequest): Promise { const data = QueryParamsRequest.encode(request).finish(); const promise = this.rpc.request("cosmos.params.v1beta1.Query", "Params", data); return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); } + subspaces(request: QuerySubspacesRequest = {}): Promise { + const data = QuerySubspacesRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.params.v1beta1.Query", "Subspaces", data); + return promise.then(data => QuerySubspacesResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -28,6 +40,9 @@ export const createRpcQueryExtension = (base: QueryClient) => { return { params(request: QueryParamsRequest): Promise { return queryService.params(request); + }, + subspaces(request?: QuerySubspacesRequest): Promise { + return queryService.subspaces(request); } }; }; \ No newline at end of file diff --git a/src/codegen/cosmos/params/v1beta1/query.ts b/src/codegen/cosmos/params/v1beta1/query.ts index cdf6c16..8aaa158 100644 --- a/src/codegen/cosmos/params/v1beta1/query.ts +++ b/src/codegen/cosmos/params/v1beta1/query.ts @@ -39,7 +39,7 @@ export interface QueryParamsResponseProtoMsg { /** QueryParamsResponse is response type for the Query/Params RPC method. */ export interface QueryParamsResponseAmino { /** param defines the queried parameter. */ - param?: ParamChangeAmino; + param: ParamChangeAmino; } export interface QueryParamsResponseAminoMsg { type: "cosmos-sdk/QueryParamsResponse"; @@ -49,6 +49,108 @@ export interface QueryParamsResponseAminoMsg { export interface QueryParamsResponseSDKType { param: ParamChangeSDKType; } +/** + * QuerySubspacesRequest defines a request type for querying for all registered + * subspaces and all keys for a subspace. + * + * Since: cosmos-sdk 0.46 + */ +export interface QuerySubspacesRequest {} +export interface QuerySubspacesRequestProtoMsg { + typeUrl: "/cosmos.params.v1beta1.QuerySubspacesRequest"; + value: Uint8Array; +} +/** + * QuerySubspacesRequest defines a request type for querying for all registered + * subspaces and all keys for a subspace. + * + * Since: cosmos-sdk 0.46 + */ +export interface QuerySubspacesRequestAmino {} +export interface QuerySubspacesRequestAminoMsg { + type: "cosmos-sdk/QuerySubspacesRequest"; + value: QuerySubspacesRequestAmino; +} +/** + * QuerySubspacesRequest defines a request type for querying for all registered + * subspaces and all keys for a subspace. + * + * Since: cosmos-sdk 0.46 + */ +export interface QuerySubspacesRequestSDKType {} +/** + * QuerySubspacesResponse defines the response types for querying for all + * registered subspaces and all keys for a subspace. + * + * Since: cosmos-sdk 0.46 + */ +export interface QuerySubspacesResponse { + subspaces: Subspace[]; +} +export interface QuerySubspacesResponseProtoMsg { + typeUrl: "/cosmos.params.v1beta1.QuerySubspacesResponse"; + value: Uint8Array; +} +/** + * QuerySubspacesResponse defines the response types for querying for all + * registered subspaces and all keys for a subspace. + * + * Since: cosmos-sdk 0.46 + */ +export interface QuerySubspacesResponseAmino { + subspaces?: SubspaceAmino[]; +} +export interface QuerySubspacesResponseAminoMsg { + type: "cosmos-sdk/QuerySubspacesResponse"; + value: QuerySubspacesResponseAmino; +} +/** + * QuerySubspacesResponse defines the response types for querying for all + * registered subspaces and all keys for a subspace. + * + * Since: cosmos-sdk 0.46 + */ +export interface QuerySubspacesResponseSDKType { + subspaces: SubspaceSDKType[]; +} +/** + * Subspace defines a parameter subspace name and all the keys that exist for + * the subspace. + * + * Since: cosmos-sdk 0.46 + */ +export interface Subspace { + subspace: string; + keys: string[]; +} +export interface SubspaceProtoMsg { + typeUrl: "/cosmos.params.v1beta1.Subspace"; + value: Uint8Array; +} +/** + * Subspace defines a parameter subspace name and all the keys that exist for + * the subspace. + * + * Since: cosmos-sdk 0.46 + */ +export interface SubspaceAmino { + subspace?: string; + keys?: string[]; +} +export interface SubspaceAminoMsg { + type: "cosmos-sdk/Subspace"; + value: SubspaceAmino; +} +/** + * Subspace defines a parameter subspace name and all the keys that exist for + * the subspace. + * + * Since: cosmos-sdk 0.46 + */ +export interface SubspaceSDKType { + subspace: string; + keys: string[]; +} function createBaseQueryParamsRequest(): QueryParamsRequest { return { subspace: "", @@ -174,7 +276,7 @@ export const QueryParamsResponse = { }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; - obj.param = message.param ? ParamChange.toAmino(message.param) : undefined; + obj.param = message.param ? ParamChange.toAmino(message.param) : ParamChange.toAmino(ParamChange.fromPartial({})); return obj; }, fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { @@ -198,4 +300,214 @@ export const QueryParamsResponse = { value: QueryParamsResponse.encode(message).finish() }; } +}; +function createBaseQuerySubspacesRequest(): QuerySubspacesRequest { + return {}; +} +export const QuerySubspacesRequest = { + typeUrl: "/cosmos.params.v1beta1.QuerySubspacesRequest", + encode(_: QuerySubspacesRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubspacesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubspacesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QuerySubspacesRequest { + const message = createBaseQuerySubspacesRequest(); + return message; + }, + fromAmino(_: QuerySubspacesRequestAmino): QuerySubspacesRequest { + const message = createBaseQuerySubspacesRequest(); + return message; + }, + toAmino(_: QuerySubspacesRequest): QuerySubspacesRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QuerySubspacesRequestAminoMsg): QuerySubspacesRequest { + return QuerySubspacesRequest.fromAmino(object.value); + }, + toAminoMsg(message: QuerySubspacesRequest): QuerySubspacesRequestAminoMsg { + return { + type: "cosmos-sdk/QuerySubspacesRequest", + value: QuerySubspacesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySubspacesRequestProtoMsg): QuerySubspacesRequest { + return QuerySubspacesRequest.decode(message.value); + }, + toProto(message: QuerySubspacesRequest): Uint8Array { + return QuerySubspacesRequest.encode(message).finish(); + }, + toProtoMsg(message: QuerySubspacesRequest): QuerySubspacesRequestProtoMsg { + return { + typeUrl: "/cosmos.params.v1beta1.QuerySubspacesRequest", + value: QuerySubspacesRequest.encode(message).finish() + }; + } +}; +function createBaseQuerySubspacesResponse(): QuerySubspacesResponse { + return { + subspaces: [] + }; +} +export const QuerySubspacesResponse = { + typeUrl: "/cosmos.params.v1beta1.QuerySubspacesResponse", + encode(message: QuerySubspacesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.subspaces) { + Subspace.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QuerySubspacesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySubspacesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subspaces.push(Subspace.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QuerySubspacesResponse { + const message = createBaseQuerySubspacesResponse(); + message.subspaces = object.subspaces?.map(e => Subspace.fromPartial(e)) || []; + return message; + }, + fromAmino(object: QuerySubspacesResponseAmino): QuerySubspacesResponse { + const message = createBaseQuerySubspacesResponse(); + message.subspaces = object.subspaces?.map(e => Subspace.fromAmino(e)) || []; + return message; + }, + toAmino(message: QuerySubspacesResponse): QuerySubspacesResponseAmino { + const obj: any = {}; + if (message.subspaces) { + obj.subspaces = message.subspaces.map(e => e ? Subspace.toAmino(e) : undefined); + } else { + obj.subspaces = message.subspaces; + } + return obj; + }, + fromAminoMsg(object: QuerySubspacesResponseAminoMsg): QuerySubspacesResponse { + return QuerySubspacesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QuerySubspacesResponse): QuerySubspacesResponseAminoMsg { + return { + type: "cosmos-sdk/QuerySubspacesResponse", + value: QuerySubspacesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QuerySubspacesResponseProtoMsg): QuerySubspacesResponse { + return QuerySubspacesResponse.decode(message.value); + }, + toProto(message: QuerySubspacesResponse): Uint8Array { + return QuerySubspacesResponse.encode(message).finish(); + }, + toProtoMsg(message: QuerySubspacesResponse): QuerySubspacesResponseProtoMsg { + return { + typeUrl: "/cosmos.params.v1beta1.QuerySubspacesResponse", + value: QuerySubspacesResponse.encode(message).finish() + }; + } +}; +function createBaseSubspace(): Subspace { + return { + subspace: "", + keys: [] + }; +} +export const Subspace = { + typeUrl: "/cosmos.params.v1beta1.Subspace", + encode(message: Subspace, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subspace !== "") { + writer.uint32(10).string(message.subspace); + } + for (const v of message.keys) { + writer.uint32(18).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Subspace { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubspace(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subspace = reader.string(); + break; + case 2: + message.keys.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Subspace { + const message = createBaseSubspace(); + message.subspace = object.subspace ?? ""; + message.keys = object.keys?.map(e => e) || []; + return message; + }, + fromAmino(object: SubspaceAmino): Subspace { + const message = createBaseSubspace(); + if (object.subspace !== undefined && object.subspace !== null) { + message.subspace = object.subspace; + } + message.keys = object.keys?.map(e => e) || []; + return message; + }, + toAmino(message: Subspace): SubspaceAmino { + const obj: any = {}; + obj.subspace = message.subspace === "" ? undefined : message.subspace; + if (message.keys) { + obj.keys = message.keys.map(e => e); + } else { + obj.keys = message.keys; + } + return obj; + }, + fromAminoMsg(object: SubspaceAminoMsg): Subspace { + return Subspace.fromAmino(object.value); + }, + toAminoMsg(message: Subspace): SubspaceAminoMsg { + return { + type: "cosmos-sdk/Subspace", + value: Subspace.toAmino(message) + }; + }, + fromProtoMsg(message: SubspaceProtoMsg): Subspace { + return Subspace.decode(message.value); + }, + toProto(message: Subspace): Uint8Array { + return Subspace.encode(message).finish(); + }, + toProtoMsg(message: Subspace): SubspaceProtoMsg { + return { + typeUrl: "/cosmos.params.v1beta1.Subspace", + value: Subspace.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/src/codegen/cosmos/query/v1/query.ts b/src/codegen/cosmos/query/v1/query.ts new file mode 100644 index 0000000..693da49 --- /dev/null +++ b/src/codegen/cosmos/query/v1/query.ts @@ -0,0 +1 @@ +export {} \ No newline at end of file diff --git a/src/codegen/cosmos/reflection/v1/reflection.ts b/src/codegen/cosmos/reflection/v1/reflection.ts new file mode 100644 index 0000000..6a08b6c --- /dev/null +++ b/src/codegen/cosmos/reflection/v1/reflection.ts @@ -0,0 +1,165 @@ +import { FileDescriptorProto, FileDescriptorProtoAmino, FileDescriptorProtoSDKType } from "../../../google/protobuf/descriptor"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** FileDescriptorsRequest is the Query/FileDescriptors request type. */ +export interface FileDescriptorsRequest {} +export interface FileDescriptorsRequestProtoMsg { + typeUrl: "/cosmos.reflection.v1.FileDescriptorsRequest"; + value: Uint8Array; +} +/** FileDescriptorsRequest is the Query/FileDescriptors request type. */ +export interface FileDescriptorsRequestAmino {} +export interface FileDescriptorsRequestAminoMsg { + type: "cosmos-sdk/FileDescriptorsRequest"; + value: FileDescriptorsRequestAmino; +} +/** FileDescriptorsRequest is the Query/FileDescriptors request type. */ +export interface FileDescriptorsRequestSDKType {} +/** FileDescriptorsResponse is the Query/FileDescriptors response type. */ +export interface FileDescriptorsResponse { + /** files is the file descriptors. */ + files: FileDescriptorProto[]; +} +export interface FileDescriptorsResponseProtoMsg { + typeUrl: "/cosmos.reflection.v1.FileDescriptorsResponse"; + value: Uint8Array; +} +/** FileDescriptorsResponse is the Query/FileDescriptors response type. */ +export interface FileDescriptorsResponseAmino { + /** files is the file descriptors. */ + files?: FileDescriptorProtoAmino[]; +} +export interface FileDescriptorsResponseAminoMsg { + type: "cosmos-sdk/FileDescriptorsResponse"; + value: FileDescriptorsResponseAmino; +} +/** FileDescriptorsResponse is the Query/FileDescriptors response type. */ +export interface FileDescriptorsResponseSDKType { + files: FileDescriptorProtoSDKType[]; +} +function createBaseFileDescriptorsRequest(): FileDescriptorsRequest { + return {}; +} +export const FileDescriptorsRequest = { + typeUrl: "/cosmos.reflection.v1.FileDescriptorsRequest", + encode(_: FileDescriptorsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FileDescriptorsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileDescriptorsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): FileDescriptorsRequest { + const message = createBaseFileDescriptorsRequest(); + return message; + }, + fromAmino(_: FileDescriptorsRequestAmino): FileDescriptorsRequest { + const message = createBaseFileDescriptorsRequest(); + return message; + }, + toAmino(_: FileDescriptorsRequest): FileDescriptorsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: FileDescriptorsRequestAminoMsg): FileDescriptorsRequest { + return FileDescriptorsRequest.fromAmino(object.value); + }, + toAminoMsg(message: FileDescriptorsRequest): FileDescriptorsRequestAminoMsg { + return { + type: "cosmos-sdk/FileDescriptorsRequest", + value: FileDescriptorsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: FileDescriptorsRequestProtoMsg): FileDescriptorsRequest { + return FileDescriptorsRequest.decode(message.value); + }, + toProto(message: FileDescriptorsRequest): Uint8Array { + return FileDescriptorsRequest.encode(message).finish(); + }, + toProtoMsg(message: FileDescriptorsRequest): FileDescriptorsRequestProtoMsg { + return { + typeUrl: "/cosmos.reflection.v1.FileDescriptorsRequest", + value: FileDescriptorsRequest.encode(message).finish() + }; + } +}; +function createBaseFileDescriptorsResponse(): FileDescriptorsResponse { + return { + files: [] + }; +} +export const FileDescriptorsResponse = { + typeUrl: "/cosmos.reflection.v1.FileDescriptorsResponse", + encode(message: FileDescriptorsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.files) { + FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): FileDescriptorsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileDescriptorsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.files.push(FileDescriptorProto.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): FileDescriptorsResponse { + const message = createBaseFileDescriptorsResponse(); + message.files = object.files?.map(e => FileDescriptorProto.fromPartial(e)) || []; + return message; + }, + fromAmino(object: FileDescriptorsResponseAmino): FileDescriptorsResponse { + const message = createBaseFileDescriptorsResponse(); + message.files = object.files?.map(e => FileDescriptorProto.fromAmino(e)) || []; + return message; + }, + toAmino(message: FileDescriptorsResponse): FileDescriptorsResponseAmino { + const obj: any = {}; + if (message.files) { + obj.files = message.files.map(e => e ? FileDescriptorProto.toAmino(e) : undefined); + } else { + obj.files = message.files; + } + return obj; + }, + fromAminoMsg(object: FileDescriptorsResponseAminoMsg): FileDescriptorsResponse { + return FileDescriptorsResponse.fromAmino(object.value); + }, + toAminoMsg(message: FileDescriptorsResponse): FileDescriptorsResponseAminoMsg { + return { + type: "cosmos-sdk/FileDescriptorsResponse", + value: FileDescriptorsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: FileDescriptorsResponseProtoMsg): FileDescriptorsResponse { + return FileDescriptorsResponse.decode(message.value); + }, + toProto(message: FileDescriptorsResponse): Uint8Array { + return FileDescriptorsResponse.encode(message).finish(); + }, + toProtoMsg(message: FileDescriptorsResponse): FileDescriptorsResponseProtoMsg { + return { + typeUrl: "/cosmos.reflection.v1.FileDescriptorsResponse", + value: FileDescriptorsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/rpc.query.ts b/src/codegen/cosmos/rpc.query.ts index e913850..cd99630 100644 --- a/src/codegen/cosmos/rpc.query.ts +++ b/src/codegen/cosmos/rpc.query.ts @@ -9,12 +9,18 @@ export const createRPCQueryClient = async ({ const client = new QueryClient(tmClient); return { cosmos: { + app: { + v1alpha1: (await import("./app/v1alpha1/query.rpc.Query")).createRpcQueryExtension(client) + }, auth: { v1beta1: (await import("./auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, authz: { v1beta1: (await import("./authz/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, + autocli: { + v1: (await import("./autocli/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, bank: { v1beta1: (await import("./bank/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, @@ -26,6 +32,12 @@ export const createRPCQueryClient = async ({ v1beta1: (await import("./base/tendermint/v1beta1/query.rpc.Service")).createRpcQueryExtension(client) } }, + circuit: { + v1: (await import("./circuit/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, + consensus: { + v1: (await import("./consensus/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, distribution: { v1beta1: (await import("./distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, @@ -36,11 +48,23 @@ export const createRPCQueryClient = async ({ v1beta1: (await import("./feegrant/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, gov: { + v1: (await import("./gov/v1/query.rpc.Query")).createRpcQueryExtension(client), v1beta1: (await import("./gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, + group: { + v1: (await import("./group/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, mint: { v1beta1: (await import("./mint/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, + nft: { + v1beta1: (await import("./nft/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + orm: { + query: { + v1alpha1: (await import("./orm/query/v1alpha1/query.rpc.Query")).createRpcQueryExtension(client) + } + }, params: { v1beta1: (await import("./params/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, diff --git a/src/codegen/cosmos/rpc.tx.ts b/src/codegen/cosmos/rpc.tx.ts index 72f881e..d67a0bf 100644 --- a/src/codegen/cosmos/rpc.tx.ts +++ b/src/codegen/cosmos/rpc.tx.ts @@ -5,12 +5,21 @@ export const createRPCMsgClient = async ({ rpc: Rpc; }) => ({ cosmos: { + auth: { + v1beta1: new (await import("./auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, authz: { v1beta1: new (await import("./authz/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, bank: { v1beta1: new (await import("./bank/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, + circuit: { + v1: new (await import("./circuit/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + consensus: { + v1: new (await import("./consensus/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, crisis: { v1beta1: new (await import("./crisis/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, @@ -24,14 +33,27 @@ export const createRPCMsgClient = async ({ v1beta1: new (await import("./feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, gov: { + v1: new (await import("./gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), v1beta1: new (await import("./gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, + group: { + v1: new (await import("./group/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + mint: { + v1beta1: new (await import("./mint/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + nft: { + v1beta1: new (await import("./nft/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, slashing: { v1beta1: new (await import("./slashing/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, staking: { v1beta1: new (await import("./staking/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, + upgrade: { + v1beta1: new (await import("./upgrade/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, vesting: { v1beta1: new (await import("./vesting/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) } diff --git a/src/codegen/cosmos/slashing/v1beta1/genesis.ts b/src/codegen/cosmos/slashing/v1beta1/genesis.ts index e434b32..d23a40f 100644 --- a/src/codegen/cosmos/slashing/v1beta1/genesis.ts +++ b/src/codegen/cosmos/slashing/v1beta1/genesis.ts @@ -2,7 +2,7 @@ import { Params, ParamsAmino, ParamsSDKType, ValidatorSigningInfo, ValidatorSign import { BinaryReader, BinaryWriter } from "../../../binary"; /** GenesisState defines the slashing module's genesis state. */ export interface GenesisState { - /** params defines all the paramaters of related to deposit. */ + /** params defines all the parameters of the module. */ params: Params; /** * signing_infos represents a map between validator addresses and their @@ -21,18 +21,18 @@ export interface GenesisStateProtoMsg { } /** GenesisState defines the slashing module's genesis state. */ export interface GenesisStateAmino { - /** params defines all the paramaters of related to deposit. */ - params?: ParamsAmino; + /** params defines all the parameters of the module. */ + params: ParamsAmino; /** * signing_infos represents a map between validator addresses and their * signing infos. */ - signing_infos?: SigningInfoAmino[]; + signing_infos: SigningInfoAmino[]; /** * missed_blocks represents a map between validator addresses and their * missed blocks. */ - missed_blocks?: ValidatorMissedBlocksAmino[]; + missed_blocks: ValidatorMissedBlocksAmino[]; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -60,7 +60,7 @@ export interface SigningInfoAmino { /** address is the validator address. */ address?: string; /** validator_signing_info represents the signing info of this validator. */ - validator_signing_info?: ValidatorSigningInfoAmino; + validator_signing_info: ValidatorSigningInfoAmino; } export interface SigningInfoAminoMsg { type: "cosmos-sdk/SigningInfo"; @@ -93,7 +93,7 @@ export interface ValidatorMissedBlocksAmino { /** address is the validator address. */ address?: string; /** missed_blocks is an array of missed blocks by the validator. */ - missed_blocks?: MissedBlockAmino[]; + missed_blocks: MissedBlockAmino[]; } export interface ValidatorMissedBlocksAminoMsg { type: "cosmos-sdk/ValidatorMissedBlocks"; @@ -196,7 +196,7 @@ export const GenesisState = { }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.params = message.params ? Params.toAmino(message.params) : Params.toAmino(Params.fromPartial({})); if (message.signingInfos) { obj.signing_infos = message.signingInfos.map(e => e ? SigningInfo.toAmino(e) : undefined); } else { @@ -287,7 +287,7 @@ export const SigningInfo = { toAmino(message: SigningInfo): SigningInfoAmino { const obj: any = {}; obj.address = message.address === "" ? undefined : message.address; - obj.validator_signing_info = message.validatorSigningInfo ? ValidatorSigningInfo.toAmino(message.validatorSigningInfo) : undefined; + obj.validator_signing_info = message.validatorSigningInfo ? ValidatorSigningInfo.toAmino(message.validatorSigningInfo) : ValidatorSigningInfo.toAmino(ValidatorSigningInfo.fromPartial({})); return obj; }, fromAminoMsg(object: SigningInfoAminoMsg): SigningInfo { diff --git a/src/codegen/cosmos/slashing/v1beta1/query.ts b/src/codegen/cosmos/slashing/v1beta1/query.ts index d3cd098..739053f 100644 --- a/src/codegen/cosmos/slashing/v1beta1/query.ts +++ b/src/codegen/cosmos/slashing/v1beta1/query.ts @@ -25,7 +25,7 @@ export interface QueryParamsResponseProtoMsg { } /** QueryParamsResponse is the response type for the Query/Params RPC method */ export interface QueryParamsResponseAmino { - params?: ParamsAmino; + params: ParamsAmino; } export interface QueryParamsResponseAminoMsg { type: "cosmos-sdk/QueryParamsResponse"; @@ -84,7 +84,7 @@ export interface QuerySigningInfoResponseProtoMsg { */ export interface QuerySigningInfoResponseAmino { /** val_signing_info is the signing info of requested val cons address */ - val_signing_info?: ValidatorSigningInfoAmino; + val_signing_info: ValidatorSigningInfoAmino; } export interface QuerySigningInfoResponseAminoMsg { type: "cosmos-sdk/QuerySigningInfoResponse"; @@ -145,7 +145,7 @@ export interface QuerySigningInfosResponseProtoMsg { */ export interface QuerySigningInfosResponseAmino { /** info is the signing info of all validators */ - info?: ValidatorSigningInfoAmino[]; + info: ValidatorSigningInfoAmino[]; pagination?: PageResponseAmino; } export interface QuerySigningInfosResponseAminoMsg { @@ -260,7 +260,7 @@ export const QueryParamsResponse = { }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.params = message.params ? Params.toAmino(message.params) : Params.toAmino(Params.fromPartial({})); return obj; }, fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { @@ -398,7 +398,7 @@ export const QuerySigningInfoResponse = { }, toAmino(message: QuerySigningInfoResponse): QuerySigningInfoResponseAmino { const obj: any = {}; - obj.val_signing_info = message.valSigningInfo ? ValidatorSigningInfo.toAmino(message.valSigningInfo) : undefined; + obj.val_signing_info = message.valSigningInfo ? ValidatorSigningInfo.toAmino(message.valSigningInfo) : ValidatorSigningInfo.toAmino(ValidatorSigningInfo.fromPartial({})); return obj; }, fromAminoMsg(object: QuerySigningInfoResponseAminoMsg): QuerySigningInfoResponse { diff --git a/src/codegen/cosmos/slashing/v1beta1/slashing.ts b/src/codegen/cosmos/slashing/v1beta1/slashing.ts index d601d20..f74b81a 100644 --- a/src/codegen/cosmos/slashing/v1beta1/slashing.ts +++ b/src/codegen/cosmos/slashing/v1beta1/slashing.ts @@ -8,24 +8,25 @@ import { toTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from ".. */ export interface ValidatorSigningInfo { address: string; - /** Height at which validator was first a candidate OR was unjailed */ + /** Height at which validator was first a candidate OR was un-jailed */ startHeight: bigint; /** - * Index which is incremented each time the validator was a bonded - * in a block and may have signed a precommit or not. This in conjunction with the - * `SignedBlocksWindow` param determines the index in the `MissedBlocksBitArray`. + * Index which is incremented every time a validator is bonded in a block and + * _may_ have signed a pre-commit or not. This in conjunction with the + * signed_blocks_window param determines the index in the missed block bitmap. */ indexOffset: bigint; /** Timestamp until which the validator is jailed due to liveness downtime. */ jailedUntil: Date; /** - * Whether or not a validator has been tombstoned (killed out of validator set). It is set - * once the validator commits an equivocation or for any other configured misbehiavor. + * Whether or not a validator has been tombstoned (killed out of validator + * set). It is set once the validator commits an equivocation or for any other + * configured misbehavior. */ tombstoned: boolean; /** - * A counter kept to avoid unnecessary array reads. - * Note that `Sum(MissedBlocksBitArray)` always equals `MissedBlocksCounter`. + * A counter of missed (unsigned) blocks. It is used to avoid unnecessary + * reads in the missed block bitmap. */ missedBlocksCounter: bigint; } @@ -39,24 +40,25 @@ export interface ValidatorSigningInfoProtoMsg { */ export interface ValidatorSigningInfoAmino { address?: string; - /** Height at which validator was first a candidate OR was unjailed */ + /** Height at which validator was first a candidate OR was un-jailed */ start_height?: string; /** - * Index which is incremented each time the validator was a bonded - * in a block and may have signed a precommit or not. This in conjunction with the - * `SignedBlocksWindow` param determines the index in the `MissedBlocksBitArray`. + * Index which is incremented every time a validator is bonded in a block and + * _may_ have signed a pre-commit or not. This in conjunction with the + * signed_blocks_window param determines the index in the missed block bitmap. */ index_offset?: string; /** Timestamp until which the validator is jailed due to liveness downtime. */ - jailed_until?: string; + jailed_until: string; /** - * Whether or not a validator has been tombstoned (killed out of validator set). It is set - * once the validator commits an equivocation or for any other configured misbehiavor. + * Whether or not a validator has been tombstoned (killed out of validator + * set). It is set once the validator commits an equivocation or for any other + * configured misbehavior. */ tombstoned?: boolean; /** - * A counter kept to avoid unnecessary array reads. - * Note that `Sum(MissedBlocksBitArray)` always equals `MissedBlocksCounter`. + * A counter of missed (unsigned) blocks. It is used to avoid unnecessary + * reads in the missed block bitmap. */ missed_blocks_counter?: string; } @@ -91,13 +93,13 @@ export interface ParamsProtoMsg { /** Params represents the parameters used for by the slashing module. */ export interface ParamsAmino { signed_blocks_window?: string; - min_signed_per_window?: string; - downtime_jail_duration?: DurationAmino; - slash_fraction_double_sign?: string; - slash_fraction_downtime?: string; + min_signed_per_window: string; + downtime_jail_duration: DurationAmino; + slash_fraction_double_sign: string; + slash_fraction_downtime: string; } export interface ParamsAminoMsg { - type: "cosmos-sdk/Params"; + type: "cosmos-sdk/x/slashing/Params"; value: ParamsAmino; } /** Params represents the parameters used for by the slashing module. */ @@ -210,7 +212,7 @@ export const ValidatorSigningInfo = { obj.address = message.address === "" ? undefined : message.address; obj.start_height = message.startHeight !== BigInt(0) ? message.startHeight.toString() : undefined; obj.index_offset = message.indexOffset !== BigInt(0) ? message.indexOffset.toString() : undefined; - obj.jailed_until = message.jailedUntil ? Timestamp.toAmino(toTimestamp(message.jailedUntil)) : undefined; + obj.jailed_until = message.jailedUntil ? Timestamp.toAmino(toTimestamp(message.jailedUntil)) : new Date(); obj.tombstoned = message.tombstoned === false ? undefined : message.tombstoned; obj.missed_blocks_counter = message.missedBlocksCounter !== BigInt(0) ? message.missedBlocksCounter.toString() : undefined; return obj; @@ -326,10 +328,10 @@ export const Params = { toAmino(message: Params): ParamsAmino { const obj: any = {}; obj.signed_blocks_window = message.signedBlocksWindow !== BigInt(0) ? message.signedBlocksWindow.toString() : undefined; - obj.min_signed_per_window = message.minSignedPerWindow ? base64FromBytes(message.minSignedPerWindow) : undefined; - obj.downtime_jail_duration = message.downtimeJailDuration ? Duration.toAmino(message.downtimeJailDuration) : undefined; - obj.slash_fraction_double_sign = message.slashFractionDoubleSign ? base64FromBytes(message.slashFractionDoubleSign) : undefined; - obj.slash_fraction_downtime = message.slashFractionDowntime ? base64FromBytes(message.slashFractionDowntime) : undefined; + obj.min_signed_per_window = message.minSignedPerWindow ? base64FromBytes(message.minSignedPerWindow) : ""; + obj.downtime_jail_duration = message.downtimeJailDuration ? Duration.toAmino(message.downtimeJailDuration) : Duration.toAmino(Duration.fromPartial({})); + obj.slash_fraction_double_sign = message.slashFractionDoubleSign ? base64FromBytes(message.slashFractionDoubleSign) : ""; + obj.slash_fraction_downtime = message.slashFractionDowntime ? base64FromBytes(message.slashFractionDowntime) : ""; return obj; }, fromAminoMsg(object: ParamsAminoMsg): Params { @@ -337,7 +339,7 @@ export const Params = { }, toAminoMsg(message: Params): ParamsAminoMsg { return { - type: "cosmos-sdk/Params", + type: "cosmos-sdk/x/slashing/Params", value: Params.toAmino(message) }; }, diff --git a/src/codegen/cosmos/slashing/v1beta1/tx.amino.ts b/src/codegen/cosmos/slashing/v1beta1/tx.amino.ts index 9f63825..d3e2064 100644 --- a/src/codegen/cosmos/slashing/v1beta1/tx.amino.ts +++ b/src/codegen/cosmos/slashing/v1beta1/tx.amino.ts @@ -1,8 +1,13 @@ -import { MsgUnjail } from "./tx"; +import { MsgUnjail, MsgUpdateParams } from "./tx"; export const AminoConverter = { "/cosmos.slashing.v1beta1.MsgUnjail": { aminoType: "cosmos-sdk/MsgUnjail", toAmino: MsgUnjail.toAmino, fromAmino: MsgUnjail.fromAmino + }, + "/cosmos.slashing.v1beta1.MsgUpdateParams": { + aminoType: "cosmos-sdk/x/slashing/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino } }; \ No newline at end of file diff --git a/src/codegen/cosmos/slashing/v1beta1/tx.registry.ts b/src/codegen/cosmos/slashing/v1beta1/tx.registry.ts index 76feebd..f9858b1 100644 --- a/src/codegen/cosmos/slashing/v1beta1/tx.registry.ts +++ b/src/codegen/cosmos/slashing/v1beta1/tx.registry.ts @@ -1,6 +1,6 @@ import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgUnjail } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.slashing.v1beta1.MsgUnjail", MsgUnjail]]; +import { MsgUnjail, MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.slashing.v1beta1.MsgUnjail", MsgUnjail], ["/cosmos.slashing.v1beta1.MsgUpdateParams", MsgUpdateParams]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -13,6 +13,12 @@ export const MessageComposer = { typeUrl: "/cosmos.slashing.v1beta1.MsgUnjail", value: MsgUnjail.encode(value).finish() }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.slashing.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; } }, withTypeUrl: { @@ -21,6 +27,12 @@ export const MessageComposer = { typeUrl: "/cosmos.slashing.v1beta1.MsgUnjail", value }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.slashing.v1beta1.MsgUpdateParams", + value + }; } }, fromPartial: { @@ -29,6 +41,12 @@ export const MessageComposer = { typeUrl: "/cosmos.slashing.v1beta1.MsgUnjail", value: MsgUnjail.fromPartial(value) }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.slashing.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/src/codegen/cosmos/slashing/v1beta1/tx.rpc.msg.ts b/src/codegen/cosmos/slashing/v1beta1/tx.rpc.msg.ts index 5a4b327..9dd16d1 100644 --- a/src/codegen/cosmos/slashing/v1beta1/tx.rpc.msg.ts +++ b/src/codegen/cosmos/slashing/v1beta1/tx.rpc.msg.ts @@ -1,6 +1,6 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; -import { MsgUnjail, MsgUnjailResponse } from "./tx"; +import { MsgUnjail, MsgUnjailResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; /** Msg defines the slashing Msg service. */ export interface Msg { /** @@ -9,16 +9,29 @@ export interface Msg { * and rewards again. */ unjail(request: MsgUnjail): Promise; + /** + * UpdateParams defines a governance operation for updating the x/slashing module + * parameters. The authority defaults to the x/gov module account. + * + * Since: cosmos-sdk 0.47 + */ + updateParams(request: MsgUpdateParams): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; this.unjail = this.unjail.bind(this); + this.updateParams = this.updateParams.bind(this); } unjail(request: MsgUnjail): Promise { const data = MsgUnjail.encode(request).finish(); const promise = this.rpc.request("cosmos.slashing.v1beta1.Msg", "Unjail", data); return promise.then(data => MsgUnjailResponse.decode(new BinaryReader(data))); } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("cosmos.slashing.v1beta1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } } \ No newline at end of file diff --git a/src/codegen/cosmos/slashing/v1beta1/tx.ts b/src/codegen/cosmos/slashing/v1beta1/tx.ts index abfce51..2ba15e0 100644 --- a/src/codegen/cosmos/slashing/v1beta1/tx.ts +++ b/src/codegen/cosmos/slashing/v1beta1/tx.ts @@ -1,3 +1,4 @@ +import { Params, ParamsAmino, ParamsSDKType } from "./slashing"; import { BinaryReader, BinaryWriter } from "../../../binary"; /** MsgUnjail defines the Msg/Unjail request type */ export interface MsgUnjail { @@ -33,6 +34,82 @@ export interface MsgUnjailResponseAminoMsg { } /** MsgUnjailResponse defines the Msg/Unjail response type */ export interface MsgUnjailResponseSDKType {} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** + * params defines the x/slashing parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/cosmos.slashing.v1beta1.MsgUpdateParams"; + value: Uint8Array; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; + /** + * params defines the x/slashing parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/x/slashing/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsSDKType; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/cosmos.slashing.v1beta1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseSDKType {} function createBaseMsgUnjail(): MsgUnjail { return { validatorAddr: "" @@ -157,4 +234,141 @@ export const MsgUnjailResponse = { value: MsgUnjailResponse.encode(message).finish() }; } +}; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/cosmos.slashing.v1beta1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.params = message.params ? Params.toAmino(message.params) : Params.toAmino(Params.fromPartial({})); + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/x/slashing/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/cosmos.slashing.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/cosmos.slashing.v1beta1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/cosmos.slashing.v1beta1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/src/codegen/cosmos/staking/v1beta1/authz.ts b/src/codegen/cosmos/staking/v1beta1/authz.ts index 43c6a3f..b1a0d07 100644 --- a/src/codegen/cosmos/staking/v1beta1/authz.ts +++ b/src/codegen/cosmos/staking/v1beta1/authz.ts @@ -14,6 +14,8 @@ export enum AuthorizationType { AUTHORIZATION_TYPE_UNDELEGATE = 2, /** AUTHORIZATION_TYPE_REDELEGATE - AUTHORIZATION_TYPE_REDELEGATE defines an authorization type for Msg/BeginRedelegate */ AUTHORIZATION_TYPE_REDELEGATE = 3, + /** AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION - AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION defines an authorization type for Msg/MsgCancelUnbondingDelegation */ + AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION = 4, UNRECOGNIZED = -1, } export const AuthorizationTypeSDKType = AuthorizationType; @@ -32,6 +34,9 @@ export function authorizationTypeFromJSON(object: any): AuthorizationType { case 3: case "AUTHORIZATION_TYPE_REDELEGATE": return AuthorizationType.AUTHORIZATION_TYPE_REDELEGATE; + case 4: + case "AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION": + return AuthorizationType.AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION; case -1: case "UNRECOGNIZED": default: @@ -48,6 +53,8 @@ export function authorizationTypeToJSON(object: AuthorizationType): string { return "AUTHORIZATION_TYPE_UNDELEGATE"; case AuthorizationType.AUTHORIZATION_TYPE_REDELEGATE: return "AUTHORIZATION_TYPE_REDELEGATE"; + case AuthorizationType.AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION: + return "AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION"; case AuthorizationType.UNRECOGNIZED: default: return "UNRECOGNIZED"; diff --git a/src/codegen/cosmos/staking/v1beta1/genesis.ts b/src/codegen/cosmos/staking/v1beta1/genesis.ts index 045e944..f49c77e 100644 --- a/src/codegen/cosmos/staking/v1beta1/genesis.ts +++ b/src/codegen/cosmos/staking/v1beta1/genesis.ts @@ -3,7 +3,7 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { bytesFromBase64, base64FromBytes } from "../../../helpers"; /** GenesisState defines the staking module's genesis state. */ export interface GenesisState { - /** params defines all the paramaters of related to deposit. */ + /** params defines all the parameters of related to deposit. */ params: Params; /** * last_total_power tracks the total amounts of bonded tokens recorded during @@ -15,7 +15,7 @@ export interface GenesisState { * of the last-block's bonded validators. */ lastValidatorPowers: LastValidatorPower[]; - /** delegations defines the validator set at genesis. */ + /** validators defines the validator set at genesis. */ validators: Validator[]; /** delegations defines the delegations active at genesis. */ delegations: Delegation[]; @@ -23,6 +23,7 @@ export interface GenesisState { unbondingDelegations: UnbondingDelegation[]; /** redelegations defines the redelegations active at genesis. */ redelegations: Redelegation[]; + /** exported defines a bool to identify whether the chain dealing with exported or initialized genesis. */ exported: boolean; } export interface GenesisStateProtoMsg { @@ -31,26 +32,27 @@ export interface GenesisStateProtoMsg { } /** GenesisState defines the staking module's genesis state. */ export interface GenesisStateAmino { - /** params defines all the paramaters of related to deposit. */ - params?: ParamsAmino; + /** params defines all the parameters of related to deposit. */ + params: ParamsAmino; /** * last_total_power tracks the total amounts of bonded tokens recorded during * the previous end block. */ - last_total_power?: string; + last_total_power: string; /** * last_validator_powers is a special index that provides a historical list * of the last-block's bonded validators. */ - last_validator_powers?: LastValidatorPowerAmino[]; - /** delegations defines the validator set at genesis. */ - validators?: ValidatorAmino[]; + last_validator_powers: LastValidatorPowerAmino[]; + /** validators defines the validator set at genesis. */ + validators: ValidatorAmino[]; /** delegations defines the delegations active at genesis. */ - delegations?: DelegationAmino[]; + delegations: DelegationAmino[]; /** unbonding_delegations defines the unbonding delegations active at genesis. */ - unbonding_delegations?: UnbondingDelegationAmino[]; + unbonding_delegations: UnbondingDelegationAmino[]; /** redelegations defines the redelegations active at genesis. */ - redelegations?: RedelegationAmino[]; + redelegations: RedelegationAmino[]; + /** exported defines a bool to identify whether the chain dealing with exported or initialized genesis. */ exported?: boolean; } export interface GenesisStateAminoMsg { @@ -206,8 +208,8 @@ export const GenesisState = { }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; - obj.last_total_power = message.lastTotalPower ? base64FromBytes(message.lastTotalPower) : undefined; + obj.params = message.params ? Params.toAmino(message.params) : Params.toAmino(Params.fromPartial({})); + obj.last_total_power = message.lastTotalPower ? base64FromBytes(message.lastTotalPower) : ""; if (message.lastValidatorPowers) { obj.last_validator_powers = message.lastValidatorPowers.map(e => e ? LastValidatorPower.toAmino(e) : undefined); } else { diff --git a/src/codegen/cosmos/staking/v1beta1/query.lcd.ts b/src/codegen/cosmos/staking/v1beta1/query.lcd.ts index 4ba0b02..24291aa 100644 --- a/src/codegen/cosmos/staking/v1beta1/query.lcd.ts +++ b/src/codegen/cosmos/staking/v1beta1/query.lcd.ts @@ -24,7 +24,10 @@ export class LCDQueryClient { this.pool = this.pool.bind(this); this.params = this.params.bind(this); } - /* Validators queries all validators that match the given status. */ + /* Validators queries all validators that match the given status. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. */ async validators(params: QueryValidatorsRequest): Promise { const options: any = { params: {} @@ -43,7 +46,10 @@ export class LCDQueryClient { const endpoint = `cosmos/staking/v1beta1/validators/${params.validatorAddr}`; return await this.req.get(endpoint); } - /* ValidatorDelegations queries delegate info for given validator. */ + /* ValidatorDelegations queries delegate info for given validator. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. */ async validatorDelegations(params: QueryValidatorDelegationsRequest): Promise { const options: any = { params: {} @@ -54,7 +60,10 @@ export class LCDQueryClient { const endpoint = `cosmos/staking/v1beta1/validators/${params.validatorAddr}/delegations`; return await this.req.get(endpoint, options); } - /* ValidatorUnbondingDelegations queries unbonding delegations of a validator. */ + /* ValidatorUnbondingDelegations queries unbonding delegations of a validator. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. */ async validatorUnbondingDelegations(params: QueryValidatorUnbondingDelegationsRequest): Promise { const options: any = { params: {} @@ -76,7 +85,10 @@ export class LCDQueryClient { const endpoint = `cosmos/staking/v1beta1/validators/${params.validatorAddr}/delegations/${params.delegatorAddr}/unbonding_delegation`; return await this.req.get(endpoint); } - /* DelegatorDelegations queries all delegations of a given delegator address. */ + /* DelegatorDelegations queries all delegations of a given delegator address. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. */ async delegatorDelegations(params: QueryDelegatorDelegationsRequest): Promise { const options: any = { params: {} @@ -88,7 +100,10 @@ export class LCDQueryClient { return await this.req.get(endpoint, options); } /* DelegatorUnbondingDelegations queries all unbonding delegations of a given - delegator address. */ + delegator address. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. */ async delegatorUnbondingDelegations(params: QueryDelegatorUnbondingDelegationsRequest): Promise { const options: any = { params: {} @@ -99,7 +114,10 @@ export class LCDQueryClient { const endpoint = `cosmos/staking/v1beta1/delegators/${params.delegatorAddr}/unbonding_delegations`; return await this.req.get(endpoint, options); } - /* Redelegations queries redelegations of given address. */ + /* Redelegations queries redelegations of given address. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. */ async redelegations(params: QueryRedelegationsRequest): Promise { const options: any = { params: {} @@ -117,7 +135,10 @@ export class LCDQueryClient { return await this.req.get(endpoint, options); } /* DelegatorValidators queries all validators info for given delegator - address. */ + address. + + When called from another module, this query might consume a high amount of + gas if the pagination field is incorrectly set. */ async delegatorValidators(params: QueryDelegatorValidatorsRequest): Promise { const options: any = { params: {} diff --git a/src/codegen/cosmos/staking/v1beta1/query.rpc.Query.ts b/src/codegen/cosmos/staking/v1beta1/query.rpc.Query.ts index 1a204ce..f70d85e 100644 --- a/src/codegen/cosmos/staking/v1beta1/query.rpc.Query.ts +++ b/src/codegen/cosmos/staking/v1beta1/query.rpc.Query.ts @@ -4,13 +4,28 @@ import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; import { QueryValidatorsRequest, QueryValidatorsResponse, QueryValidatorRequest, QueryValidatorResponse, QueryValidatorDelegationsRequest, QueryValidatorDelegationsResponse, QueryValidatorUnbondingDelegationsRequest, QueryValidatorUnbondingDelegationsResponse, QueryDelegationRequest, QueryDelegationResponse, QueryUnbondingDelegationRequest, QueryUnbondingDelegationResponse, QueryDelegatorDelegationsRequest, QueryDelegatorDelegationsResponse, QueryDelegatorUnbondingDelegationsRequest, QueryDelegatorUnbondingDelegationsResponse, QueryRedelegationsRequest, QueryRedelegationsResponse, QueryDelegatorValidatorsRequest, QueryDelegatorValidatorsResponse, QueryDelegatorValidatorRequest, QueryDelegatorValidatorResponse, QueryHistoricalInfoRequest, QueryHistoricalInfoResponse, QueryPoolRequest, QueryPoolResponse, QueryParamsRequest, QueryParamsResponse } from "./query"; /** Query defines the gRPC querier service. */ export interface Query { - /** Validators queries all validators that match the given status. */ + /** + * Validators queries all validators that match the given status. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ validators(request: QueryValidatorsRequest): Promise; /** Validator queries validator info for given validator address. */ validator(request: QueryValidatorRequest): Promise; - /** ValidatorDelegations queries delegate info for given validator. */ + /** + * ValidatorDelegations queries delegate info for given validator. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ validatorDelegations(request: QueryValidatorDelegationsRequest): Promise; - /** ValidatorUnbondingDelegations queries unbonding delegations of a validator. */ + /** + * ValidatorUnbondingDelegations queries unbonding delegations of a validator. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ validatorUnbondingDelegations(request: QueryValidatorUnbondingDelegationsRequest): Promise; /** Delegation queries delegate info for given validator delegator pair. */ delegation(request: QueryDelegationRequest): Promise; @@ -19,18 +34,34 @@ export interface Query { * pair. */ unbondingDelegation(request: QueryUnbondingDelegationRequest): Promise; - /** DelegatorDelegations queries all delegations of a given delegator address. */ + /** + * DelegatorDelegations queries all delegations of a given delegator address. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ delegatorDelegations(request: QueryDelegatorDelegationsRequest): Promise; /** * DelegatorUnbondingDelegations queries all unbonding delegations of a given * delegator address. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. */ delegatorUnbondingDelegations(request: QueryDelegatorUnbondingDelegationsRequest): Promise; - /** Redelegations queries redelegations of given address. */ + /** + * Redelegations queries redelegations of given address. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. + */ redelegations(request: QueryRedelegationsRequest): Promise; /** * DelegatorValidators queries all validators info for given delegator * address. + * + * When called from another module, this query might consume a high amount of + * gas if the pagination field is incorrectly set. */ delegatorValidators(request: QueryDelegatorValidatorsRequest): Promise; /** diff --git a/src/codegen/cosmos/staking/v1beta1/query.ts b/src/codegen/cosmos/staking/v1beta1/query.ts index 3c639f3..17e1c36 100644 --- a/src/codegen/cosmos/staking/v1beta1/query.ts +++ b/src/codegen/cosmos/staking/v1beta1/query.ts @@ -42,7 +42,7 @@ export interface QueryValidatorsResponseProtoMsg { /** QueryValidatorsResponse is response type for the Query/Validators RPC method */ export interface QueryValidatorsResponseAmino { /** validators contains all the queried validators. */ - validators?: ValidatorAmino[]; + validators: ValidatorAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -79,7 +79,7 @@ export interface QueryValidatorRequestSDKType { } /** QueryValidatorResponse is response type for the Query/Validator RPC method */ export interface QueryValidatorResponse { - /** validator defines the the validator info. */ + /** validator defines the validator info. */ validator: Validator; } export interface QueryValidatorResponseProtoMsg { @@ -88,8 +88,8 @@ export interface QueryValidatorResponseProtoMsg { } /** QueryValidatorResponse is response type for the Query/Validator RPC method */ export interface QueryValidatorResponseAmino { - /** validator defines the the validator info. */ - validator?: ValidatorAmino; + /** validator defines the validator info. */ + validator: ValidatorAmino; } export interface QueryValidatorResponseAminoMsg { type: "cosmos-sdk/QueryValidatorResponse"; @@ -153,7 +153,7 @@ export interface QueryValidatorDelegationsResponseProtoMsg { * Query/ValidatorDelegations RPC method */ export interface QueryValidatorDelegationsResponseAmino { - delegation_responses?: DelegationResponseAmino[]; + delegation_responses: DelegationResponseAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -223,7 +223,7 @@ export interface QueryValidatorUnbondingDelegationsResponseProtoMsg { * Query/ValidatorUnbondingDelegations RPC method. */ export interface QueryValidatorUnbondingDelegationsResponseAmino { - unbonding_responses?: UnbondingDelegationAmino[]; + unbonding_responses: UnbondingDelegationAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -342,7 +342,7 @@ export interface QueryUnbondingDelegationResponseProtoMsg { */ export interface QueryUnbondingDelegationResponseAmino { /** unbond defines the unbonding information of a delegation. */ - unbond?: UnbondingDelegationAmino; + unbond: UnbondingDelegationAmino; } export interface QueryUnbondingDelegationResponseAminoMsg { type: "cosmos-sdk/QueryUnbondingDelegationResponse"; @@ -411,7 +411,7 @@ export interface QueryDelegatorDelegationsResponseProtoMsg { */ export interface QueryDelegatorDelegationsResponseAmino { /** delegation_responses defines all the delegations' info of a delegator. */ - delegation_responses?: DelegationResponseAmino[]; + delegation_responses: DelegationResponseAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -481,7 +481,7 @@ export interface QueryDelegatorUnbondingDelegationsResponseProtoMsg { * Query/UnbondingDelegatorDelegations RPC method. */ export interface QueryDelegatorUnbondingDelegationsResponseAmino { - unbonding_responses?: UnbondingDelegationAmino[]; + unbonding_responses: UnbondingDelegationAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -561,7 +561,7 @@ export interface QueryRedelegationsResponseProtoMsg { * method. */ export interface QueryRedelegationsResponseAmino { - redelegation_responses?: RedelegationResponseAmino[]; + redelegation_responses: RedelegationResponseAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -618,7 +618,7 @@ export interface QueryDelegatorValidatorsRequestSDKType { * Query/DelegatorValidators RPC method. */ export interface QueryDelegatorValidatorsResponse { - /** validators defines the the validators' info of a delegator. */ + /** validators defines the validators' info of a delegator. */ validators: Validator[]; /** pagination defines the pagination in the response. */ pagination?: PageResponse; @@ -632,8 +632,8 @@ export interface QueryDelegatorValidatorsResponseProtoMsg { * Query/DelegatorValidators RPC method. */ export interface QueryDelegatorValidatorsResponseAmino { - /** validators defines the the validators' info of a delegator. */ - validators?: ValidatorAmino[]; + /** validators defines the validators' info of a delegator. */ + validators: ValidatorAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -690,7 +690,7 @@ export interface QueryDelegatorValidatorRequestSDKType { * Query/DelegatorValidator RPC method. */ export interface QueryDelegatorValidatorResponse { - /** validator defines the the validator info. */ + /** validator defines the validator info. */ validator: Validator; } export interface QueryDelegatorValidatorResponseProtoMsg { @@ -702,8 +702,8 @@ export interface QueryDelegatorValidatorResponseProtoMsg { * Query/DelegatorValidator RPC method. */ export interface QueryDelegatorValidatorResponseAmino { - /** validator defines the the validator info. */ - validator?: ValidatorAmino; + /** validator defines the validator info. */ + validator: ValidatorAmino; } export interface QueryDelegatorValidatorResponseAminoMsg { type: "cosmos-sdk/QueryDelegatorValidatorResponse"; @@ -804,7 +804,7 @@ export interface QueryPoolResponseProtoMsg { /** QueryPoolResponse is response type for the Query/Pool RPC method. */ export interface QueryPoolResponseAmino { /** pool defines the pool info. */ - pool?: PoolAmino; + pool: PoolAmino; } export interface QueryPoolResponseAminoMsg { type: "cosmos-sdk/QueryPoolResponse"; @@ -840,7 +840,7 @@ export interface QueryParamsResponseProtoMsg { /** QueryParamsResponse is response type for the Query/Params RPC method. */ export interface QueryParamsResponseAmino { /** params holds all the parameters of this module. */ - params?: ParamsAmino; + params: ParamsAmino; } export interface QueryParamsResponseAminoMsg { type: "cosmos-sdk/QueryParamsResponse"; @@ -1127,7 +1127,7 @@ export const QueryValidatorResponse = { }, toAmino(message: QueryValidatorResponse): QueryValidatorResponseAmino { const obj: any = {}; - obj.validator = message.validator ? Validator.toAmino(message.validator) : undefined; + obj.validator = message.validator ? Validator.toAmino(message.validator) : Validator.toAmino(Validator.fromPartial({})); return obj; }, fromAminoMsg(object: QueryValidatorResponseAminoMsg): QueryValidatorResponse { @@ -1755,7 +1755,7 @@ export const QueryUnbondingDelegationResponse = { }, toAmino(message: QueryUnbondingDelegationResponse): QueryUnbondingDelegationResponseAmino { const obj: any = {}; - obj.unbond = message.unbond ? UnbondingDelegation.toAmino(message.unbond) : undefined; + obj.unbond = message.unbond ? UnbondingDelegation.toAmino(message.unbond) : UnbondingDelegation.toAmino(UnbondingDelegation.fromPartial({})); return obj; }, fromAminoMsg(object: QueryUnbondingDelegationResponseAminoMsg): QueryUnbondingDelegationResponse { @@ -2585,7 +2585,7 @@ export const QueryDelegatorValidatorResponse = { }, toAmino(message: QueryDelegatorValidatorResponse): QueryDelegatorValidatorResponseAmino { const obj: any = {}; - obj.validator = message.validator ? Validator.toAmino(message.validator) : undefined; + obj.validator = message.validator ? Validator.toAmino(message.validator) : Validator.toAmino(Validator.fromPartial({})); return obj; }, fromAminoMsg(object: QueryDelegatorValidatorResponseAminoMsg): QueryDelegatorValidatorResponse { @@ -2848,7 +2848,7 @@ export const QueryPoolResponse = { }, toAmino(message: QueryPoolResponse): QueryPoolResponseAmino { const obj: any = {}; - obj.pool = message.pool ? Pool.toAmino(message.pool) : undefined; + obj.pool = message.pool ? Pool.toAmino(message.pool) : Pool.toAmino(Pool.fromPartial({})); return obj; }, fromAminoMsg(object: QueryPoolResponseAminoMsg): QueryPoolResponse { @@ -2973,7 +2973,7 @@ export const QueryParamsResponse = { }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.params = message.params ? Params.toAmino(message.params) : Params.toAmino(Params.fromPartial({})); return obj; }, fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { diff --git a/src/codegen/cosmos/staking/v1beta1/staking.ts b/src/codegen/cosmos/staking/v1beta1/staking.ts index 15afc72..4284c51 100644 --- a/src/codegen/cosmos/staking/v1beta1/staking.ts +++ b/src/codegen/cosmos/staking/v1beta1/staking.ts @@ -57,44 +57,44 @@ export function bondStatusToJSON(object: BondStatus): string { return "UNRECOGNIZED"; } } -/** InfractionType indicates the infraction type a validator commited. */ -export enum InfractionType { - /** INFRACTION_TYPE_UNSPECIFIED - UNSPECIFIED defines an empty infraction type. */ - INFRACTION_TYPE_UNSPECIFIED = 0, - /** INFRACTION_TYPE_DOUBLE_SIGN - DOUBLE_SIGN defines a validator that double-signs a block. */ - INFRACTION_TYPE_DOUBLE_SIGN = 1, - /** INFRACTION_TYPE_DOWNTIME - DOWNTIME defines a validator that missed signing too many blocks. */ - INFRACTION_TYPE_DOWNTIME = 2, +/** Infraction indicates the infraction a validator commited. */ +export enum Infraction { + /** INFRACTION_UNSPECIFIED - UNSPECIFIED defines an empty infraction. */ + INFRACTION_UNSPECIFIED = 0, + /** INFRACTION_DOUBLE_SIGN - DOUBLE_SIGN defines a validator that double-signs a block. */ + INFRACTION_DOUBLE_SIGN = 1, + /** INFRACTION_DOWNTIME - DOWNTIME defines a validator that missed signing too many blocks. */ + INFRACTION_DOWNTIME = 2, UNRECOGNIZED = -1, } -export const InfractionTypeSDKType = InfractionType; -export const InfractionTypeAmino = InfractionType; -export function infractionTypeFromJSON(object: any): InfractionType { +export const InfractionSDKType = Infraction; +export const InfractionAmino = Infraction; +export function infractionFromJSON(object: any): Infraction { switch (object) { case 0: - case "INFRACTION_TYPE_UNSPECIFIED": - return InfractionType.INFRACTION_TYPE_UNSPECIFIED; + case "INFRACTION_UNSPECIFIED": + return Infraction.INFRACTION_UNSPECIFIED; case 1: - case "INFRACTION_TYPE_DOUBLE_SIGN": - return InfractionType.INFRACTION_TYPE_DOUBLE_SIGN; + case "INFRACTION_DOUBLE_SIGN": + return Infraction.INFRACTION_DOUBLE_SIGN; case 2: - case "INFRACTION_TYPE_DOWNTIME": - return InfractionType.INFRACTION_TYPE_DOWNTIME; + case "INFRACTION_DOWNTIME": + return Infraction.INFRACTION_DOWNTIME; case -1: case "UNRECOGNIZED": default: - return InfractionType.UNRECOGNIZED; + return Infraction.UNRECOGNIZED; } } -export function infractionTypeToJSON(object: InfractionType): string { +export function infractionToJSON(object: Infraction): string { switch (object) { - case InfractionType.INFRACTION_TYPE_UNSPECIFIED: - return "INFRACTION_TYPE_UNSPECIFIED"; - case InfractionType.INFRACTION_TYPE_DOUBLE_SIGN: - return "INFRACTION_TYPE_DOUBLE_SIGN"; - case InfractionType.INFRACTION_TYPE_DOWNTIME: - return "INFRACTION_TYPE_DOWNTIME"; - case InfractionType.UNRECOGNIZED: + case Infraction.INFRACTION_UNSPECIFIED: + return "INFRACTION_UNSPECIFIED"; + case Infraction.INFRACTION_DOUBLE_SIGN: + return "INFRACTION_DOUBLE_SIGN"; + case Infraction.INFRACTION_DOWNTIME: + return "INFRACTION_DOWNTIME"; + case Infraction.UNRECOGNIZED: default: return "UNRECOGNIZED"; } @@ -120,8 +120,8 @@ export interface HistoricalInfoProtoMsg { * (`n` is set by the staking module's `historical_entries` parameter). */ export interface HistoricalInfoAmino { - header?: HeaderAmino; - valset?: ValidatorAmino[]; + header: HeaderAmino; + valset: ValidatorAmino[]; } export interface HistoricalInfoAminoMsg { type: "cosmos-sdk/HistoricalInfo"; @@ -159,11 +159,11 @@ export interface CommissionRatesProtoMsg { */ export interface CommissionRatesAmino { /** rate is the commission rate charged to delegators, as a fraction. */ - rate?: string; + rate: string; /** max_rate defines the maximum commission rate which validator can ever charge, as a fraction. */ - max_rate?: string; + max_rate: string; /** max_change_rate defines the maximum daily increase of the validator commission, as a fraction. */ - max_change_rate?: string; + max_change_rate: string; } export interface CommissionRatesAminoMsg { type: "cosmos-sdk/CommissionRates"; @@ -192,9 +192,9 @@ export interface CommissionProtoMsg { /** Commission defines commission parameters for a given validator. */ export interface CommissionAmino { /** commission_rates defines the initial commission rates to be used for creating a validator. */ - commission_rates?: CommissionRatesAmino; + commission_rates: CommissionRatesAmino; /** update_time is the last time the commission rate was changed. */ - update_time?: string; + update_time: string; } export interface CommissionAminoMsg { type: "cosmos-sdk/Commission"; @@ -278,7 +278,11 @@ export interface Validator { unbondingTime: Date; /** commission defines the commission parameters. */ commission: Commission; - /** min_self_delegation is the validator's self declared minimum self delegation. */ + /** + * min_self_delegation is the validator's self declared minimum self delegation. + * + * Since: cosmos-sdk 0.46 + */ minSelfDelegation: string; /** strictly positive if this validator's unbonding has been stopped by external modules */ unbondingOnHoldRefCount: bigint; @@ -313,14 +317,18 @@ export interface ValidatorAmino { /** delegator_shares defines total shares issued to a validator's delegators. */ delegator_shares?: string; /** description defines the description terms for the validator. */ - description?: DescriptionAmino; + description: DescriptionAmino; /** unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. */ unbonding_height?: string; /** unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. */ - unbonding_time?: string; + unbonding_time: string; /** commission defines the commission parameters. */ - commission?: CommissionAmino; - /** min_self_delegation is the validator's self declared minimum self delegation. */ + commission: CommissionAmino; + /** + * min_self_delegation is the validator's self declared minimum self delegation. + * + * Since: cosmos-sdk 0.46 + */ min_self_delegation?: string; /** strictly positive if this validator's unbonding has been stopped by external modules */ unbonding_on_hold_ref_count?: string; @@ -421,7 +429,7 @@ export interface DVPairsProtoMsg { } /** DVPairs defines an array of DVPair objects. */ export interface DVPairsAmino { - pairs?: DVPairAmino[]; + pairs: DVPairAmino[]; } export interface DVPairsAminoMsg { type: "cosmos-sdk/DVPairs"; @@ -482,7 +490,7 @@ export interface DVVTripletsProtoMsg { } /** DVVTriplets defines an array of DVVTriplet objects. */ export interface DVVTripletsAmino { - triplets?: DVVTripletAmino[]; + triplets: DVVTripletAmino[]; } export interface DVVTripletsAminoMsg { type: "cosmos-sdk/DVVTriplets"; @@ -498,9 +506,9 @@ export interface DVVTripletsSDKType { * validator. */ export interface Delegation { - /** delegator_address is the bech32-encoded address of the delegator. */ + /** delegator_address is the encoded address of the delegator. */ delegatorAddress: string; - /** validator_address is the bech32-encoded address of the validator. */ + /** validator_address is the encoded address of the validator. */ validatorAddress: string; /** shares define the delegation shares received. */ shares: string; @@ -515,9 +523,9 @@ export interface DelegationProtoMsg { * validator. */ export interface DelegationAmino { - /** delegator_address is the bech32-encoded address of the delegator. */ + /** delegator_address is the encoded address of the delegator. */ delegator_address?: string; - /** validator_address is the bech32-encoded address of the validator. */ + /** validator_address is the encoded address of the validator. */ validator_address?: string; /** shares define the delegation shares received. */ shares?: string; @@ -541,9 +549,9 @@ export interface DelegationSDKType { * for a single validator in an time-ordered list. */ export interface UnbondingDelegation { - /** delegator_address is the bech32-encoded address of the delegator. */ + /** delegator_address is the encoded address of the delegator. */ delegatorAddress: string; - /** validator_address is the bech32-encoded address of the validator. */ + /** validator_address is the encoded address of the validator. */ validatorAddress: string; /** entries are the unbonding delegation entries. */ entries: UnbondingDelegationEntry[]; @@ -557,12 +565,12 @@ export interface UnbondingDelegationProtoMsg { * for a single validator in an time-ordered list. */ export interface UnbondingDelegationAmino { - /** delegator_address is the bech32-encoded address of the delegator. */ + /** delegator_address is the encoded address of the delegator. */ delegator_address?: string; - /** validator_address is the bech32-encoded address of the validator. */ + /** validator_address is the encoded address of the validator. */ validator_address?: string; /** entries are the unbonding delegation entries. */ - entries?: UnbondingDelegationEntryAmino[]; + entries: UnbondingDelegationEntryAmino[]; } export interface UnbondingDelegationAminoMsg { type: "cosmos-sdk/UnbondingDelegation"; @@ -601,7 +609,7 @@ export interface UnbondingDelegationEntryAmino { /** creation_height is the height which the unbonding took place. */ creation_height?: string; /** completion_time is the unix time for unbonding completion. */ - completion_time?: string; + completion_time: string; /** initial_balance defines the tokens initially scheduled to receive at completion. */ initial_balance?: string; /** balance defines the tokens to receive at completion. */ @@ -648,7 +656,7 @@ export interface RedelegationEntryAmino { /** creation_height defines the height which the redelegation took place. */ creation_height?: string; /** completion_time defines the unix time for redelegation completion. */ - completion_time?: string; + completion_time: string; /** initial_balance defines the initial balance when redelegation started. */ initial_balance?: string; /** shares_dst is the amount of destination-validator shares created by redelegation. */ @@ -701,7 +709,7 @@ export interface RedelegationAmino { /** validator_dst_address is the validator redelegation destination operator address. */ validator_dst_address?: string; /** entries are the redelegation entries. */ - entries?: RedelegationEntryAmino[]; + entries: RedelegationEntryAmino[]; } export interface RedelegationAminoMsg { type: "cosmos-sdk/Redelegation"; @@ -717,7 +725,7 @@ export interface RedelegationSDKType { validator_dst_address: string; entries: RedelegationEntrySDKType[]; } -/** Params defines the parameters for the staking module. */ +/** Params defines the parameters for the x/staking module. */ export interface Params { /** unbonding_time is the time duration of unbonding. */ unbondingTime: Duration; @@ -729,15 +737,17 @@ export interface Params { historicalEntries: number; /** bond_denom defines the bondable coin denomination. */ bondDenom: string; + /** min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators */ + minCommissionRate: string; } export interface ParamsProtoMsg { typeUrl: "/cosmos.staking.v1beta1.Params"; value: Uint8Array; } -/** Params defines the parameters for the staking module. */ +/** Params defines the parameters for the x/staking module. */ export interface ParamsAmino { /** unbonding_time is the time duration of unbonding. */ - unbonding_time?: DurationAmino; + unbonding_time: DurationAmino; /** max_validators is the maximum number of validators. */ max_validators?: number; /** max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). */ @@ -746,18 +756,21 @@ export interface ParamsAmino { historical_entries?: number; /** bond_denom defines the bondable coin denomination. */ bond_denom?: string; + /** min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators */ + min_commission_rate: string; } export interface ParamsAminoMsg { - type: "cosmos-sdk/Params"; + type: "cosmos-sdk/x/staking/Params"; value: ParamsAmino; } -/** Params defines the parameters for the staking module. */ +/** Params defines the parameters for the x/staking module. */ export interface ParamsSDKType { unbonding_time: DurationSDKType; max_validators: number; max_entries: number; historical_entries: number; bond_denom: string; + min_commission_rate: string; } /** * DelegationResponse is equivalent to Delegation except that it contains a @@ -776,8 +789,8 @@ export interface DelegationResponseProtoMsg { * balance in addition to shares which is more suitable for client responses. */ export interface DelegationResponseAmino { - delegation?: DelegationAmino; - balance?: CoinAmino; + delegation: DelegationAmino; + balance: CoinAmino; } export interface DelegationResponseAminoMsg { type: "cosmos-sdk/DelegationResponse"; @@ -810,7 +823,7 @@ export interface RedelegationEntryResponseProtoMsg { * responses. */ export interface RedelegationEntryResponseAmino { - redelegation_entry?: RedelegationEntryAmino; + redelegation_entry: RedelegationEntryAmino; balance?: string; } export interface RedelegationEntryResponseAminoMsg { @@ -845,8 +858,8 @@ export interface RedelegationResponseProtoMsg { * responses. */ export interface RedelegationResponseAmino { - redelegation?: RedelegationAmino; - entries?: RedelegationEntryResponseAmino[]; + redelegation: RedelegationAmino; + entries: RedelegationEntryResponseAmino[]; } export interface RedelegationResponseAminoMsg { type: "cosmos-sdk/RedelegationResponse"; @@ -893,7 +906,10 @@ export interface PoolSDKType { not_bonded_tokens: string; bonded_tokens: string; } -/** ValidatorUpdates defines an array of abci.ValidatorUpdate objects. */ +/** + * ValidatorUpdates defines an array of abci.ValidatorUpdate objects. + * TODO: explore moving this to proto/cosmos/base to separate modules from tendermint dependence + */ export interface ValidatorUpdates { updates: ValidatorUpdate[]; } @@ -901,15 +917,21 @@ export interface ValidatorUpdatesProtoMsg { typeUrl: "/cosmos.staking.v1beta1.ValidatorUpdates"; value: Uint8Array; } -/** ValidatorUpdates defines an array of abci.ValidatorUpdate objects. */ +/** + * ValidatorUpdates defines an array of abci.ValidatorUpdate objects. + * TODO: explore moving this to proto/cosmos/base to separate modules from tendermint dependence + */ export interface ValidatorUpdatesAmino { - updates?: ValidatorUpdateAmino[]; + updates: ValidatorUpdateAmino[]; } export interface ValidatorUpdatesAminoMsg { type: "cosmos-sdk/ValidatorUpdates"; value: ValidatorUpdatesAmino; } -/** ValidatorUpdates defines an array of abci.ValidatorUpdate objects. */ +/** + * ValidatorUpdates defines an array of abci.ValidatorUpdate objects. + * TODO: explore moving this to proto/cosmos/base to separate modules from tendermint dependence + */ export interface ValidatorUpdatesSDKType { updates: ValidatorUpdateSDKType[]; } @@ -966,7 +988,7 @@ export const HistoricalInfo = { }, toAmino(message: HistoricalInfo): HistoricalInfoAmino { const obj: any = {}; - obj.header = message.header ? Header.toAmino(message.header) : undefined; + obj.header = message.header ? Header.toAmino(message.header) : Header.toAmino(Header.fromPartial({})); if (message.valset) { obj.valset = message.valset.map(e => e ? Validator.toAmino(e) : undefined); } else { @@ -1062,9 +1084,9 @@ export const CommissionRates = { }, toAmino(message: CommissionRates): CommissionRatesAmino { const obj: any = {}; - obj.rate = message.rate === "" ? undefined : message.rate; - obj.max_rate = message.maxRate === "" ? undefined : message.maxRate; - obj.max_change_rate = message.maxChangeRate === "" ? undefined : message.maxChangeRate; + obj.rate = message.rate ?? ""; + obj.max_rate = message.maxRate ?? ""; + obj.max_change_rate = message.maxChangeRate ?? ""; return obj; }, fromAminoMsg(object: CommissionRatesAminoMsg): CommissionRates { @@ -1144,8 +1166,8 @@ export const Commission = { }, toAmino(message: Commission): CommissionAmino { const obj: any = {}; - obj.commission_rates = message.commissionRates ? CommissionRates.toAmino(message.commissionRates) : undefined; - obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : undefined; + obj.commission_rates = message.commissionRates ? CommissionRates.toAmino(message.commissionRates) : CommissionRates.toAmino(CommissionRates.fromPartial({})); + obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : new Date(); return obj; }, fromAminoMsg(object: CommissionAminoMsg): Commission { @@ -1476,10 +1498,10 @@ export const Validator = { obj.status = message.status === 0 ? undefined : message.status; obj.tokens = message.tokens === "" ? undefined : message.tokens; obj.delegator_shares = message.delegatorShares === "" ? undefined : message.delegatorShares; - obj.description = message.description ? Description.toAmino(message.description) : undefined; + obj.description = message.description ? Description.toAmino(message.description) : Description.toAmino(Description.fromPartial({})); obj.unbonding_height = message.unbondingHeight !== BigInt(0) ? message.unbondingHeight.toString() : undefined; - obj.unbonding_time = message.unbondingTime ? Timestamp.toAmino(toTimestamp(message.unbondingTime)) : undefined; - obj.commission = message.commission ? Commission.toAmino(message.commission) : undefined; + obj.unbonding_time = message.unbondingTime ? Timestamp.toAmino(toTimestamp(message.unbondingTime)) : new Date(); + obj.commission = message.commission ? Commission.toAmino(message.commission) : Commission.toAmino(Commission.fromPartial({})); obj.min_self_delegation = message.minSelfDelegation === "" ? undefined : message.minSelfDelegation; obj.unbonding_on_hold_ref_count = message.unbondingOnHoldRefCount !== BigInt(0) ? message.unbondingOnHoldRefCount.toString() : undefined; if (message.unbondingIds) { @@ -2186,7 +2208,7 @@ export const UnbondingDelegationEntry = { toAmino(message: UnbondingDelegationEntry): UnbondingDelegationEntryAmino { const obj: any = {}; obj.creation_height = message.creationHeight !== BigInt(0) ? message.creationHeight.toString() : undefined; - obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : undefined; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : new Date(); obj.initial_balance = message.initialBalance === "" ? undefined : message.initialBalance; obj.balance = message.balance === "" ? undefined : message.balance; obj.unbonding_id = message.unbondingId !== BigInt(0) ? message.unbondingId.toString() : undefined; @@ -2315,7 +2337,7 @@ export const RedelegationEntry = { toAmino(message: RedelegationEntry): RedelegationEntryAmino { const obj: any = {}; obj.creation_height = message.creationHeight !== BigInt(0) ? message.creationHeight.toString() : undefined; - obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : undefined; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : new Date(); obj.initial_balance = message.initialBalance === "" ? undefined : message.initialBalance; obj.shares_dst = message.sharesDst === "" ? undefined : message.sharesDst; obj.unbonding_id = message.unbondingId !== BigInt(0) ? message.unbondingId.toString() : undefined; @@ -2457,7 +2479,8 @@ function createBaseParams(): Params { maxValidators: 0, maxEntries: 0, historicalEntries: 0, - bondDenom: "" + bondDenom: "", + minCommissionRate: "" }; } export const Params = { @@ -2478,6 +2501,9 @@ export const Params = { if (message.bondDenom !== "") { writer.uint32(42).string(message.bondDenom); } + if (message.minCommissionRate !== "") { + writer.uint32(50).string(Decimal.fromUserInput(message.minCommissionRate, 18).atomics); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Params { @@ -2502,6 +2528,9 @@ export const Params = { case 5: message.bondDenom = reader.string(); break; + case 6: + message.minCommissionRate = Decimal.fromAtomics(reader.string(), 18).toString(); + break; default: reader.skipType(tag & 7); break; @@ -2516,6 +2545,7 @@ export const Params = { message.maxEntries = object.maxEntries ?? 0; message.historicalEntries = object.historicalEntries ?? 0; message.bondDenom = object.bondDenom ?? ""; + message.minCommissionRate = object.minCommissionRate ?? ""; return message; }, fromAmino(object: ParamsAmino): Params { @@ -2535,15 +2565,19 @@ export const Params = { if (object.bond_denom !== undefined && object.bond_denom !== null) { message.bondDenom = object.bond_denom; } + if (object.min_commission_rate !== undefined && object.min_commission_rate !== null) { + message.minCommissionRate = object.min_commission_rate; + } return message; }, toAmino(message: Params): ParamsAmino { const obj: any = {}; - obj.unbonding_time = message.unbondingTime ? Duration.toAmino(message.unbondingTime) : undefined; + obj.unbonding_time = message.unbondingTime ? Duration.toAmino(message.unbondingTime) : Duration.toAmino(Duration.fromPartial({})); obj.max_validators = message.maxValidators === 0 ? undefined : message.maxValidators; obj.max_entries = message.maxEntries === 0 ? undefined : message.maxEntries; obj.historical_entries = message.historicalEntries === 0 ? undefined : message.historicalEntries; obj.bond_denom = message.bondDenom === "" ? undefined : message.bondDenom; + obj.min_commission_rate = message.minCommissionRate ?? ""; return obj; }, fromAminoMsg(object: ParamsAminoMsg): Params { @@ -2551,7 +2585,7 @@ export const Params = { }, toAminoMsg(message: Params): ParamsAminoMsg { return { - type: "cosmos-sdk/Params", + type: "cosmos-sdk/x/staking/Params", value: Params.toAmino(message) }; }, @@ -2623,8 +2657,8 @@ export const DelegationResponse = { }, toAmino(message: DelegationResponse): DelegationResponseAmino { const obj: any = {}; - obj.delegation = message.delegation ? Delegation.toAmino(message.delegation) : undefined; - obj.balance = message.balance ? Coin.toAmino(message.balance) : undefined; + obj.delegation = message.delegation ? Delegation.toAmino(message.delegation) : Delegation.toAmino(Delegation.fromPartial({})); + obj.balance = message.balance ? Coin.toAmino(message.balance) : Coin.toAmino(Coin.fromPartial({})); return obj; }, fromAminoMsg(object: DelegationResponseAminoMsg): DelegationResponse { @@ -2704,7 +2738,7 @@ export const RedelegationEntryResponse = { }, toAmino(message: RedelegationEntryResponse): RedelegationEntryResponseAmino { const obj: any = {}; - obj.redelegation_entry = message.redelegationEntry ? RedelegationEntry.toAmino(message.redelegationEntry) : undefined; + obj.redelegation_entry = message.redelegationEntry ? RedelegationEntry.toAmino(message.redelegationEntry) : RedelegationEntry.toAmino(RedelegationEntry.fromPartial({})); obj.balance = message.balance === "" ? undefined : message.balance; return obj; }, @@ -2783,7 +2817,7 @@ export const RedelegationResponse = { }, toAmino(message: RedelegationResponse): RedelegationResponseAmino { const obj: any = {}; - obj.redelegation = message.redelegation ? Redelegation.toAmino(message.redelegation) : undefined; + obj.redelegation = message.redelegation ? Redelegation.toAmino(message.redelegation) : Redelegation.toAmino(Redelegation.fromPartial({})); if (message.entries) { obj.entries = message.entries.map(e => e ? RedelegationEntryResponse.toAmino(e) : undefined); } else { diff --git a/src/codegen/cosmos/staking/v1beta1/tx.amino.ts b/src/codegen/cosmos/staking/v1beta1/tx.amino.ts index 0620696..ab2985b 100644 --- a/src/codegen/cosmos/staking/v1beta1/tx.amino.ts +++ b/src/codegen/cosmos/staking/v1beta1/tx.amino.ts @@ -1,4 +1,4 @@ -import { MsgCreateValidator, MsgEditValidator, MsgDelegate, MsgBeginRedelegate, MsgUndelegate } from "./tx"; +import { MsgCreateValidator, MsgEditValidator, MsgDelegate, MsgBeginRedelegate, MsgUndelegate, MsgCancelUnbondingDelegation, MsgUpdateParams } from "./tx"; export const AminoConverter = { "/cosmos.staking.v1beta1.MsgCreateValidator": { aminoType: "cosmos-sdk/MsgCreateValidator", @@ -24,5 +24,15 @@ export const AminoConverter = { aminoType: "cosmos-sdk/MsgUndelegate", toAmino: MsgUndelegate.toAmino, fromAmino: MsgUndelegate.fromAmino + }, + "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation": { + aminoType: "cosmos-sdk/MsgCancelUnbondingDelegation", + toAmino: MsgCancelUnbondingDelegation.toAmino, + fromAmino: MsgCancelUnbondingDelegation.fromAmino + }, + "/cosmos.staking.v1beta1.MsgUpdateParams": { + aminoType: "cosmos-sdk/x/staking/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino } }; \ No newline at end of file diff --git a/src/codegen/cosmos/staking/v1beta1/tx.registry.ts b/src/codegen/cosmos/staking/v1beta1/tx.registry.ts index ba13911..f71ec50 100644 --- a/src/codegen/cosmos/staking/v1beta1/tx.registry.ts +++ b/src/codegen/cosmos/staking/v1beta1/tx.registry.ts @@ -1,6 +1,6 @@ import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgCreateValidator, MsgEditValidator, MsgDelegate, MsgBeginRedelegate, MsgUndelegate } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.staking.v1beta1.MsgCreateValidator", MsgCreateValidator], ["/cosmos.staking.v1beta1.MsgEditValidator", MsgEditValidator], ["/cosmos.staking.v1beta1.MsgDelegate", MsgDelegate], ["/cosmos.staking.v1beta1.MsgBeginRedelegate", MsgBeginRedelegate], ["/cosmos.staking.v1beta1.MsgUndelegate", MsgUndelegate]]; +import { MsgCreateValidator, MsgEditValidator, MsgDelegate, MsgBeginRedelegate, MsgUndelegate, MsgCancelUnbondingDelegation, MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.staking.v1beta1.MsgCreateValidator", MsgCreateValidator], ["/cosmos.staking.v1beta1.MsgEditValidator", MsgEditValidator], ["/cosmos.staking.v1beta1.MsgDelegate", MsgDelegate], ["/cosmos.staking.v1beta1.MsgBeginRedelegate", MsgBeginRedelegate], ["/cosmos.staking.v1beta1.MsgUndelegate", MsgUndelegate], ["/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", MsgCancelUnbondingDelegation], ["/cosmos.staking.v1beta1.MsgUpdateParams", MsgUpdateParams]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -37,6 +37,18 @@ export const MessageComposer = { typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", value: MsgUndelegate.encode(value).finish() }; + }, + cancelUnbondingDelegation(value: MsgCancelUnbondingDelegation) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", + value: MsgCancelUnbondingDelegation.encode(value).finish() + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; } }, withTypeUrl: { @@ -69,6 +81,18 @@ export const MessageComposer = { typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", value }; + }, + cancelUnbondingDelegation(value: MsgCancelUnbondingDelegation) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", + value + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParams", + value + }; } }, fromPartial: { @@ -101,6 +125,18 @@ export const MessageComposer = { typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate", value: MsgUndelegate.fromPartial(value) }; + }, + cancelUnbondingDelegation(value: MsgCancelUnbondingDelegation) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", + value: MsgCancelUnbondingDelegation.fromPartial(value) + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/src/codegen/cosmos/staking/v1beta1/tx.rpc.msg.ts b/src/codegen/cosmos/staking/v1beta1/tx.rpc.msg.ts index bc68ae5..f7d4061 100644 --- a/src/codegen/cosmos/staking/v1beta1/tx.rpc.msg.ts +++ b/src/codegen/cosmos/staking/v1beta1/tx.rpc.msg.ts @@ -1,6 +1,6 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; -import { MsgCreateValidator, MsgCreateValidatorResponse, MsgEditValidator, MsgEditValidatorResponse, MsgDelegate, MsgDelegateResponse, MsgBeginRedelegate, MsgBeginRedelegateResponse, MsgUndelegate, MsgUndelegateResponse } from "./tx"; +import { MsgCreateValidator, MsgCreateValidatorResponse, MsgEditValidator, MsgEditValidatorResponse, MsgDelegate, MsgDelegateResponse, MsgBeginRedelegate, MsgBeginRedelegateResponse, MsgUndelegate, MsgUndelegateResponse, MsgCancelUnbondingDelegation, MsgCancelUnbondingDelegationResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; /** Msg defines the staking Msg service. */ export interface Msg { /** CreateValidator defines a method for creating a new validator. */ @@ -22,6 +22,19 @@ export interface Msg { * delegate and a validator. */ undelegate(request: MsgUndelegate): Promise; + /** + * CancelUnbondingDelegation defines a method for performing canceling the unbonding delegation + * and delegate back to previous validator. + * + * Since: cosmos-sdk 0.46 + */ + cancelUnbondingDelegation(request: MsgCancelUnbondingDelegation): Promise; + /** + * UpdateParams defines an operation for updating the x/staking module + * parameters. + * Since: cosmos-sdk 0.47 + */ + updateParams(request: MsgUpdateParams): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -32,6 +45,8 @@ export class MsgClientImpl implements Msg { this.delegate = this.delegate.bind(this); this.beginRedelegate = this.beginRedelegate.bind(this); this.undelegate = this.undelegate.bind(this); + this.cancelUnbondingDelegation = this.cancelUnbondingDelegation.bind(this); + this.updateParams = this.updateParams.bind(this); } createValidator(request: MsgCreateValidator): Promise { const data = MsgCreateValidator.encode(request).finish(); @@ -58,4 +73,14 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "Undelegate", data); return promise.then(data => MsgUndelegateResponse.decode(new BinaryReader(data))); } + cancelUnbondingDelegation(request: MsgCancelUnbondingDelegation): Promise { + const data = MsgCancelUnbondingDelegation.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "CancelUnbondingDelegation", data); + return promise.then(data => MsgCancelUnbondingDelegationResponse.decode(new BinaryReader(data))); + } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("cosmos.staking.v1beta1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } } \ No newline at end of file diff --git a/src/codegen/cosmos/staking/v1beta1/tx.ts b/src/codegen/cosmos/staking/v1beta1/tx.ts index f00da76..60ee566 100644 --- a/src/codegen/cosmos/staking/v1beta1/tx.ts +++ b/src/codegen/cosmos/staking/v1beta1/tx.ts @@ -1,4 +1,4 @@ -import { Description, DescriptionAmino, DescriptionSDKType, CommissionRates, CommissionRatesAmino, CommissionRatesSDKType } from "./staking"; +import { Description, DescriptionAmino, DescriptionSDKType, CommissionRates, CommissionRatesAmino, CommissionRatesSDKType, Params, ParamsAmino, ParamsSDKType } from "./staking"; import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; import { Timestamp } from "../../../google/protobuf/timestamp"; @@ -11,6 +11,12 @@ export interface MsgCreateValidator { description: Description; commission: CommissionRates; minSelfDelegation: string; + /** + * Deprecated: Use of Delegator Address in MsgCreateValidator is deprecated. + * The validator address bytes and delegator address bytes refer to the same account while creating validator (defer + * only in bech32 notation). + */ + /** @deprecated */ delegatorAddress: string; validatorAddress: string; pubkey?: Any; @@ -22,13 +28,19 @@ export interface MsgCreateValidatorProtoMsg { } /** MsgCreateValidator defines a SDK message for creating a new validator. */ export interface MsgCreateValidatorAmino { - description?: DescriptionAmino; - commission?: CommissionRatesAmino; - min_self_delegation?: string; + description: DescriptionAmino; + commission: CommissionRatesAmino; + min_self_delegation: string; + /** + * Deprecated: Use of Delegator Address in MsgCreateValidator is deprecated. + * The validator address bytes and delegator address bytes refer to the same account while creating validator (defer + * only in bech32 notation). + */ + /** @deprecated */ delegator_address?: string; validator_address?: string; pubkey?: AnyAmino; - value?: CoinAmino; + value: CoinAmino; } export interface MsgCreateValidatorAminoMsg { type: "cosmos-sdk/MsgCreateValidator"; @@ -39,6 +51,7 @@ export interface MsgCreateValidatorSDKType { description: DescriptionSDKType; commission: CommissionRatesSDKType; min_self_delegation: string; + /** @deprecated */ delegator_address: string; validator_address: string; pubkey?: AnySDKType; @@ -77,7 +90,7 @@ export interface MsgEditValidatorProtoMsg { } /** MsgEditValidator defines a SDK message for editing an existing validator. */ export interface MsgEditValidatorAmino { - description?: DescriptionAmino; + description: DescriptionAmino; validator_address?: string; /** * We pass a reference to the new commission rate and min self delegation as @@ -133,7 +146,7 @@ export interface MsgDelegateProtoMsg { export interface MsgDelegateAmino { delegator_address?: string; validator_address?: string; - amount?: CoinAmino; + amount: CoinAmino; } export interface MsgDelegateAminoMsg { type: "cosmos-sdk/MsgDelegate"; @@ -184,7 +197,7 @@ export interface MsgBeginRedelegateAmino { delegator_address?: string; validator_src_address?: string; validator_dst_address?: string; - amount?: CoinAmino; + amount: CoinAmino; } export interface MsgBeginRedelegateAminoMsg { type: "cosmos-sdk/MsgBeginRedelegate"; @@ -210,7 +223,7 @@ export interface MsgBeginRedelegateResponseProtoMsg { } /** MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. */ export interface MsgBeginRedelegateResponseAmino { - completion_time?: string; + completion_time: string; } export interface MsgBeginRedelegateResponseAminoMsg { type: "cosmos-sdk/MsgBeginRedelegateResponse"; @@ -240,7 +253,7 @@ export interface MsgUndelegateProtoMsg { export interface MsgUndelegateAmino { delegator_address?: string; validator_address?: string; - amount?: CoinAmino; + amount: CoinAmino; } export interface MsgUndelegateAminoMsg { type: "cosmos-sdk/MsgUndelegate"; @@ -258,6 +271,12 @@ export interface MsgUndelegateSDKType { /** MsgUndelegateResponse defines the Msg/Undelegate response type. */ export interface MsgUndelegateResponse { completionTime: Date; + /** + * amount returns the amount of undelegated coins + * + * Since: cosmos-sdk 0.50 + */ + amount: Coin; } export interface MsgUndelegateResponseProtoMsg { typeUrl: "/cosmos.staking.v1beta1.MsgUndelegateResponse"; @@ -265,7 +284,13 @@ export interface MsgUndelegateResponseProtoMsg { } /** MsgUndelegateResponse defines the Msg/Undelegate response type. */ export interface MsgUndelegateResponseAmino { - completion_time?: string; + completion_time: string; + /** + * amount returns the amount of undelegated coins + * + * Since: cosmos-sdk 0.50 + */ + amount: CoinAmino; } export interface MsgUndelegateResponseAminoMsg { type: "cosmos-sdk/MsgUndelegateResponse"; @@ -274,7 +299,155 @@ export interface MsgUndelegateResponseAminoMsg { /** MsgUndelegateResponse defines the Msg/Undelegate response type. */ export interface MsgUndelegateResponseSDKType { completion_time: Date; + amount: CoinSDKType; } +/** + * MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUnbondingDelegation { + delegatorAddress: string; + validatorAddress: string; + /** amount is always less than or equal to unbonding delegation entry balance */ + amount: Coin; + /** creation_height is the height which the unbonding took place. */ + creationHeight: bigint; +} +export interface MsgCancelUnbondingDelegationProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation"; + value: Uint8Array; +} +/** + * MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUnbondingDelegationAmino { + delegator_address?: string; + validator_address?: string; + /** amount is always less than or equal to unbonding delegation entry balance */ + amount: CoinAmino; + /** creation_height is the height which the unbonding took place. */ + creation_height?: string; +} +export interface MsgCancelUnbondingDelegationAminoMsg { + type: "cosmos-sdk/MsgCancelUnbondingDelegation"; + value: MsgCancelUnbondingDelegationAmino; +} +/** + * MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUnbondingDelegationSDKType { + delegator_address: string; + validator_address: string; + amount: CoinSDKType; + creation_height: bigint; +} +/** + * MsgCancelUnbondingDelegationResponse + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUnbondingDelegationResponse {} +export interface MsgCancelUnbondingDelegationResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse"; + value: Uint8Array; +} +/** + * MsgCancelUnbondingDelegationResponse + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUnbondingDelegationResponseAmino {} +export interface MsgCancelUnbondingDelegationResponseAminoMsg { + type: "cosmos-sdk/MsgCancelUnbondingDelegationResponse"; + value: MsgCancelUnbondingDelegationResponseAmino; +} +/** + * MsgCancelUnbondingDelegationResponse + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUnbondingDelegationResponseSDKType {} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** + * params defines the x/staking parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParams"; + value: Uint8Array; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; + /** + * params defines the x/staking parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/x/staking/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** + * MsgUpdateParams is the Msg/UpdateParams request type. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsSDKType; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: cosmos-sdk 0.47 + */ +export interface MsgUpdateParamsResponseSDKType {} function createBaseMsgCreateValidator(): MsgCreateValidator { return { description: Description.fromPartial({}), @@ -385,13 +558,13 @@ export const MsgCreateValidator = { }, toAmino(message: MsgCreateValidator): MsgCreateValidatorAmino { const obj: any = {}; - obj.description = message.description ? Description.toAmino(message.description) : undefined; - obj.commission = message.commission ? CommissionRates.toAmino(message.commission) : undefined; - obj.min_self_delegation = message.minSelfDelegation === "" ? undefined : message.minSelfDelegation; + obj.description = message.description ? Description.toAmino(message.description) : Description.toAmino(Description.fromPartial({})); + obj.commission = message.commission ? CommissionRates.toAmino(message.commission) : CommissionRates.toAmino(CommissionRates.fromPartial({})); + obj.min_self_delegation = message.minSelfDelegation ?? ""; obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; obj.pubkey = message.pubkey ? decodePubkey(message.pubkey) : undefined; - obj.value = message.value ? Coin.toAmino(message.value) : undefined; + obj.value = message.value ? Coin.toAmino(message.value) : Coin.toAmino(Coin.fromPartial({})); return obj; }, fromAminoMsg(object: MsgCreateValidatorAminoMsg): MsgCreateValidator { @@ -549,7 +722,7 @@ export const MsgEditValidator = { }, toAmino(message: MsgEditValidator): MsgEditValidatorAmino { const obj: any = {}; - obj.description = message.description ? Description.toAmino(message.description) : undefined; + obj.description = message.description ? Description.toAmino(message.description) : Description.toAmino(Description.fromPartial({})); obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; obj.commission_rate = message.commissionRate === "" ? undefined : message.commissionRate; obj.min_self_delegation = message.minSelfDelegation === "" ? undefined : message.minSelfDelegation; @@ -701,7 +874,7 @@ export const MsgDelegate = { const obj: any = {}; obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; - obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + obj.amount = message.amount ? Coin.toAmino(message.amount) : Coin.toAmino(Coin.fromPartial({})); return obj; }, fromAminoMsg(object: MsgDelegateAminoMsg): MsgDelegate { @@ -862,7 +1035,7 @@ export const MsgBeginRedelegate = { obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; obj.validator_src_address = message.validatorSrcAddress === "" ? undefined : message.validatorSrcAddress; obj.validator_dst_address = message.validatorDstAddress === "" ? undefined : message.validatorDstAddress; - obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + obj.amount = message.amount ? Coin.toAmino(message.amount) : Coin.toAmino(Coin.fromPartial({})); return obj; }, fromAminoMsg(object: MsgBeginRedelegateAminoMsg): MsgBeginRedelegate { @@ -931,7 +1104,7 @@ export const MsgBeginRedelegateResponse = { }, toAmino(message: MsgBeginRedelegateResponse): MsgBeginRedelegateResponseAmino { const obj: any = {}; - obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : undefined; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : new Date(); return obj; }, fromAminoMsg(object: MsgBeginRedelegateResponseAminoMsg): MsgBeginRedelegateResponse { @@ -1024,7 +1197,7 @@ export const MsgUndelegate = { const obj: any = {}; obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; - obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + obj.amount = message.amount ? Coin.toAmino(message.amount) : Coin.toAmino(Coin.fromPartial({})); return obj; }, fromAminoMsg(object: MsgUndelegateAminoMsg): MsgUndelegate { @@ -1051,7 +1224,8 @@ export const MsgUndelegate = { }; function createBaseMsgUndelegateResponse(): MsgUndelegateResponse { return { - completionTime: new Date() + completionTime: new Date(), + amount: Coin.fromPartial({}) }; } export const MsgUndelegateResponse = { @@ -1060,6 +1234,9 @@ export const MsgUndelegateResponse = { if (message.completionTime !== undefined) { Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(10).fork()).ldelim(); } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): MsgUndelegateResponse { @@ -1072,6 +1249,9 @@ export const MsgUndelegateResponse = { case 1: message.completionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; + case 2: + message.amount = Coin.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -1082,6 +1262,7 @@ export const MsgUndelegateResponse = { fromPartial(object: Partial): MsgUndelegateResponse { const message = createBaseMsgUndelegateResponse(); message.completionTime = object.completionTime ?? undefined; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; return message; }, fromAmino(object: MsgUndelegateResponseAmino): MsgUndelegateResponse { @@ -1089,11 +1270,15 @@ export const MsgUndelegateResponse = { if (object.completion_time !== undefined && object.completion_time !== null) { message.completionTime = fromTimestamp(Timestamp.fromAmino(object.completion_time)); } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } return message; }, toAmino(message: MsgUndelegateResponse): MsgUndelegateResponseAmino { const obj: any = {}; - obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : undefined; + obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : new Date(); + obj.amount = message.amount ? Coin.toAmino(message.amount) : Coin.toAmino(Coin.fromPartial({})); return obj; }, fromAminoMsg(object: MsgUndelegateResponseAminoMsg): MsgUndelegateResponse { @@ -1117,4 +1302,302 @@ export const MsgUndelegateResponse = { value: MsgUndelegateResponse.encode(message).finish() }; } +}; +function createBaseMsgCancelUnbondingDelegation(): MsgCancelUnbondingDelegation { + return { + delegatorAddress: "", + validatorAddress: "", + amount: Coin.fromPartial({}), + creationHeight: BigInt(0) + }; +} +export const MsgCancelUnbondingDelegation = { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", + encode(message: MsgCancelUnbondingDelegation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.delegatorAddress !== "") { + writer.uint32(10).string(message.delegatorAddress); + } + if (message.validatorAddress !== "") { + writer.uint32(18).string(message.validatorAddress); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(26).fork()).ldelim(); + } + if (message.creationHeight !== BigInt(0)) { + writer.uint32(32).int64(message.creationHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelUnbondingDelegation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelUnbondingDelegation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.delegatorAddress = reader.string(); + break; + case 2: + message.validatorAddress = reader.string(); + break; + case 3: + message.amount = Coin.decode(reader, reader.uint32()); + break; + case 4: + message.creationHeight = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCancelUnbondingDelegation { + const message = createBaseMsgCancelUnbondingDelegation(); + message.delegatorAddress = object.delegatorAddress ?? ""; + message.validatorAddress = object.validatorAddress ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + message.creationHeight = object.creationHeight !== undefined && object.creationHeight !== null ? BigInt(object.creationHeight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgCancelUnbondingDelegationAmino): MsgCancelUnbondingDelegation { + const message = createBaseMsgCancelUnbondingDelegation(); + if (object.delegator_address !== undefined && object.delegator_address !== null) { + message.delegatorAddress = object.delegator_address; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = object.validator_address; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + if (object.creation_height !== undefined && object.creation_height !== null) { + message.creationHeight = BigInt(object.creation_height); + } + return message; + }, + toAmino(message: MsgCancelUnbondingDelegation): MsgCancelUnbondingDelegationAmino { + const obj: any = {}; + obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress; + obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress; + obj.amount = message.amount ? Coin.toAmino(message.amount) : Coin.toAmino(Coin.fromPartial({})); + obj.creation_height = message.creationHeight !== BigInt(0) ? message.creationHeight.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgCancelUnbondingDelegationAminoMsg): MsgCancelUnbondingDelegation { + return MsgCancelUnbondingDelegation.fromAmino(object.value); + }, + toAminoMsg(message: MsgCancelUnbondingDelegation): MsgCancelUnbondingDelegationAminoMsg { + return { + type: "cosmos-sdk/MsgCancelUnbondingDelegation", + value: MsgCancelUnbondingDelegation.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCancelUnbondingDelegationProtoMsg): MsgCancelUnbondingDelegation { + return MsgCancelUnbondingDelegation.decode(message.value); + }, + toProto(message: MsgCancelUnbondingDelegation): Uint8Array { + return MsgCancelUnbondingDelegation.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelUnbondingDelegation): MsgCancelUnbondingDelegationProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", + value: MsgCancelUnbondingDelegation.encode(message).finish() + }; + } +}; +function createBaseMsgCancelUnbondingDelegationResponse(): MsgCancelUnbondingDelegationResponse { + return {}; +} +export const MsgCancelUnbondingDelegationResponse = { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse", + encode(_: MsgCancelUnbondingDelegationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelUnbondingDelegationResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelUnbondingDelegationResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgCancelUnbondingDelegationResponse { + const message = createBaseMsgCancelUnbondingDelegationResponse(); + return message; + }, + fromAmino(_: MsgCancelUnbondingDelegationResponseAmino): MsgCancelUnbondingDelegationResponse { + const message = createBaseMsgCancelUnbondingDelegationResponse(); + return message; + }, + toAmino(_: MsgCancelUnbondingDelegationResponse): MsgCancelUnbondingDelegationResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCancelUnbondingDelegationResponseAminoMsg): MsgCancelUnbondingDelegationResponse { + return MsgCancelUnbondingDelegationResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCancelUnbondingDelegationResponse): MsgCancelUnbondingDelegationResponseAminoMsg { + return { + type: "cosmos-sdk/MsgCancelUnbondingDelegationResponse", + value: MsgCancelUnbondingDelegationResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCancelUnbondingDelegationResponseProtoMsg): MsgCancelUnbondingDelegationResponse { + return MsgCancelUnbondingDelegationResponse.decode(message.value); + }, + toProto(message: MsgCancelUnbondingDelegationResponse): Uint8Array { + return MsgCancelUnbondingDelegationResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelUnbondingDelegationResponse): MsgCancelUnbondingDelegationResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse", + value: MsgCancelUnbondingDelegationResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.params = message.params ? Params.toAmino(message.params) : Params.toAmino(Params.fromPartial({})); + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/x/staking/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/cosmos.staking.v1beta1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/src/codegen/cosmos/store/internal/kv/v1beta1/kv.ts b/src/codegen/cosmos/store/internal/kv/v1beta1/kv.ts new file mode 100644 index 0000000..a9338b8 --- /dev/null +++ b/src/codegen/cosmos/store/internal/kv/v1beta1/kv.ts @@ -0,0 +1,197 @@ +import { BinaryReader, BinaryWriter } from "../../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../../helpers"; +/** Pairs defines a repeated slice of Pair objects. */ +export interface Pairs { + pairs: Pair[]; +} +export interface PairsProtoMsg { + typeUrl: "/cosmos.store.internal.kv.v1beta1.Pairs"; + value: Uint8Array; +} +/** Pairs defines a repeated slice of Pair objects. */ +export interface PairsAmino { + pairs?: PairAmino[]; +} +export interface PairsAminoMsg { + type: "cosmos-sdk/Pairs"; + value: PairsAmino; +} +/** Pairs defines a repeated slice of Pair objects. */ +export interface PairsSDKType { + pairs: PairSDKType[]; +} +/** Pair defines a key/value bytes tuple. */ +export interface Pair { + key: Uint8Array; + value: Uint8Array; +} +export interface PairProtoMsg { + typeUrl: "/cosmos.store.internal.kv.v1beta1.Pair"; + value: Uint8Array; +} +/** Pair defines a key/value bytes tuple. */ +export interface PairAmino { + key?: string; + value?: string; +} +export interface PairAminoMsg { + type: "cosmos-sdk/Pair"; + value: PairAmino; +} +/** Pair defines a key/value bytes tuple. */ +export interface PairSDKType { + key: Uint8Array; + value: Uint8Array; +} +function createBasePairs(): Pairs { + return { + pairs: [] + }; +} +export const Pairs = { + typeUrl: "/cosmos.store.internal.kv.v1beta1.Pairs", + encode(message: Pairs, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.pairs) { + Pair.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Pairs { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePairs(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pairs.push(Pair.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Pairs { + const message = createBasePairs(); + message.pairs = object.pairs?.map(e => Pair.fromPartial(e)) || []; + return message; + }, + fromAmino(object: PairsAmino): Pairs { + const message = createBasePairs(); + message.pairs = object.pairs?.map(e => Pair.fromAmino(e)) || []; + return message; + }, + toAmino(message: Pairs): PairsAmino { + const obj: any = {}; + if (message.pairs) { + obj.pairs = message.pairs.map(e => e ? Pair.toAmino(e) : undefined); + } else { + obj.pairs = message.pairs; + } + return obj; + }, + fromAminoMsg(object: PairsAminoMsg): Pairs { + return Pairs.fromAmino(object.value); + }, + toAminoMsg(message: Pairs): PairsAminoMsg { + return { + type: "cosmos-sdk/Pairs", + value: Pairs.toAmino(message) + }; + }, + fromProtoMsg(message: PairsProtoMsg): Pairs { + return Pairs.decode(message.value); + }, + toProto(message: Pairs): Uint8Array { + return Pairs.encode(message).finish(); + }, + toProtoMsg(message: Pairs): PairsProtoMsg { + return { + typeUrl: "/cosmos.store.internal.kv.v1beta1.Pairs", + value: Pairs.encode(message).finish() + }; + } +}; +function createBasePair(): Pair { + return { + key: new Uint8Array(), + value: new Uint8Array() + }; +} +export const Pair = { + typeUrl: "/cosmos.store.internal.kv.v1beta1.Pair", + encode(message: Pair, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Pair { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePair(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Pair { + const message = createBasePair(); + message.key = object.key ?? new Uint8Array(); + message.value = object.value ?? new Uint8Array(); + return message; + }, + fromAmino(object: PairAmino): Pair { + const message = createBasePair(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + return message; + }, + toAmino(message: Pair): PairAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; + return obj; + }, + fromAminoMsg(object: PairAminoMsg): Pair { + return Pair.fromAmino(object.value); + }, + toAminoMsg(message: Pair): PairAminoMsg { + return { + type: "cosmos-sdk/Pair", + value: Pair.toAmino(message) + }; + }, + fromProtoMsg(message: PairProtoMsg): Pair { + return Pair.decode(message.value); + }, + toProto(message: Pair): Uint8Array { + return Pair.encode(message).finish(); + }, + toProtoMsg(message: Pair): PairProtoMsg { + return { + typeUrl: "/cosmos.store.internal.kv.v1beta1.Pair", + value: Pair.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/store/snapshots/v1/snapshot.ts b/src/codegen/cosmos/store/snapshots/v1/snapshot.ts new file mode 100644 index 0000000..890a2b5 --- /dev/null +++ b/src/codegen/cosmos/store/snapshots/v1/snapshot.ts @@ -0,0 +1,858 @@ +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** Snapshot contains Tendermint state sync snapshot info. */ +export interface Snapshot { + height: bigint; + format: number; + chunks: number; + hash: Uint8Array; + metadata: Metadata; +} +export interface SnapshotProtoMsg { + typeUrl: "/cosmos.store.snapshots.v1.Snapshot"; + value: Uint8Array; +} +/** Snapshot contains Tendermint state sync snapshot info. */ +export interface SnapshotAmino { + height?: string; + format?: number; + chunks?: number; + hash?: string; + metadata?: MetadataAmino; +} +export interface SnapshotAminoMsg { + type: "cosmos-sdk/Snapshot"; + value: SnapshotAmino; +} +/** Snapshot contains Tendermint state sync snapshot info. */ +export interface SnapshotSDKType { + height: bigint; + format: number; + chunks: number; + hash: Uint8Array; + metadata: MetadataSDKType; +} +/** Metadata contains SDK-specific snapshot metadata. */ +export interface Metadata { + /** SHA-256 chunk hashes */ + chunkHashes: Uint8Array[]; +} +export interface MetadataProtoMsg { + typeUrl: "/cosmos.store.snapshots.v1.Metadata"; + value: Uint8Array; +} +/** Metadata contains SDK-specific snapshot metadata. */ +export interface MetadataAmino { + /** SHA-256 chunk hashes */ + chunk_hashes?: string[]; +} +export interface MetadataAminoMsg { + type: "cosmos-sdk/Metadata"; + value: MetadataAmino; +} +/** Metadata contains SDK-specific snapshot metadata. */ +export interface MetadataSDKType { + chunk_hashes: Uint8Array[]; +} +/** + * SnapshotItem is an item contained in a rootmulti.Store snapshot. + * + * Since: cosmos-sdk 0.46 + */ +export interface SnapshotItem { + store?: SnapshotStoreItem; + iavl?: SnapshotIAVLItem; + extension?: SnapshotExtensionMeta; + extensionPayload?: SnapshotExtensionPayload; +} +export interface SnapshotItemProtoMsg { + typeUrl: "/cosmos.store.snapshots.v1.SnapshotItem"; + value: Uint8Array; +} +/** + * SnapshotItem is an item contained in a rootmulti.Store snapshot. + * + * Since: cosmos-sdk 0.46 + */ +export interface SnapshotItemAmino { + store?: SnapshotStoreItemAmino; + iavl?: SnapshotIAVLItemAmino; + extension?: SnapshotExtensionMetaAmino; + extension_payload?: SnapshotExtensionPayloadAmino; +} +export interface SnapshotItemAminoMsg { + type: "cosmos-sdk/SnapshotItem"; + value: SnapshotItemAmino; +} +/** + * SnapshotItem is an item contained in a rootmulti.Store snapshot. + * + * Since: cosmos-sdk 0.46 + */ +export interface SnapshotItemSDKType { + store?: SnapshotStoreItemSDKType; + iavl?: SnapshotIAVLItemSDKType; + extension?: SnapshotExtensionMetaSDKType; + extension_payload?: SnapshotExtensionPayloadSDKType; +} +/** + * SnapshotStoreItem contains metadata about a snapshotted store. + * + * Since: cosmos-sdk 0.46 + */ +export interface SnapshotStoreItem { + name: string; +} +export interface SnapshotStoreItemProtoMsg { + typeUrl: "/cosmos.store.snapshots.v1.SnapshotStoreItem"; + value: Uint8Array; +} +/** + * SnapshotStoreItem contains metadata about a snapshotted store. + * + * Since: cosmos-sdk 0.46 + */ +export interface SnapshotStoreItemAmino { + name?: string; +} +export interface SnapshotStoreItemAminoMsg { + type: "cosmos-sdk/SnapshotStoreItem"; + value: SnapshotStoreItemAmino; +} +/** + * SnapshotStoreItem contains metadata about a snapshotted store. + * + * Since: cosmos-sdk 0.46 + */ +export interface SnapshotStoreItemSDKType { + name: string; +} +/** + * SnapshotIAVLItem is an exported IAVL node. + * + * Since: cosmos-sdk 0.46 + */ +export interface SnapshotIAVLItem { + key: Uint8Array; + value: Uint8Array; + /** version is block height */ + version: bigint; + /** height is depth of the tree. */ + height: number; +} +export interface SnapshotIAVLItemProtoMsg { + typeUrl: "/cosmos.store.snapshots.v1.SnapshotIAVLItem"; + value: Uint8Array; +} +/** + * SnapshotIAVLItem is an exported IAVL node. + * + * Since: cosmos-sdk 0.46 + */ +export interface SnapshotIAVLItemAmino { + key?: string; + value?: string; + /** version is block height */ + version?: string; + /** height is depth of the tree. */ + height?: number; +} +export interface SnapshotIAVLItemAminoMsg { + type: "cosmos-sdk/SnapshotIAVLItem"; + value: SnapshotIAVLItemAmino; +} +/** + * SnapshotIAVLItem is an exported IAVL node. + * + * Since: cosmos-sdk 0.46 + */ +export interface SnapshotIAVLItemSDKType { + key: Uint8Array; + value: Uint8Array; + version: bigint; + height: number; +} +/** + * SnapshotExtensionMeta contains metadata about an external snapshotter. + * + * Since: cosmos-sdk 0.46 + */ +export interface SnapshotExtensionMeta { + name: string; + format: number; +} +export interface SnapshotExtensionMetaProtoMsg { + typeUrl: "/cosmos.store.snapshots.v1.SnapshotExtensionMeta"; + value: Uint8Array; +} +/** + * SnapshotExtensionMeta contains metadata about an external snapshotter. + * + * Since: cosmos-sdk 0.46 + */ +export interface SnapshotExtensionMetaAmino { + name?: string; + format?: number; +} +export interface SnapshotExtensionMetaAminoMsg { + type: "cosmos-sdk/SnapshotExtensionMeta"; + value: SnapshotExtensionMetaAmino; +} +/** + * SnapshotExtensionMeta contains metadata about an external snapshotter. + * + * Since: cosmos-sdk 0.46 + */ +export interface SnapshotExtensionMetaSDKType { + name: string; + format: number; +} +/** + * SnapshotExtensionPayload contains payloads of an external snapshotter. + * + * Since: cosmos-sdk 0.46 + */ +export interface SnapshotExtensionPayload { + payload: Uint8Array; +} +export interface SnapshotExtensionPayloadProtoMsg { + typeUrl: "/cosmos.store.snapshots.v1.SnapshotExtensionPayload"; + value: Uint8Array; +} +/** + * SnapshotExtensionPayload contains payloads of an external snapshotter. + * + * Since: cosmos-sdk 0.46 + */ +export interface SnapshotExtensionPayloadAmino { + payload?: string; +} +export interface SnapshotExtensionPayloadAminoMsg { + type: "cosmos-sdk/SnapshotExtensionPayload"; + value: SnapshotExtensionPayloadAmino; +} +/** + * SnapshotExtensionPayload contains payloads of an external snapshotter. + * + * Since: cosmos-sdk 0.46 + */ +export interface SnapshotExtensionPayloadSDKType { + payload: Uint8Array; +} +function createBaseSnapshot(): Snapshot { + return { + height: BigInt(0), + format: 0, + chunks: 0, + hash: new Uint8Array(), + metadata: Metadata.fromPartial({}) + }; +} +export const Snapshot = { + typeUrl: "/cosmos.store.snapshots.v1.Snapshot", + encode(message: Snapshot, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { + writer.uint32(8).uint64(message.height); + } + if (message.format !== 0) { + writer.uint32(16).uint32(message.format); + } + if (message.chunks !== 0) { + writer.uint32(24).uint32(message.chunks); + } + if (message.hash.length !== 0) { + writer.uint32(34).bytes(message.hash); + } + if (message.metadata !== undefined) { + Metadata.encode(message.metadata, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Snapshot { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSnapshot(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.uint64(); + break; + case 2: + message.format = reader.uint32(); + break; + case 3: + message.chunks = reader.uint32(); + break; + case 4: + message.hash = reader.bytes(); + break; + case 5: + message.metadata = Metadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Snapshot { + const message = createBaseSnapshot(); + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.format = object.format ?? 0; + message.chunks = object.chunks ?? 0; + message.hash = object.hash ?? new Uint8Array(); + message.metadata = object.metadata !== undefined && object.metadata !== null ? Metadata.fromPartial(object.metadata) : undefined; + return message; + }, + fromAmino(object: SnapshotAmino): Snapshot { + const message = createBaseSnapshot(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.format !== undefined && object.format !== null) { + message.format = object.format; + } + if (object.chunks !== undefined && object.chunks !== null) { + message.chunks = object.chunks; + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = Metadata.fromAmino(object.metadata); + } + return message; + }, + toAmino(message: Snapshot): SnapshotAmino { + const obj: any = {}; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.format = message.format === 0 ? undefined : message.format; + obj.chunks = message.chunks === 0 ? undefined : message.chunks; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; + obj.metadata = message.metadata ? Metadata.toAmino(message.metadata) : undefined; + return obj; + }, + fromAminoMsg(object: SnapshotAminoMsg): Snapshot { + return Snapshot.fromAmino(object.value); + }, + toAminoMsg(message: Snapshot): SnapshotAminoMsg { + return { + type: "cosmos-sdk/Snapshot", + value: Snapshot.toAmino(message) + }; + }, + fromProtoMsg(message: SnapshotProtoMsg): Snapshot { + return Snapshot.decode(message.value); + }, + toProto(message: Snapshot): Uint8Array { + return Snapshot.encode(message).finish(); + }, + toProtoMsg(message: Snapshot): SnapshotProtoMsg { + return { + typeUrl: "/cosmos.store.snapshots.v1.Snapshot", + value: Snapshot.encode(message).finish() + }; + } +}; +function createBaseMetadata(): Metadata { + return { + chunkHashes: [] + }; +} +export const Metadata = { + typeUrl: "/cosmos.store.snapshots.v1.Metadata", + encode(message: Metadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.chunkHashes) { + writer.uint32(10).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Metadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.chunkHashes.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Metadata { + const message = createBaseMetadata(); + message.chunkHashes = object.chunkHashes?.map(e => e) || []; + return message; + }, + fromAmino(object: MetadataAmino): Metadata { + const message = createBaseMetadata(); + message.chunkHashes = object.chunk_hashes?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: Metadata): MetadataAmino { + const obj: any = {}; + if (message.chunkHashes) { + obj.chunk_hashes = message.chunkHashes.map(e => base64FromBytes(e)); + } else { + obj.chunk_hashes = message.chunkHashes; + } + return obj; + }, + fromAminoMsg(object: MetadataAminoMsg): Metadata { + return Metadata.fromAmino(object.value); + }, + toAminoMsg(message: Metadata): MetadataAminoMsg { + return { + type: "cosmos-sdk/Metadata", + value: Metadata.toAmino(message) + }; + }, + fromProtoMsg(message: MetadataProtoMsg): Metadata { + return Metadata.decode(message.value); + }, + toProto(message: Metadata): Uint8Array { + return Metadata.encode(message).finish(); + }, + toProtoMsg(message: Metadata): MetadataProtoMsg { + return { + typeUrl: "/cosmos.store.snapshots.v1.Metadata", + value: Metadata.encode(message).finish() + }; + } +}; +function createBaseSnapshotItem(): SnapshotItem { + return { + store: undefined, + iavl: undefined, + extension: undefined, + extensionPayload: undefined + }; +} +export const SnapshotItem = { + typeUrl: "/cosmos.store.snapshots.v1.SnapshotItem", + encode(message: SnapshotItem, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.store !== undefined) { + SnapshotStoreItem.encode(message.store, writer.uint32(10).fork()).ldelim(); + } + if (message.iavl !== undefined) { + SnapshotIAVLItem.encode(message.iavl, writer.uint32(18).fork()).ldelim(); + } + if (message.extension !== undefined) { + SnapshotExtensionMeta.encode(message.extension, writer.uint32(26).fork()).ldelim(); + } + if (message.extensionPayload !== undefined) { + SnapshotExtensionPayload.encode(message.extensionPayload, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SnapshotItem { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSnapshotItem(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.store = SnapshotStoreItem.decode(reader, reader.uint32()); + break; + case 2: + message.iavl = SnapshotIAVLItem.decode(reader, reader.uint32()); + break; + case 3: + message.extension = SnapshotExtensionMeta.decode(reader, reader.uint32()); + break; + case 4: + message.extensionPayload = SnapshotExtensionPayload.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SnapshotItem { + const message = createBaseSnapshotItem(); + message.store = object.store !== undefined && object.store !== null ? SnapshotStoreItem.fromPartial(object.store) : undefined; + message.iavl = object.iavl !== undefined && object.iavl !== null ? SnapshotIAVLItem.fromPartial(object.iavl) : undefined; + message.extension = object.extension !== undefined && object.extension !== null ? SnapshotExtensionMeta.fromPartial(object.extension) : undefined; + message.extensionPayload = object.extensionPayload !== undefined && object.extensionPayload !== null ? SnapshotExtensionPayload.fromPartial(object.extensionPayload) : undefined; + return message; + }, + fromAmino(object: SnapshotItemAmino): SnapshotItem { + const message = createBaseSnapshotItem(); + if (object.store !== undefined && object.store !== null) { + message.store = SnapshotStoreItem.fromAmino(object.store); + } + if (object.iavl !== undefined && object.iavl !== null) { + message.iavl = SnapshotIAVLItem.fromAmino(object.iavl); + } + if (object.extension !== undefined && object.extension !== null) { + message.extension = SnapshotExtensionMeta.fromAmino(object.extension); + } + if (object.extension_payload !== undefined && object.extension_payload !== null) { + message.extensionPayload = SnapshotExtensionPayload.fromAmino(object.extension_payload); + } + return message; + }, + toAmino(message: SnapshotItem): SnapshotItemAmino { + const obj: any = {}; + obj.store = message.store ? SnapshotStoreItem.toAmino(message.store) : undefined; + obj.iavl = message.iavl ? SnapshotIAVLItem.toAmino(message.iavl) : undefined; + obj.extension = message.extension ? SnapshotExtensionMeta.toAmino(message.extension) : undefined; + obj.extension_payload = message.extensionPayload ? SnapshotExtensionPayload.toAmino(message.extensionPayload) : undefined; + return obj; + }, + fromAminoMsg(object: SnapshotItemAminoMsg): SnapshotItem { + return SnapshotItem.fromAmino(object.value); + }, + toAminoMsg(message: SnapshotItem): SnapshotItemAminoMsg { + return { + type: "cosmos-sdk/SnapshotItem", + value: SnapshotItem.toAmino(message) + }; + }, + fromProtoMsg(message: SnapshotItemProtoMsg): SnapshotItem { + return SnapshotItem.decode(message.value); + }, + toProto(message: SnapshotItem): Uint8Array { + return SnapshotItem.encode(message).finish(); + }, + toProtoMsg(message: SnapshotItem): SnapshotItemProtoMsg { + return { + typeUrl: "/cosmos.store.snapshots.v1.SnapshotItem", + value: SnapshotItem.encode(message).finish() + }; + } +}; +function createBaseSnapshotStoreItem(): SnapshotStoreItem { + return { + name: "" + }; +} +export const SnapshotStoreItem = { + typeUrl: "/cosmos.store.snapshots.v1.SnapshotStoreItem", + encode(message: SnapshotStoreItem, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SnapshotStoreItem { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSnapshotStoreItem(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SnapshotStoreItem { + const message = createBaseSnapshotStoreItem(); + message.name = object.name ?? ""; + return message; + }, + fromAmino(object: SnapshotStoreItemAmino): SnapshotStoreItem { + const message = createBaseSnapshotStoreItem(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + return message; + }, + toAmino(message: SnapshotStoreItem): SnapshotStoreItemAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + return obj; + }, + fromAminoMsg(object: SnapshotStoreItemAminoMsg): SnapshotStoreItem { + return SnapshotStoreItem.fromAmino(object.value); + }, + toAminoMsg(message: SnapshotStoreItem): SnapshotStoreItemAminoMsg { + return { + type: "cosmos-sdk/SnapshotStoreItem", + value: SnapshotStoreItem.toAmino(message) + }; + }, + fromProtoMsg(message: SnapshotStoreItemProtoMsg): SnapshotStoreItem { + return SnapshotStoreItem.decode(message.value); + }, + toProto(message: SnapshotStoreItem): Uint8Array { + return SnapshotStoreItem.encode(message).finish(); + }, + toProtoMsg(message: SnapshotStoreItem): SnapshotStoreItemProtoMsg { + return { + typeUrl: "/cosmos.store.snapshots.v1.SnapshotStoreItem", + value: SnapshotStoreItem.encode(message).finish() + }; + } +}; +function createBaseSnapshotIAVLItem(): SnapshotIAVLItem { + return { + key: new Uint8Array(), + value: new Uint8Array(), + version: BigInt(0), + height: 0 + }; +} +export const SnapshotIAVLItem = { + typeUrl: "/cosmos.store.snapshots.v1.SnapshotIAVLItem", + encode(message: SnapshotIAVLItem, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.key.length !== 0) { + writer.uint32(10).bytes(message.key); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + if (message.version !== BigInt(0)) { + writer.uint32(24).int64(message.version); + } + if (message.height !== 0) { + writer.uint32(32).int32(message.height); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SnapshotIAVLItem { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSnapshotIAVLItem(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = reader.bytes(); + break; + case 3: + message.version = reader.int64(); + break; + case 4: + message.height = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SnapshotIAVLItem { + const message = createBaseSnapshotIAVLItem(); + message.key = object.key ?? new Uint8Array(); + message.value = object.value ?? new Uint8Array(); + message.version = object.version !== undefined && object.version !== null ? BigInt(object.version.toString()) : BigInt(0); + message.height = object.height ?? 0; + return message; + }, + fromAmino(object: SnapshotIAVLItemAmino): SnapshotIAVLItem { + const message = createBaseSnapshotIAVLItem(); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + if (object.version !== undefined && object.version !== null) { + message.version = BigInt(object.version); + } + if (object.height !== undefined && object.height !== null) { + message.height = object.height; + } + return message; + }, + toAmino(message: SnapshotIAVLItem): SnapshotIAVLItemAmino { + const obj: any = {}; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; + obj.version = message.version !== BigInt(0) ? message.version.toString() : undefined; + obj.height = message.height === 0 ? undefined : message.height; + return obj; + }, + fromAminoMsg(object: SnapshotIAVLItemAminoMsg): SnapshotIAVLItem { + return SnapshotIAVLItem.fromAmino(object.value); + }, + toAminoMsg(message: SnapshotIAVLItem): SnapshotIAVLItemAminoMsg { + return { + type: "cosmos-sdk/SnapshotIAVLItem", + value: SnapshotIAVLItem.toAmino(message) + }; + }, + fromProtoMsg(message: SnapshotIAVLItemProtoMsg): SnapshotIAVLItem { + return SnapshotIAVLItem.decode(message.value); + }, + toProto(message: SnapshotIAVLItem): Uint8Array { + return SnapshotIAVLItem.encode(message).finish(); + }, + toProtoMsg(message: SnapshotIAVLItem): SnapshotIAVLItemProtoMsg { + return { + typeUrl: "/cosmos.store.snapshots.v1.SnapshotIAVLItem", + value: SnapshotIAVLItem.encode(message).finish() + }; + } +}; +function createBaseSnapshotExtensionMeta(): SnapshotExtensionMeta { + return { + name: "", + format: 0 + }; +} +export const SnapshotExtensionMeta = { + typeUrl: "/cosmos.store.snapshots.v1.SnapshotExtensionMeta", + encode(message: SnapshotExtensionMeta, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.format !== 0) { + writer.uint32(16).uint32(message.format); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SnapshotExtensionMeta { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSnapshotExtensionMeta(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.format = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SnapshotExtensionMeta { + const message = createBaseSnapshotExtensionMeta(); + message.name = object.name ?? ""; + message.format = object.format ?? 0; + return message; + }, + fromAmino(object: SnapshotExtensionMetaAmino): SnapshotExtensionMeta { + const message = createBaseSnapshotExtensionMeta(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.format !== undefined && object.format !== null) { + message.format = object.format; + } + return message; + }, + toAmino(message: SnapshotExtensionMeta): SnapshotExtensionMetaAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.format = message.format === 0 ? undefined : message.format; + return obj; + }, + fromAminoMsg(object: SnapshotExtensionMetaAminoMsg): SnapshotExtensionMeta { + return SnapshotExtensionMeta.fromAmino(object.value); + }, + toAminoMsg(message: SnapshotExtensionMeta): SnapshotExtensionMetaAminoMsg { + return { + type: "cosmos-sdk/SnapshotExtensionMeta", + value: SnapshotExtensionMeta.toAmino(message) + }; + }, + fromProtoMsg(message: SnapshotExtensionMetaProtoMsg): SnapshotExtensionMeta { + return SnapshotExtensionMeta.decode(message.value); + }, + toProto(message: SnapshotExtensionMeta): Uint8Array { + return SnapshotExtensionMeta.encode(message).finish(); + }, + toProtoMsg(message: SnapshotExtensionMeta): SnapshotExtensionMetaProtoMsg { + return { + typeUrl: "/cosmos.store.snapshots.v1.SnapshotExtensionMeta", + value: SnapshotExtensionMeta.encode(message).finish() + }; + } +}; +function createBaseSnapshotExtensionPayload(): SnapshotExtensionPayload { + return { + payload: new Uint8Array() + }; +} +export const SnapshotExtensionPayload = { + typeUrl: "/cosmos.store.snapshots.v1.SnapshotExtensionPayload", + encode(message: SnapshotExtensionPayload, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.payload.length !== 0) { + writer.uint32(10).bytes(message.payload); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SnapshotExtensionPayload { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSnapshotExtensionPayload(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.payload = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SnapshotExtensionPayload { + const message = createBaseSnapshotExtensionPayload(); + message.payload = object.payload ?? new Uint8Array(); + return message; + }, + fromAmino(object: SnapshotExtensionPayloadAmino): SnapshotExtensionPayload { + const message = createBaseSnapshotExtensionPayload(); + if (object.payload !== undefined && object.payload !== null) { + message.payload = bytesFromBase64(object.payload); + } + return message; + }, + toAmino(message: SnapshotExtensionPayload): SnapshotExtensionPayloadAmino { + const obj: any = {}; + obj.payload = message.payload ? base64FromBytes(message.payload) : undefined; + return obj; + }, + fromAminoMsg(object: SnapshotExtensionPayloadAminoMsg): SnapshotExtensionPayload { + return SnapshotExtensionPayload.fromAmino(object.value); + }, + toAminoMsg(message: SnapshotExtensionPayload): SnapshotExtensionPayloadAminoMsg { + return { + type: "cosmos-sdk/SnapshotExtensionPayload", + value: SnapshotExtensionPayload.toAmino(message) + }; + }, + fromProtoMsg(message: SnapshotExtensionPayloadProtoMsg): SnapshotExtensionPayload { + return SnapshotExtensionPayload.decode(message.value); + }, + toProto(message: SnapshotExtensionPayload): Uint8Array { + return SnapshotExtensionPayload.encode(message).finish(); + }, + toProtoMsg(message: SnapshotExtensionPayload): SnapshotExtensionPayloadProtoMsg { + return { + typeUrl: "/cosmos.store.snapshots.v1.SnapshotExtensionPayload", + value: SnapshotExtensionPayload.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/store/streaming/abci/grpc.ts b/src/codegen/cosmos/store/streaming/abci/grpc.ts new file mode 100644 index 0000000..c9aa2cb --- /dev/null +++ b/src/codegen/cosmos/store/streaming/abci/grpc.ts @@ -0,0 +1,370 @@ +import { RequestFinalizeBlock, RequestFinalizeBlockAmino, RequestFinalizeBlockSDKType, ResponseFinalizeBlock, ResponseFinalizeBlockAmino, ResponseFinalizeBlockSDKType, ResponseCommit, ResponseCommitAmino, ResponseCommitSDKType } from "../../../../tendermint/abci/types"; +import { StoreKVPair, StoreKVPairAmino, StoreKVPairSDKType } from "../../v1beta1/listening"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +/** ListenEndBlockRequest is the request type for the ListenEndBlock RPC method */ +export interface ListenFinalizeBlockRequest { + req?: RequestFinalizeBlock; + res?: ResponseFinalizeBlock; +} +export interface ListenFinalizeBlockRequestProtoMsg { + typeUrl: "/cosmos.store.streaming.abci.ListenFinalizeBlockRequest"; + value: Uint8Array; +} +/** ListenEndBlockRequest is the request type for the ListenEndBlock RPC method */ +export interface ListenFinalizeBlockRequestAmino { + req?: RequestFinalizeBlockAmino; + res?: ResponseFinalizeBlockAmino; +} +export interface ListenFinalizeBlockRequestAminoMsg { + type: "cosmos-sdk/ListenFinalizeBlockRequest"; + value: ListenFinalizeBlockRequestAmino; +} +/** ListenEndBlockRequest is the request type for the ListenEndBlock RPC method */ +export interface ListenFinalizeBlockRequestSDKType { + req?: RequestFinalizeBlockSDKType; + res?: ResponseFinalizeBlockSDKType; +} +/** ListenEndBlockResponse is the response type for the ListenEndBlock RPC method */ +export interface ListenFinalizeBlockResponse {} +export interface ListenFinalizeBlockResponseProtoMsg { + typeUrl: "/cosmos.store.streaming.abci.ListenFinalizeBlockResponse"; + value: Uint8Array; +} +/** ListenEndBlockResponse is the response type for the ListenEndBlock RPC method */ +export interface ListenFinalizeBlockResponseAmino {} +export interface ListenFinalizeBlockResponseAminoMsg { + type: "cosmos-sdk/ListenFinalizeBlockResponse"; + value: ListenFinalizeBlockResponseAmino; +} +/** ListenEndBlockResponse is the response type for the ListenEndBlock RPC method */ +export interface ListenFinalizeBlockResponseSDKType {} +/** ListenCommitRequest is the request type for the ListenCommit RPC method */ +export interface ListenCommitRequest { + /** explicitly pass in block height as ResponseCommit does not contain this info */ + blockHeight: bigint; + res?: ResponseCommit; + changeSet: StoreKVPair[]; +} +export interface ListenCommitRequestProtoMsg { + typeUrl: "/cosmos.store.streaming.abci.ListenCommitRequest"; + value: Uint8Array; +} +/** ListenCommitRequest is the request type for the ListenCommit RPC method */ +export interface ListenCommitRequestAmino { + /** explicitly pass in block height as ResponseCommit does not contain this info */ + block_height?: string; + res?: ResponseCommitAmino; + change_set?: StoreKVPairAmino[]; +} +export interface ListenCommitRequestAminoMsg { + type: "cosmos-sdk/ListenCommitRequest"; + value: ListenCommitRequestAmino; +} +/** ListenCommitRequest is the request type for the ListenCommit RPC method */ +export interface ListenCommitRequestSDKType { + block_height: bigint; + res?: ResponseCommitSDKType; + change_set: StoreKVPairSDKType[]; +} +/** ListenCommitResponse is the response type for the ListenCommit RPC method */ +export interface ListenCommitResponse {} +export interface ListenCommitResponseProtoMsg { + typeUrl: "/cosmos.store.streaming.abci.ListenCommitResponse"; + value: Uint8Array; +} +/** ListenCommitResponse is the response type for the ListenCommit RPC method */ +export interface ListenCommitResponseAmino {} +export interface ListenCommitResponseAminoMsg { + type: "cosmos-sdk/ListenCommitResponse"; + value: ListenCommitResponseAmino; +} +/** ListenCommitResponse is the response type for the ListenCommit RPC method */ +export interface ListenCommitResponseSDKType {} +function createBaseListenFinalizeBlockRequest(): ListenFinalizeBlockRequest { + return { + req: undefined, + res: undefined + }; +} +export const ListenFinalizeBlockRequest = { + typeUrl: "/cosmos.store.streaming.abci.ListenFinalizeBlockRequest", + encode(message: ListenFinalizeBlockRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.req !== undefined) { + RequestFinalizeBlock.encode(message.req, writer.uint32(10).fork()).ldelim(); + } + if (message.res !== undefined) { + ResponseFinalizeBlock.encode(message.res, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ListenFinalizeBlockRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListenFinalizeBlockRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.req = RequestFinalizeBlock.decode(reader, reader.uint32()); + break; + case 2: + message.res = ResponseFinalizeBlock.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ListenFinalizeBlockRequest { + const message = createBaseListenFinalizeBlockRequest(); + message.req = object.req !== undefined && object.req !== null ? RequestFinalizeBlock.fromPartial(object.req) : undefined; + message.res = object.res !== undefined && object.res !== null ? ResponseFinalizeBlock.fromPartial(object.res) : undefined; + return message; + }, + fromAmino(object: ListenFinalizeBlockRequestAmino): ListenFinalizeBlockRequest { + const message = createBaseListenFinalizeBlockRequest(); + if (object.req !== undefined && object.req !== null) { + message.req = RequestFinalizeBlock.fromAmino(object.req); + } + if (object.res !== undefined && object.res !== null) { + message.res = ResponseFinalizeBlock.fromAmino(object.res); + } + return message; + }, + toAmino(message: ListenFinalizeBlockRequest): ListenFinalizeBlockRequestAmino { + const obj: any = {}; + obj.req = message.req ? RequestFinalizeBlock.toAmino(message.req) : undefined; + obj.res = message.res ? ResponseFinalizeBlock.toAmino(message.res) : undefined; + return obj; + }, + fromAminoMsg(object: ListenFinalizeBlockRequestAminoMsg): ListenFinalizeBlockRequest { + return ListenFinalizeBlockRequest.fromAmino(object.value); + }, + toAminoMsg(message: ListenFinalizeBlockRequest): ListenFinalizeBlockRequestAminoMsg { + return { + type: "cosmos-sdk/ListenFinalizeBlockRequest", + value: ListenFinalizeBlockRequest.toAmino(message) + }; + }, + fromProtoMsg(message: ListenFinalizeBlockRequestProtoMsg): ListenFinalizeBlockRequest { + return ListenFinalizeBlockRequest.decode(message.value); + }, + toProto(message: ListenFinalizeBlockRequest): Uint8Array { + return ListenFinalizeBlockRequest.encode(message).finish(); + }, + toProtoMsg(message: ListenFinalizeBlockRequest): ListenFinalizeBlockRequestProtoMsg { + return { + typeUrl: "/cosmos.store.streaming.abci.ListenFinalizeBlockRequest", + value: ListenFinalizeBlockRequest.encode(message).finish() + }; + } +}; +function createBaseListenFinalizeBlockResponse(): ListenFinalizeBlockResponse { + return {}; +} +export const ListenFinalizeBlockResponse = { + typeUrl: "/cosmos.store.streaming.abci.ListenFinalizeBlockResponse", + encode(_: ListenFinalizeBlockResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ListenFinalizeBlockResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListenFinalizeBlockResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): ListenFinalizeBlockResponse { + const message = createBaseListenFinalizeBlockResponse(); + return message; + }, + fromAmino(_: ListenFinalizeBlockResponseAmino): ListenFinalizeBlockResponse { + const message = createBaseListenFinalizeBlockResponse(); + return message; + }, + toAmino(_: ListenFinalizeBlockResponse): ListenFinalizeBlockResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: ListenFinalizeBlockResponseAminoMsg): ListenFinalizeBlockResponse { + return ListenFinalizeBlockResponse.fromAmino(object.value); + }, + toAminoMsg(message: ListenFinalizeBlockResponse): ListenFinalizeBlockResponseAminoMsg { + return { + type: "cosmos-sdk/ListenFinalizeBlockResponse", + value: ListenFinalizeBlockResponse.toAmino(message) + }; + }, + fromProtoMsg(message: ListenFinalizeBlockResponseProtoMsg): ListenFinalizeBlockResponse { + return ListenFinalizeBlockResponse.decode(message.value); + }, + toProto(message: ListenFinalizeBlockResponse): Uint8Array { + return ListenFinalizeBlockResponse.encode(message).finish(); + }, + toProtoMsg(message: ListenFinalizeBlockResponse): ListenFinalizeBlockResponseProtoMsg { + return { + typeUrl: "/cosmos.store.streaming.abci.ListenFinalizeBlockResponse", + value: ListenFinalizeBlockResponse.encode(message).finish() + }; + } +}; +function createBaseListenCommitRequest(): ListenCommitRequest { + return { + blockHeight: BigInt(0), + res: undefined, + changeSet: [] + }; +} +export const ListenCommitRequest = { + typeUrl: "/cosmos.store.streaming.abci.ListenCommitRequest", + encode(message: ListenCommitRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.blockHeight !== BigInt(0)) { + writer.uint32(8).int64(message.blockHeight); + } + if (message.res !== undefined) { + ResponseCommit.encode(message.res, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.changeSet) { + StoreKVPair.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ListenCommitRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListenCommitRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockHeight = reader.int64(); + break; + case 2: + message.res = ResponseCommit.decode(reader, reader.uint32()); + break; + case 3: + message.changeSet.push(StoreKVPair.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ListenCommitRequest { + const message = createBaseListenCommitRequest(); + message.blockHeight = object.blockHeight !== undefined && object.blockHeight !== null ? BigInt(object.blockHeight.toString()) : BigInt(0); + message.res = object.res !== undefined && object.res !== null ? ResponseCommit.fromPartial(object.res) : undefined; + message.changeSet = object.changeSet?.map(e => StoreKVPair.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ListenCommitRequestAmino): ListenCommitRequest { + const message = createBaseListenCommitRequest(); + if (object.block_height !== undefined && object.block_height !== null) { + message.blockHeight = BigInt(object.block_height); + } + if (object.res !== undefined && object.res !== null) { + message.res = ResponseCommit.fromAmino(object.res); + } + message.changeSet = object.change_set?.map(e => StoreKVPair.fromAmino(e)) || []; + return message; + }, + toAmino(message: ListenCommitRequest): ListenCommitRequestAmino { + const obj: any = {}; + obj.block_height = message.blockHeight !== BigInt(0) ? message.blockHeight.toString() : undefined; + obj.res = message.res ? ResponseCommit.toAmino(message.res) : undefined; + if (message.changeSet) { + obj.change_set = message.changeSet.map(e => e ? StoreKVPair.toAmino(e) : undefined); + } else { + obj.change_set = message.changeSet; + } + return obj; + }, + fromAminoMsg(object: ListenCommitRequestAminoMsg): ListenCommitRequest { + return ListenCommitRequest.fromAmino(object.value); + }, + toAminoMsg(message: ListenCommitRequest): ListenCommitRequestAminoMsg { + return { + type: "cosmos-sdk/ListenCommitRequest", + value: ListenCommitRequest.toAmino(message) + }; + }, + fromProtoMsg(message: ListenCommitRequestProtoMsg): ListenCommitRequest { + return ListenCommitRequest.decode(message.value); + }, + toProto(message: ListenCommitRequest): Uint8Array { + return ListenCommitRequest.encode(message).finish(); + }, + toProtoMsg(message: ListenCommitRequest): ListenCommitRequestProtoMsg { + return { + typeUrl: "/cosmos.store.streaming.abci.ListenCommitRequest", + value: ListenCommitRequest.encode(message).finish() + }; + } +}; +function createBaseListenCommitResponse(): ListenCommitResponse { + return {}; +} +export const ListenCommitResponse = { + typeUrl: "/cosmos.store.streaming.abci.ListenCommitResponse", + encode(_: ListenCommitResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ListenCommitResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListenCommitResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): ListenCommitResponse { + const message = createBaseListenCommitResponse(); + return message; + }, + fromAmino(_: ListenCommitResponseAmino): ListenCommitResponse { + const message = createBaseListenCommitResponse(); + return message; + }, + toAmino(_: ListenCommitResponse): ListenCommitResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: ListenCommitResponseAminoMsg): ListenCommitResponse { + return ListenCommitResponse.fromAmino(object.value); + }, + toAminoMsg(message: ListenCommitResponse): ListenCommitResponseAminoMsg { + return { + type: "cosmos-sdk/ListenCommitResponse", + value: ListenCommitResponse.toAmino(message) + }; + }, + fromProtoMsg(message: ListenCommitResponseProtoMsg): ListenCommitResponse { + return ListenCommitResponse.decode(message.value); + }, + toProto(message: ListenCommitResponse): Uint8Array { + return ListenCommitResponse.encode(message).finish(); + }, + toProtoMsg(message: ListenCommitResponse): ListenCommitResponseProtoMsg { + return { + typeUrl: "/cosmos.store.streaming.abci.ListenCommitResponse", + value: ListenCommitResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/store/v1beta1/commit_info.ts b/src/codegen/cosmos/store/v1beta1/commit_info.ts new file mode 100644 index 0000000..1d16402 --- /dev/null +++ b/src/codegen/cosmos/store/v1beta1/commit_info.ts @@ -0,0 +1,359 @@ +import { Timestamp } from "../../../google/protobuf/timestamp"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { toTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from "../../../helpers"; +/** + * CommitInfo defines commit information used by the multi-store when committing + * a version/height. + */ +export interface CommitInfo { + version: bigint; + storeInfos: StoreInfo[]; + timestamp: Date; +} +export interface CommitInfoProtoMsg { + typeUrl: "/cosmos.store.v1beta1.CommitInfo"; + value: Uint8Array; +} +/** + * CommitInfo defines commit information used by the multi-store when committing + * a version/height. + */ +export interface CommitInfoAmino { + version?: string; + store_infos?: StoreInfoAmino[]; + timestamp?: string; +} +export interface CommitInfoAminoMsg { + type: "cosmos-sdk/CommitInfo"; + value: CommitInfoAmino; +} +/** + * CommitInfo defines commit information used by the multi-store when committing + * a version/height. + */ +export interface CommitInfoSDKType { + version: bigint; + store_infos: StoreInfoSDKType[]; + timestamp: Date; +} +/** + * StoreInfo defines store-specific commit information. It contains a reference + * between a store name and the commit ID. + */ +export interface StoreInfo { + name: string; + commitId: CommitID; +} +export interface StoreInfoProtoMsg { + typeUrl: "/cosmos.store.v1beta1.StoreInfo"; + value: Uint8Array; +} +/** + * StoreInfo defines store-specific commit information. It contains a reference + * between a store name and the commit ID. + */ +export interface StoreInfoAmino { + name?: string; + commit_id?: CommitIDAmino; +} +export interface StoreInfoAminoMsg { + type: "cosmos-sdk/StoreInfo"; + value: StoreInfoAmino; +} +/** + * StoreInfo defines store-specific commit information. It contains a reference + * between a store name and the commit ID. + */ +export interface StoreInfoSDKType { + name: string; + commit_id: CommitIDSDKType; +} +/** + * CommitID defines the commitment information when a specific store is + * committed. + */ +export interface CommitID { + version: bigint; + hash: Uint8Array; +} +export interface CommitIDProtoMsg { + typeUrl: "/cosmos.store.v1beta1.CommitID"; + value: Uint8Array; +} +/** + * CommitID defines the commitment information when a specific store is + * committed. + */ +export interface CommitIDAmino { + version?: string; + hash?: string; +} +export interface CommitIDAminoMsg { + type: "cosmos-sdk/CommitID"; + value: CommitIDAmino; +} +/** + * CommitID defines the commitment information when a specific store is + * committed. + */ +export interface CommitIDSDKType { + version: bigint; + hash: Uint8Array; +} +function createBaseCommitInfo(): CommitInfo { + return { + version: BigInt(0), + storeInfos: [], + timestamp: new Date() + }; +} +export const CommitInfo = { + typeUrl: "/cosmos.store.v1beta1.CommitInfo", + encode(message: CommitInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.version !== BigInt(0)) { + writer.uint32(8).int64(message.version); + } + for (const v of message.storeInfos) { + StoreInfo.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.timestamp !== undefined) { + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CommitInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCommitInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.int64(); + break; + case 2: + message.storeInfos.push(StoreInfo.decode(reader, reader.uint32())); + break; + case 3: + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CommitInfo { + const message = createBaseCommitInfo(); + message.version = object.version !== undefined && object.version !== null ? BigInt(object.version.toString()) : BigInt(0); + message.storeInfos = object.storeInfos?.map(e => StoreInfo.fromPartial(e)) || []; + message.timestamp = object.timestamp ?? undefined; + return message; + }, + fromAmino(object: CommitInfoAmino): CommitInfo { + const message = createBaseCommitInfo(); + if (object.version !== undefined && object.version !== null) { + message.version = BigInt(object.version); + } + message.storeInfos = object.store_infos?.map(e => StoreInfo.fromAmino(e)) || []; + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + return message; + }, + toAmino(message: CommitInfo): CommitInfoAmino { + const obj: any = {}; + obj.version = message.version !== BigInt(0) ? message.version.toString() : undefined; + if (message.storeInfos) { + obj.store_infos = message.storeInfos.map(e => e ? StoreInfo.toAmino(e) : undefined); + } else { + obj.store_infos = message.storeInfos; + } + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; + return obj; + }, + fromAminoMsg(object: CommitInfoAminoMsg): CommitInfo { + return CommitInfo.fromAmino(object.value); + }, + toAminoMsg(message: CommitInfo): CommitInfoAminoMsg { + return { + type: "cosmos-sdk/CommitInfo", + value: CommitInfo.toAmino(message) + }; + }, + fromProtoMsg(message: CommitInfoProtoMsg): CommitInfo { + return CommitInfo.decode(message.value); + }, + toProto(message: CommitInfo): Uint8Array { + return CommitInfo.encode(message).finish(); + }, + toProtoMsg(message: CommitInfo): CommitInfoProtoMsg { + return { + typeUrl: "/cosmos.store.v1beta1.CommitInfo", + value: CommitInfo.encode(message).finish() + }; + } +}; +function createBaseStoreInfo(): StoreInfo { + return { + name: "", + commitId: CommitID.fromPartial({}) + }; +} +export const StoreInfo = { + typeUrl: "/cosmos.store.v1beta1.StoreInfo", + encode(message: StoreInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.commitId !== undefined) { + CommitID.encode(message.commitId, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StoreInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStoreInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.commitId = CommitID.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StoreInfo { + const message = createBaseStoreInfo(); + message.name = object.name ?? ""; + message.commitId = object.commitId !== undefined && object.commitId !== null ? CommitID.fromPartial(object.commitId) : undefined; + return message; + }, + fromAmino(object: StoreInfoAmino): StoreInfo { + const message = createBaseStoreInfo(); + if (object.name !== undefined && object.name !== null) { + message.name = object.name; + } + if (object.commit_id !== undefined && object.commit_id !== null) { + message.commitId = CommitID.fromAmino(object.commit_id); + } + return message; + }, + toAmino(message: StoreInfo): StoreInfoAmino { + const obj: any = {}; + obj.name = message.name === "" ? undefined : message.name; + obj.commit_id = message.commitId ? CommitID.toAmino(message.commitId) : undefined; + return obj; + }, + fromAminoMsg(object: StoreInfoAminoMsg): StoreInfo { + return StoreInfo.fromAmino(object.value); + }, + toAminoMsg(message: StoreInfo): StoreInfoAminoMsg { + return { + type: "cosmos-sdk/StoreInfo", + value: StoreInfo.toAmino(message) + }; + }, + fromProtoMsg(message: StoreInfoProtoMsg): StoreInfo { + return StoreInfo.decode(message.value); + }, + toProto(message: StoreInfo): Uint8Array { + return StoreInfo.encode(message).finish(); + }, + toProtoMsg(message: StoreInfo): StoreInfoProtoMsg { + return { + typeUrl: "/cosmos.store.v1beta1.StoreInfo", + value: StoreInfo.encode(message).finish() + }; + } +}; +function createBaseCommitID(): CommitID { + return { + version: BigInt(0), + hash: new Uint8Array() + }; +} +export const CommitID = { + typeUrl: "/cosmos.store.v1beta1.CommitID", + encode(message: CommitID, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.version !== BigInt(0)) { + writer.uint32(8).int64(message.version); + } + if (message.hash.length !== 0) { + writer.uint32(18).bytes(message.hash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CommitID { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCommitID(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.int64(); + break; + case 2: + message.hash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CommitID { + const message = createBaseCommitID(); + message.version = object.version !== undefined && object.version !== null ? BigInt(object.version.toString()) : BigInt(0); + message.hash = object.hash ?? new Uint8Array(); + return message; + }, + fromAmino(object: CommitIDAmino): CommitID { + const message = createBaseCommitID(); + if (object.version !== undefined && object.version !== null) { + message.version = BigInt(object.version); + } + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + return message; + }, + toAmino(message: CommitID): CommitIDAmino { + const obj: any = {}; + obj.version = message.version !== BigInt(0) ? message.version.toString() : undefined; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; + return obj; + }, + fromAminoMsg(object: CommitIDAminoMsg): CommitID { + return CommitID.fromAmino(object.value); + }, + toAminoMsg(message: CommitID): CommitIDAminoMsg { + return { + type: "cosmos-sdk/CommitID", + value: CommitID.toAmino(message) + }; + }, + fromProtoMsg(message: CommitIDProtoMsg): CommitID { + return CommitID.decode(message.value); + }, + toProto(message: CommitID): Uint8Array { + return CommitID.encode(message).finish(); + }, + toProtoMsg(message: CommitID): CommitIDProtoMsg { + return { + typeUrl: "/cosmos.store.v1beta1.CommitID", + value: CommitID.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/store/v1beta1/listening.ts b/src/codegen/cosmos/store/v1beta1/listening.ts new file mode 100644 index 0000000..a760144 --- /dev/null +++ b/src/codegen/cosmos/store/v1beta1/listening.ts @@ -0,0 +1,289 @@ +import { ResponseCommit, ResponseCommitAmino, ResponseCommitSDKType, RequestFinalizeBlock, RequestFinalizeBlockAmino, RequestFinalizeBlockSDKType, ResponseFinalizeBlock, ResponseFinalizeBlockAmino, ResponseFinalizeBlockSDKType } from "../../../tendermint/abci/types"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +/** + * StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and Deletes) + * It optionally includes the StoreKey for the originating KVStore and a Boolean flag to distinguish between Sets and + * Deletes + * + * Since: cosmos-sdk 0.43 + */ +export interface StoreKVPair { + /** the store key for the KVStore this pair originates from */ + storeKey: string; + /** true indicates a delete operation, false indicates a set operation */ + delete: boolean; + key: Uint8Array; + value: Uint8Array; +} +export interface StoreKVPairProtoMsg { + typeUrl: "/cosmos.store.v1beta1.StoreKVPair"; + value: Uint8Array; +} +/** + * StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and Deletes) + * It optionally includes the StoreKey for the originating KVStore and a Boolean flag to distinguish between Sets and + * Deletes + * + * Since: cosmos-sdk 0.43 + */ +export interface StoreKVPairAmino { + /** the store key for the KVStore this pair originates from */ + store_key?: string; + /** true indicates a delete operation, false indicates a set operation */ + delete?: boolean; + key?: string; + value?: string; +} +export interface StoreKVPairAminoMsg { + type: "cosmos-sdk/StoreKVPair"; + value: StoreKVPairAmino; +} +/** + * StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and Deletes) + * It optionally includes the StoreKey for the originating KVStore and a Boolean flag to distinguish between Sets and + * Deletes + * + * Since: cosmos-sdk 0.43 + */ +export interface StoreKVPairSDKType { + store_key: string; + delete: boolean; + key: Uint8Array; + value: Uint8Array; +} +/** + * BlockMetadata contains all the abci event data of a block + * the file streamer dump them into files together with the state changes. + */ +export interface BlockMetadata { + responseCommit?: ResponseCommit; + requestFinalizeBlock?: RequestFinalizeBlock; + /** TODO: should we renumber this? */ + responseFinalizeBlock?: ResponseFinalizeBlock; +} +export interface BlockMetadataProtoMsg { + typeUrl: "/cosmos.store.v1beta1.BlockMetadata"; + value: Uint8Array; +} +/** + * BlockMetadata contains all the abci event data of a block + * the file streamer dump them into files together with the state changes. + */ +export interface BlockMetadataAmino { + response_commit?: ResponseCommitAmino; + request_finalize_block?: RequestFinalizeBlockAmino; + /** TODO: should we renumber this? */ + response_finalize_block?: ResponseFinalizeBlockAmino; +} +export interface BlockMetadataAminoMsg { + type: "cosmos-sdk/BlockMetadata"; + value: BlockMetadataAmino; +} +/** + * BlockMetadata contains all the abci event data of a block + * the file streamer dump them into files together with the state changes. + */ +export interface BlockMetadataSDKType { + response_commit?: ResponseCommitSDKType; + request_finalize_block?: RequestFinalizeBlockSDKType; + response_finalize_block?: ResponseFinalizeBlockSDKType; +} +function createBaseStoreKVPair(): StoreKVPair { + return { + storeKey: "", + delete: false, + key: new Uint8Array(), + value: new Uint8Array() + }; +} +export const StoreKVPair = { + typeUrl: "/cosmos.store.v1beta1.StoreKVPair", + encode(message: StoreKVPair, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.storeKey !== "") { + writer.uint32(10).string(message.storeKey); + } + if (message.delete === true) { + writer.uint32(16).bool(message.delete); + } + if (message.key.length !== 0) { + writer.uint32(26).bytes(message.key); + } + if (message.value.length !== 0) { + writer.uint32(34).bytes(message.value); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StoreKVPair { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStoreKVPair(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.storeKey = reader.string(); + break; + case 2: + message.delete = reader.bool(); + break; + case 3: + message.key = reader.bytes(); + break; + case 4: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StoreKVPair { + const message = createBaseStoreKVPair(); + message.storeKey = object.storeKey ?? ""; + message.delete = object.delete ?? false; + message.key = object.key ?? new Uint8Array(); + message.value = object.value ?? new Uint8Array(); + return message; + }, + fromAmino(object: StoreKVPairAmino): StoreKVPair { + const message = createBaseStoreKVPair(); + if (object.store_key !== undefined && object.store_key !== null) { + message.storeKey = object.store_key; + } + if (object.delete !== undefined && object.delete !== null) { + message.delete = object.delete; + } + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + return message; + }, + toAmino(message: StoreKVPair): StoreKVPairAmino { + const obj: any = {}; + obj.store_key = message.storeKey === "" ? undefined : message.storeKey; + obj.delete = message.delete === false ? undefined : message.delete; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; + return obj; + }, + fromAminoMsg(object: StoreKVPairAminoMsg): StoreKVPair { + return StoreKVPair.fromAmino(object.value); + }, + toAminoMsg(message: StoreKVPair): StoreKVPairAminoMsg { + return { + type: "cosmos-sdk/StoreKVPair", + value: StoreKVPair.toAmino(message) + }; + }, + fromProtoMsg(message: StoreKVPairProtoMsg): StoreKVPair { + return StoreKVPair.decode(message.value); + }, + toProto(message: StoreKVPair): Uint8Array { + return StoreKVPair.encode(message).finish(); + }, + toProtoMsg(message: StoreKVPair): StoreKVPairProtoMsg { + return { + typeUrl: "/cosmos.store.v1beta1.StoreKVPair", + value: StoreKVPair.encode(message).finish() + }; + } +}; +function createBaseBlockMetadata(): BlockMetadata { + return { + responseCommit: undefined, + requestFinalizeBlock: undefined, + responseFinalizeBlock: undefined + }; +} +export const BlockMetadata = { + typeUrl: "/cosmos.store.v1beta1.BlockMetadata", + encode(message: BlockMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.responseCommit !== undefined) { + ResponseCommit.encode(message.responseCommit, writer.uint32(50).fork()).ldelim(); + } + if (message.requestFinalizeBlock !== undefined) { + RequestFinalizeBlock.encode(message.requestFinalizeBlock, writer.uint32(58).fork()).ldelim(); + } + if (message.responseFinalizeBlock !== undefined) { + ResponseFinalizeBlock.encode(message.responseFinalizeBlock, writer.uint32(66).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): BlockMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBlockMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 6: + message.responseCommit = ResponseCommit.decode(reader, reader.uint32()); + break; + case 7: + message.requestFinalizeBlock = RequestFinalizeBlock.decode(reader, reader.uint32()); + break; + case 8: + message.responseFinalizeBlock = ResponseFinalizeBlock.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): BlockMetadata { + const message = createBaseBlockMetadata(); + message.responseCommit = object.responseCommit !== undefined && object.responseCommit !== null ? ResponseCommit.fromPartial(object.responseCommit) : undefined; + message.requestFinalizeBlock = object.requestFinalizeBlock !== undefined && object.requestFinalizeBlock !== null ? RequestFinalizeBlock.fromPartial(object.requestFinalizeBlock) : undefined; + message.responseFinalizeBlock = object.responseFinalizeBlock !== undefined && object.responseFinalizeBlock !== null ? ResponseFinalizeBlock.fromPartial(object.responseFinalizeBlock) : undefined; + return message; + }, + fromAmino(object: BlockMetadataAmino): BlockMetadata { + const message = createBaseBlockMetadata(); + if (object.response_commit !== undefined && object.response_commit !== null) { + message.responseCommit = ResponseCommit.fromAmino(object.response_commit); + } + if (object.request_finalize_block !== undefined && object.request_finalize_block !== null) { + message.requestFinalizeBlock = RequestFinalizeBlock.fromAmino(object.request_finalize_block); + } + if (object.response_finalize_block !== undefined && object.response_finalize_block !== null) { + message.responseFinalizeBlock = ResponseFinalizeBlock.fromAmino(object.response_finalize_block); + } + return message; + }, + toAmino(message: BlockMetadata): BlockMetadataAmino { + const obj: any = {}; + obj.response_commit = message.responseCommit ? ResponseCommit.toAmino(message.responseCommit) : undefined; + obj.request_finalize_block = message.requestFinalizeBlock ? RequestFinalizeBlock.toAmino(message.requestFinalizeBlock) : undefined; + obj.response_finalize_block = message.responseFinalizeBlock ? ResponseFinalizeBlock.toAmino(message.responseFinalizeBlock) : undefined; + return obj; + }, + fromAminoMsg(object: BlockMetadataAminoMsg): BlockMetadata { + return BlockMetadata.fromAmino(object.value); + }, + toAminoMsg(message: BlockMetadata): BlockMetadataAminoMsg { + return { + type: "cosmos-sdk/BlockMetadata", + value: BlockMetadata.toAmino(message) + }; + }, + fromProtoMsg(message: BlockMetadataProtoMsg): BlockMetadata { + return BlockMetadata.decode(message.value); + }, + toProto(message: BlockMetadata): Uint8Array { + return BlockMetadata.encode(message).finish(); + }, + toProtoMsg(message: BlockMetadata): BlockMetadataProtoMsg { + return { + typeUrl: "/cosmos.store.v1beta1.BlockMetadata", + value: BlockMetadata.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/tx/config/v1/config.ts b/src/codegen/cosmos/tx/config/v1/config.ts new file mode 100644 index 0000000..5a76d6c --- /dev/null +++ b/src/codegen/cosmos/tx/config/v1/config.ts @@ -0,0 +1,121 @@ +import { BinaryReader, BinaryWriter } from "../../../../binary"; +/** Config is the config object of the x/auth/tx package. */ +export interface Config { + /** + * skip_ante_handler defines whether the ante handler registration should be skipped in case an app wants to override + * this functionality. + */ + skipAnteHandler: boolean; + /** + * skip_post_handler defines whether the post handler registration should be skipped in case an app wants to override + * this functionality. + */ + skipPostHandler: boolean; +} +export interface ConfigProtoMsg { + typeUrl: "/cosmos.tx.config.v1.Config"; + value: Uint8Array; +} +/** Config is the config object of the x/auth/tx package. */ +export interface ConfigAmino { + /** + * skip_ante_handler defines whether the ante handler registration should be skipped in case an app wants to override + * this functionality. + */ + skip_ante_handler?: boolean; + /** + * skip_post_handler defines whether the post handler registration should be skipped in case an app wants to override + * this functionality. + */ + skip_post_handler?: boolean; +} +export interface ConfigAminoMsg { + type: "cosmos-sdk/Config"; + value: ConfigAmino; +} +/** Config is the config object of the x/auth/tx package. */ +export interface ConfigSDKType { + skip_ante_handler: boolean; + skip_post_handler: boolean; +} +function createBaseConfig(): Config { + return { + skipAnteHandler: false, + skipPostHandler: false + }; +} +export const Config = { + typeUrl: "/cosmos.tx.config.v1.Config", + encode(message: Config, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.skipAnteHandler === true) { + writer.uint32(8).bool(message.skipAnteHandler); + } + if (message.skipPostHandler === true) { + writer.uint32(16).bool(message.skipPostHandler); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Config { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.skipAnteHandler = reader.bool(); + break; + case 2: + message.skipPostHandler = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Config { + const message = createBaseConfig(); + message.skipAnteHandler = object.skipAnteHandler ?? false; + message.skipPostHandler = object.skipPostHandler ?? false; + return message; + }, + fromAmino(object: ConfigAmino): Config { + const message = createBaseConfig(); + if (object.skip_ante_handler !== undefined && object.skip_ante_handler !== null) { + message.skipAnteHandler = object.skip_ante_handler; + } + if (object.skip_post_handler !== undefined && object.skip_post_handler !== null) { + message.skipPostHandler = object.skip_post_handler; + } + return message; + }, + toAmino(message: Config): ConfigAmino { + const obj: any = {}; + obj.skip_ante_handler = message.skipAnteHandler === false ? undefined : message.skipAnteHandler; + obj.skip_post_handler = message.skipPostHandler === false ? undefined : message.skipPostHandler; + return obj; + }, + fromAminoMsg(object: ConfigAminoMsg): Config { + return Config.fromAmino(object.value); + }, + toAminoMsg(message: Config): ConfigAminoMsg { + return { + type: "cosmos-sdk/Config", + value: Config.toAmino(message) + }; + }, + fromProtoMsg(message: ConfigProtoMsg): Config { + return Config.decode(message.value); + }, + toProto(message: Config): Uint8Array { + return Config.encode(message).finish(); + }, + toProtoMsg(message: Config): ConfigProtoMsg { + return { + typeUrl: "/cosmos.tx.config.v1.Config", + value: Config.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/tx/signing/v1beta1/signing.ts b/src/codegen/cosmos/tx/signing/v1beta1/signing.ts index fabda4f..d0d9e84 100644 --- a/src/codegen/cosmos/tx/signing/v1beta1/signing.ts +++ b/src/codegen/cosmos/tx/signing/v1beta1/signing.ts @@ -2,27 +2,46 @@ import { CompactBitArray, CompactBitArrayAmino, CompactBitArraySDKType } from ". import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; -/** SignMode represents a signing mode with its own security guarantees. */ +/** + * SignMode represents a signing mode with its own security guarantees. + * + * This enum should be considered a registry of all known sign modes + * in the Cosmos ecosystem. Apps are not expected to support all known + * sign modes. Apps that would like to support custom sign modes are + * encouraged to open a small PR against this file to add a new case + * to this SignMode enum describing their sign mode so that different + * apps have a consistent version of this enum. + */ export enum SignMode { /** * SIGN_MODE_UNSPECIFIED - SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be - * rejected + * rejected. */ SIGN_MODE_UNSPECIFIED = 0, /** * SIGN_MODE_DIRECT - SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is - * verified with raw bytes from Tx + * verified with raw bytes from Tx. */ SIGN_MODE_DIRECT = 1, /** * SIGN_MODE_TEXTUAL - SIGN_MODE_TEXTUAL is a future signing mode that will verify some * human-readable textual representation on top of the binary representation - * from SIGN_MODE_DIRECT + * from SIGN_MODE_DIRECT. + * + * Since: cosmos-sdk 0.50 */ SIGN_MODE_TEXTUAL = 2, + /** + * SIGN_MODE_DIRECT_AUX - SIGN_MODE_DIRECT_AUX specifies a signing mode which uses + * SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not + * require signers signing over other signers' `signer_info`. + * + * Since: cosmos-sdk 0.46 + */ + SIGN_MODE_DIRECT_AUX = 3, /** * SIGN_MODE_LEGACY_AMINO_JSON - SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses - * Amino JSON and will be removed in the future + * Amino JSON and will be removed in the future. */ SIGN_MODE_LEGACY_AMINO_JSON = 127, /** @@ -53,6 +72,9 @@ export function signModeFromJSON(object: any): SignMode { case 2: case "SIGN_MODE_TEXTUAL": return SignMode.SIGN_MODE_TEXTUAL; + case 3: + case "SIGN_MODE_DIRECT_AUX": + return SignMode.SIGN_MODE_DIRECT_AUX; case 127: case "SIGN_MODE_LEGACY_AMINO_JSON": return SignMode.SIGN_MODE_LEGACY_AMINO_JSON; @@ -73,6 +95,8 @@ export function signModeToJSON(object: SignMode): string { return "SIGN_MODE_DIRECT"; case SignMode.SIGN_MODE_TEXTUAL: return "SIGN_MODE_TEXTUAL"; + case SignMode.SIGN_MODE_DIRECT_AUX: + return "SIGN_MODE_DIRECT_AUX"; case SignMode.SIGN_MODE_LEGACY_AMINO_JSON: return "SIGN_MODE_LEGACY_AMINO_JSON"; case SignMode.SIGN_MODE_EIP_191: diff --git a/src/codegen/cosmos/tx/v1beta1/service.lcd.ts b/src/codegen/cosmos/tx/v1beta1/service.lcd.ts index c4ed28e..01190e2 100644 --- a/src/codegen/cosmos/tx/v1beta1/service.lcd.ts +++ b/src/codegen/cosmos/tx/v1beta1/service.lcd.ts @@ -32,6 +32,15 @@ export class LCDQueryClient { if (typeof params?.orderBy !== "undefined") { options.params.order_by = params.orderBy; } + if (typeof params?.page !== "undefined") { + options.params.page = params.page; + } + if (typeof params?.limit !== "undefined") { + options.params.limit = params.limit; + } + if (typeof params?.query !== "undefined") { + options.params.query = params.query; + } const endpoint = `cosmos/tx/v1beta1/txs`; return await this.req.get(endpoint, options); } diff --git a/src/codegen/cosmos/tx/v1beta1/service.rpc.Service.ts b/src/codegen/cosmos/tx/v1beta1/service.rpc.Service.ts index 5a96317..8fee3db 100644 --- a/src/codegen/cosmos/tx/v1beta1/service.rpc.Service.ts +++ b/src/codegen/cosmos/tx/v1beta1/service.rpc.Service.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { SimulateRequest, SimulateResponse, GetTxRequest, GetTxResponse, BroadcastTxRequest, BroadcastTxResponse, GetTxsEventRequest, GetTxsEventResponse, GetBlockWithTxsRequest, GetBlockWithTxsResponse } from "./service"; +import { SimulateRequest, SimulateResponse, GetTxRequest, GetTxResponse, BroadcastTxRequest, BroadcastTxResponse, GetTxsEventRequest, GetTxsEventResponse, GetBlockWithTxsRequest, GetBlockWithTxsResponse, TxDecodeRequest, TxDecodeResponse, TxEncodeRequest, TxEncodeResponse, TxEncodeAminoRequest, TxEncodeAminoResponse, TxDecodeAminoRequest, TxDecodeAminoResponse } from "./service"; /** Service defines a gRPC service for interacting with transactions. */ export interface Service { /** Simulate simulates executing a transaction for estimating gas usage. */ @@ -18,6 +18,30 @@ export interface Service { * Since: cosmos-sdk 0.45.2 */ getBlockWithTxs(request: GetBlockWithTxsRequest): Promise; + /** + * TxDecode decodes the transaction. + * + * Since: cosmos-sdk 0.47 + */ + txDecode(request: TxDecodeRequest): Promise; + /** + * TxEncode encodes the transaction. + * + * Since: cosmos-sdk 0.47 + */ + txEncode(request: TxEncodeRequest): Promise; + /** + * TxEncodeAmino encodes an Amino transaction from JSON to encoded bytes. + * + * Since: cosmos-sdk 0.47 + */ + txEncodeAmino(request: TxEncodeAminoRequest): Promise; + /** + * TxDecodeAmino decodes an Amino transaction from encoded bytes to JSON. + * + * Since: cosmos-sdk 0.47 + */ + txDecodeAmino(request: TxDecodeAminoRequest): Promise; } export class ServiceClientImpl implements Service { private readonly rpc: Rpc; @@ -28,6 +52,10 @@ export class ServiceClientImpl implements Service { this.broadcastTx = this.broadcastTx.bind(this); this.getTxsEvent = this.getTxsEvent.bind(this); this.getBlockWithTxs = this.getBlockWithTxs.bind(this); + this.txDecode = this.txDecode.bind(this); + this.txEncode = this.txEncode.bind(this); + this.txEncodeAmino = this.txEncodeAmino.bind(this); + this.txDecodeAmino = this.txDecodeAmino.bind(this); } simulate(request: SimulateRequest): Promise { const data = SimulateRequest.encode(request).finish(); @@ -54,6 +82,26 @@ export class ServiceClientImpl implements Service { const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "GetBlockWithTxs", data); return promise.then(data => GetBlockWithTxsResponse.decode(new BinaryReader(data))); } + txDecode(request: TxDecodeRequest): Promise { + const data = TxDecodeRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "TxDecode", data); + return promise.then(data => TxDecodeResponse.decode(new BinaryReader(data))); + } + txEncode(request: TxEncodeRequest): Promise { + const data = TxEncodeRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "TxEncode", data); + return promise.then(data => TxEncodeResponse.decode(new BinaryReader(data))); + } + txEncodeAmino(request: TxEncodeAminoRequest): Promise { + const data = TxEncodeAminoRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "TxEncodeAmino", data); + return promise.then(data => TxEncodeAminoResponse.decode(new BinaryReader(data))); + } + txDecodeAmino(request: TxDecodeAminoRequest): Promise { + const data = TxDecodeAminoRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.tx.v1beta1.Service", "TxDecodeAmino", data); + return promise.then(data => TxDecodeAminoResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -73,6 +121,18 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, getBlockWithTxs(request: GetBlockWithTxsRequest): Promise { return queryService.getBlockWithTxs(request); + }, + txDecode(request: TxDecodeRequest): Promise { + return queryService.txDecode(request); + }, + txEncode(request: TxEncodeRequest): Promise { + return queryService.txEncode(request); + }, + txEncodeAmino(request: TxEncodeAminoRequest): Promise { + return queryService.txEncodeAmino(request); + }, + txDecodeAmino(request: TxDecodeAminoRequest): Promise { + return queryService.txDecodeAmino(request); } }; }; \ No newline at end of file diff --git a/src/codegen/cosmos/tx/v1beta1/service.ts b/src/codegen/cosmos/tx/v1beta1/service.ts index 09972c0..68dfee0 100644 --- a/src/codegen/cosmos/tx/v1beta1/service.ts +++ b/src/codegen/cosmos/tx/v1beta1/service.ts @@ -7,7 +7,10 @@ import { BinaryReader, BinaryWriter } from "../../../binary"; import { bytesFromBase64, base64FromBytes } from "../../../helpers"; /** OrderBy defines the sorting order */ export enum OrderBy { - /** ORDER_BY_UNSPECIFIED - ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case. */ + /** + * ORDER_BY_UNSPECIFIED - ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults + * to ASC in this case. + */ ORDER_BY_UNSPECIFIED = 0, /** ORDER_BY_ASC - ORDER_BY_ASC defines ascending order */ ORDER_BY_ASC = 1, @@ -47,23 +50,26 @@ export function orderByToJSON(object: OrderBy): string { return "UNRECOGNIZED"; } } -/** BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method. */ +/** + * BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC + * method. + */ export enum BroadcastMode { /** BROADCAST_MODE_UNSPECIFIED - zero-value for mode ordering */ BROADCAST_MODE_UNSPECIFIED = 0, /** - * BROADCAST_MODE_BLOCK - BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for - * the tx to be committed in a block. + * BROADCAST_MODE_BLOCK - DEPRECATED: use BROADCAST_MODE_SYNC instead, + * BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x onwards. */ BROADCAST_MODE_BLOCK = 1, /** - * BROADCAST_MODE_SYNC - BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for - * a CheckTx execution response only. + * BROADCAST_MODE_SYNC - BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits + * for a CheckTx execution response only. */ BROADCAST_MODE_SYNC = 2, /** - * BROADCAST_MODE_ASYNC - BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns - * immediately. + * BROADCAST_MODE_ASYNC - BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client + * returns immediately. */ BROADCAST_MODE_ASYNC = 3, UNRECOGNIZED = -1, @@ -110,11 +116,37 @@ export function broadcastModeToJSON(object: BroadcastMode): string { * RPC method. */ export interface GetTxsEventRequest { - /** events is the list of transaction event type. */ + /** + * events is the list of transaction event type. + * Deprecated post v0.47.x: use query instead, which should contain a valid + * events query. + */ + /** @deprecated */ events: string[]; - /** pagination defines a pagination for the request. */ + /** + * pagination defines a pagination for the request. + * Deprecated post v0.46.x: use page and limit instead. + */ + /** @deprecated */ pagination?: PageRequest; orderBy: OrderBy; + /** + * page is the page number to query, starts at 1. If not provided, will + * default to first page. + */ + page: bigint; + /** + * limit is the total number of results to be returned in the result page. + * If left empty it will default to a value to be set by each app. + */ + limit: bigint; + /** + * query defines the transaction event query that is proxied to Tendermint's + * TxSearch RPC method. The query must be valid. + * + * Since cosmos-sdk 0.50 + */ + query: string; } export interface GetTxsEventRequestProtoMsg { typeUrl: "/cosmos.tx.v1beta1.GetTxsEventRequest"; @@ -125,11 +157,37 @@ export interface GetTxsEventRequestProtoMsg { * RPC method. */ export interface GetTxsEventRequestAmino { - /** events is the list of transaction event type. */ + /** + * events is the list of transaction event type. + * Deprecated post v0.47.x: use query instead, which should contain a valid + * events query. + */ + /** @deprecated */ events?: string[]; - /** pagination defines a pagination for the request. */ + /** + * pagination defines a pagination for the request. + * Deprecated post v0.46.x: use page and limit instead. + */ + /** @deprecated */ pagination?: PageRequestAmino; order_by?: OrderBy; + /** + * page is the page number to query, starts at 1. If not provided, will + * default to first page. + */ + page?: string; + /** + * limit is the total number of results to be returned in the result page. + * If left empty it will default to a value to be set by each app. + */ + limit?: string; + /** + * query defines the transaction event query that is proxied to Tendermint's + * TxSearch RPC method. The query must be valid. + * + * Since cosmos-sdk 0.50 + */ + query?: string; } export interface GetTxsEventRequestAminoMsg { type: "cosmos-sdk/GetTxsEventRequest"; @@ -140,9 +198,14 @@ export interface GetTxsEventRequestAminoMsg { * RPC method. */ export interface GetTxsEventRequestSDKType { + /** @deprecated */ events: string[]; + /** @deprecated */ pagination?: PageRequestSDKType; order_by: OrderBy; + page: bigint; + limit: bigint; + query: string; } /** * GetTxsEventResponse is the response type for the Service.TxsByEvents @@ -153,8 +216,14 @@ export interface GetTxsEventResponse { txs: Tx[]; /** tx_responses is the list of queried TxResponses. */ txResponses: TxResponse[]; - /** pagination defines a pagination for the response. */ + /** + * pagination defines a pagination for the response. + * Deprecated post v0.46.x: use total instead. + */ + /** @deprecated */ pagination?: PageResponse; + /** total is total number of results available */ + total: bigint; } export interface GetTxsEventResponseProtoMsg { typeUrl: "/cosmos.tx.v1beta1.GetTxsEventResponse"; @@ -169,8 +238,14 @@ export interface GetTxsEventResponseAmino { txs?: TxAmino[]; /** tx_responses is the list of queried TxResponses. */ tx_responses?: TxResponseAmino[]; - /** pagination defines a pagination for the response. */ + /** + * pagination defines a pagination for the response. + * Deprecated post v0.46.x: use total instead. + */ + /** @deprecated */ pagination?: PageResponseAmino; + /** total is total number of results available */ + total?: string; } export interface GetTxsEventResponseAminoMsg { type: "cosmos-sdk/GetTxsEventResponse"; @@ -183,7 +258,9 @@ export interface GetTxsEventResponseAminoMsg { export interface GetTxsEventResponseSDKType { txs: TxSDKType[]; tx_responses: TxResponseSDKType[]; + /** @deprecated */ pagination?: PageResponseSDKType; + total: bigint; } /** * BroadcastTxRequest is the request type for the Service.BroadcastTxRequest @@ -440,7 +517,8 @@ export interface GetBlockWithTxsRequestSDKType { pagination?: PageRequestSDKType; } /** - * GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. + * GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs + * method. * * Since: cosmos-sdk 0.45.2 */ @@ -457,7 +535,8 @@ export interface GetBlockWithTxsResponseProtoMsg { value: Uint8Array; } /** - * GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. + * GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs + * method. * * Since: cosmos-sdk 0.45.2 */ @@ -474,7 +553,8 @@ export interface GetBlockWithTxsResponseAminoMsg { value: GetBlockWithTxsResponseAmino; } /** - * GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. + * GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs + * method. * * Since: cosmos-sdk 0.45.2 */ @@ -484,11 +564,302 @@ export interface GetBlockWithTxsResponseSDKType { block?: BlockSDKType; pagination?: PageResponseSDKType; } +/** + * TxDecodeRequest is the request type for the Service.TxDecode + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeRequest { + /** tx_bytes is the raw transaction. */ + txBytes: Uint8Array; +} +export interface TxDecodeRequestProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeRequest"; + value: Uint8Array; +} +/** + * TxDecodeRequest is the request type for the Service.TxDecode + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeRequestAmino { + /** tx_bytes is the raw transaction. */ + tx_bytes?: string; +} +export interface TxDecodeRequestAminoMsg { + type: "cosmos-sdk/TxDecodeRequest"; + value: TxDecodeRequestAmino; +} +/** + * TxDecodeRequest is the request type for the Service.TxDecode + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeRequestSDKType { + tx_bytes: Uint8Array; +} +/** + * TxDecodeResponse is the response type for the + * Service.TxDecode method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeResponse { + /** tx is the decoded transaction. */ + tx?: Tx; +} +export interface TxDecodeResponseProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeResponse"; + value: Uint8Array; +} +/** + * TxDecodeResponse is the response type for the + * Service.TxDecode method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeResponseAmino { + /** tx is the decoded transaction. */ + tx?: TxAmino; +} +export interface TxDecodeResponseAminoMsg { + type: "cosmos-sdk/TxDecodeResponse"; + value: TxDecodeResponseAmino; +} +/** + * TxDecodeResponse is the response type for the + * Service.TxDecode method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeResponseSDKType { + tx?: TxSDKType; +} +/** + * TxEncodeRequest is the request type for the Service.TxEncode + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeRequest { + /** tx is the transaction to encode. */ + tx?: Tx; +} +export interface TxEncodeRequestProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeRequest"; + value: Uint8Array; +} +/** + * TxEncodeRequest is the request type for the Service.TxEncode + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeRequestAmino { + /** tx is the transaction to encode. */ + tx?: TxAmino; +} +export interface TxEncodeRequestAminoMsg { + type: "cosmos-sdk/TxEncodeRequest"; + value: TxEncodeRequestAmino; +} +/** + * TxEncodeRequest is the request type for the Service.TxEncode + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeRequestSDKType { + tx?: TxSDKType; +} +/** + * TxEncodeResponse is the response type for the + * Service.TxEncode method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeResponse { + /** tx_bytes is the encoded transaction bytes. */ + txBytes: Uint8Array; +} +export interface TxEncodeResponseProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeResponse"; + value: Uint8Array; +} +/** + * TxEncodeResponse is the response type for the + * Service.TxEncode method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeResponseAmino { + /** tx_bytes is the encoded transaction bytes. */ + tx_bytes?: string; +} +export interface TxEncodeResponseAminoMsg { + type: "cosmos-sdk/TxEncodeResponse"; + value: TxEncodeResponseAmino; +} +/** + * TxEncodeResponse is the response type for the + * Service.TxEncode method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeResponseSDKType { + tx_bytes: Uint8Array; +} +/** + * TxEncodeAminoRequest is the request type for the Service.TxEncodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeAminoRequest { + aminoJson: string; +} +export interface TxEncodeAminoRequestProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeAminoRequest"; + value: Uint8Array; +} +/** + * TxEncodeAminoRequest is the request type for the Service.TxEncodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeAminoRequestAmino { + amino_json?: string; +} +export interface TxEncodeAminoRequestAminoMsg { + type: "cosmos-sdk/TxEncodeAminoRequest"; + value: TxEncodeAminoRequestAmino; +} +/** + * TxEncodeAminoRequest is the request type for the Service.TxEncodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeAminoRequestSDKType { + amino_json: string; +} +/** + * TxEncodeAminoResponse is the response type for the Service.TxEncodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeAminoResponse { + aminoBinary: Uint8Array; +} +export interface TxEncodeAminoResponseProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeAminoResponse"; + value: Uint8Array; +} +/** + * TxEncodeAminoResponse is the response type for the Service.TxEncodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeAminoResponseAmino { + amino_binary?: string; +} +export interface TxEncodeAminoResponseAminoMsg { + type: "cosmos-sdk/TxEncodeAminoResponse"; + value: TxEncodeAminoResponseAmino; +} +/** + * TxEncodeAminoResponse is the response type for the Service.TxEncodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxEncodeAminoResponseSDKType { + amino_binary: Uint8Array; +} +/** + * TxDecodeAminoRequest is the request type for the Service.TxDecodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeAminoRequest { + aminoBinary: Uint8Array; +} +export interface TxDecodeAminoRequestProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeAminoRequest"; + value: Uint8Array; +} +/** + * TxDecodeAminoRequest is the request type for the Service.TxDecodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeAminoRequestAmino { + amino_binary?: string; +} +export interface TxDecodeAminoRequestAminoMsg { + type: "cosmos-sdk/TxDecodeAminoRequest"; + value: TxDecodeAminoRequestAmino; +} +/** + * TxDecodeAminoRequest is the request type for the Service.TxDecodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeAminoRequestSDKType { + amino_binary: Uint8Array; +} +/** + * TxDecodeAminoResponse is the response type for the Service.TxDecodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeAminoResponse { + aminoJson: string; +} +export interface TxDecodeAminoResponseProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeAminoResponse"; + value: Uint8Array; +} +/** + * TxDecodeAminoResponse is the response type for the Service.TxDecodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeAminoResponseAmino { + amino_json?: string; +} +export interface TxDecodeAminoResponseAminoMsg { + type: "cosmos-sdk/TxDecodeAminoResponse"; + value: TxDecodeAminoResponseAmino; +} +/** + * TxDecodeAminoResponse is the response type for the Service.TxDecodeAmino + * RPC method. + * + * Since: cosmos-sdk 0.47 + */ +export interface TxDecodeAminoResponseSDKType { + amino_json: string; +} function createBaseGetTxsEventRequest(): GetTxsEventRequest { return { events: [], pagination: undefined, - orderBy: 0 + orderBy: 0, + page: BigInt(0), + limit: BigInt(0), + query: "" }; } export const GetTxsEventRequest = { @@ -503,6 +874,15 @@ export const GetTxsEventRequest = { if (message.orderBy !== 0) { writer.uint32(24).int32(message.orderBy); } + if (message.page !== BigInt(0)) { + writer.uint32(32).uint64(message.page); + } + if (message.limit !== BigInt(0)) { + writer.uint32(40).uint64(message.limit); + } + if (message.query !== "") { + writer.uint32(50).string(message.query); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GetTxsEventRequest { @@ -521,6 +901,15 @@ export const GetTxsEventRequest = { case 3: message.orderBy = (reader.int32() as any); break; + case 4: + message.page = reader.uint64(); + break; + case 5: + message.limit = reader.uint64(); + break; + case 6: + message.query = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -533,6 +922,9 @@ export const GetTxsEventRequest = { message.events = object.events?.map(e => e) || []; message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; message.orderBy = object.orderBy ?? 0; + message.page = object.page !== undefined && object.page !== null ? BigInt(object.page.toString()) : BigInt(0); + message.limit = object.limit !== undefined && object.limit !== null ? BigInt(object.limit.toString()) : BigInt(0); + message.query = object.query ?? ""; return message; }, fromAmino(object: GetTxsEventRequestAmino): GetTxsEventRequest { @@ -544,6 +936,15 @@ export const GetTxsEventRequest = { if (object.order_by !== undefined && object.order_by !== null) { message.orderBy = object.order_by; } + if (object.page !== undefined && object.page !== null) { + message.page = BigInt(object.page); + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = BigInt(object.limit); + } + if (object.query !== undefined && object.query !== null) { + message.query = object.query; + } return message; }, toAmino(message: GetTxsEventRequest): GetTxsEventRequestAmino { @@ -555,6 +956,9 @@ export const GetTxsEventRequest = { } obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; obj.order_by = message.orderBy === 0 ? undefined : message.orderBy; + obj.page = message.page !== BigInt(0) ? message.page.toString() : undefined; + obj.limit = message.limit !== BigInt(0) ? message.limit.toString() : undefined; + obj.query = message.query === "" ? undefined : message.query; return obj; }, fromAminoMsg(object: GetTxsEventRequestAminoMsg): GetTxsEventRequest { @@ -583,7 +987,8 @@ function createBaseGetTxsEventResponse(): GetTxsEventResponse { return { txs: [], txResponses: [], - pagination: undefined + pagination: undefined, + total: BigInt(0) }; } export const GetTxsEventResponse = { @@ -598,6 +1003,9 @@ export const GetTxsEventResponse = { if (message.pagination !== undefined) { PageResponse.encode(message.pagination, writer.uint32(26).fork()).ldelim(); } + if (message.total !== BigInt(0)) { + writer.uint32(32).uint64(message.total); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GetTxsEventResponse { @@ -616,6 +1024,9 @@ export const GetTxsEventResponse = { case 3: message.pagination = PageResponse.decode(reader, reader.uint32()); break; + case 4: + message.total = reader.uint64(); + break; default: reader.skipType(tag & 7); break; @@ -628,6 +1039,7 @@ export const GetTxsEventResponse = { message.txs = object.txs?.map(e => Tx.fromPartial(e)) || []; message.txResponses = object.txResponses?.map(e => TxResponse.fromPartial(e)) || []; message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + message.total = object.total !== undefined && object.total !== null ? BigInt(object.total.toString()) : BigInt(0); return message; }, fromAmino(object: GetTxsEventResponseAmino): GetTxsEventResponse { @@ -637,6 +1049,9 @@ export const GetTxsEventResponse = { if (object.pagination !== undefined && object.pagination !== null) { message.pagination = PageResponse.fromAmino(object.pagination); } + if (object.total !== undefined && object.total !== null) { + message.total = BigInt(object.total); + } return message; }, toAmino(message: GetTxsEventResponse): GetTxsEventResponseAmino { @@ -652,6 +1067,7 @@ export const GetTxsEventResponse = { obj.tx_responses = message.txResponses; } obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + obj.total = message.total !== BigInt(0) ? message.total.toString() : undefined; return obj; }, fromAminoMsg(object: GetTxsEventResponseAminoMsg): GetTxsEventResponse { @@ -1325,4 +1741,556 @@ export const GetBlockWithTxsResponse = { value: GetBlockWithTxsResponse.encode(message).finish() }; } +}; +function createBaseTxDecodeRequest(): TxDecodeRequest { + return { + txBytes: new Uint8Array() + }; +} +export const TxDecodeRequest = { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeRequest", + encode(message: TxDecodeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.txBytes.length !== 0) { + writer.uint32(10).bytes(message.txBytes); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxDecodeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxDecodeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txBytes = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TxDecodeRequest { + const message = createBaseTxDecodeRequest(); + message.txBytes = object.txBytes ?? new Uint8Array(); + return message; + }, + fromAmino(object: TxDecodeRequestAmino): TxDecodeRequest { + const message = createBaseTxDecodeRequest(); + if (object.tx_bytes !== undefined && object.tx_bytes !== null) { + message.txBytes = bytesFromBase64(object.tx_bytes); + } + return message; + }, + toAmino(message: TxDecodeRequest): TxDecodeRequestAmino { + const obj: any = {}; + obj.tx_bytes = message.txBytes ? base64FromBytes(message.txBytes) : undefined; + return obj; + }, + fromAminoMsg(object: TxDecodeRequestAminoMsg): TxDecodeRequest { + return TxDecodeRequest.fromAmino(object.value); + }, + toAminoMsg(message: TxDecodeRequest): TxDecodeRequestAminoMsg { + return { + type: "cosmos-sdk/TxDecodeRequest", + value: TxDecodeRequest.toAmino(message) + }; + }, + fromProtoMsg(message: TxDecodeRequestProtoMsg): TxDecodeRequest { + return TxDecodeRequest.decode(message.value); + }, + toProto(message: TxDecodeRequest): Uint8Array { + return TxDecodeRequest.encode(message).finish(); + }, + toProtoMsg(message: TxDecodeRequest): TxDecodeRequestProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeRequest", + value: TxDecodeRequest.encode(message).finish() + }; + } +}; +function createBaseTxDecodeResponse(): TxDecodeResponse { + return { + tx: undefined + }; +} +export const TxDecodeResponse = { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeResponse", + encode(message: TxDecodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tx !== undefined) { + Tx.encode(message.tx, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxDecodeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxDecodeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = Tx.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TxDecodeResponse { + const message = createBaseTxDecodeResponse(); + message.tx = object.tx !== undefined && object.tx !== null ? Tx.fromPartial(object.tx) : undefined; + return message; + }, + fromAmino(object: TxDecodeResponseAmino): TxDecodeResponse { + const message = createBaseTxDecodeResponse(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = Tx.fromAmino(object.tx); + } + return message; + }, + toAmino(message: TxDecodeResponse): TxDecodeResponseAmino { + const obj: any = {}; + obj.tx = message.tx ? Tx.toAmino(message.tx) : undefined; + return obj; + }, + fromAminoMsg(object: TxDecodeResponseAminoMsg): TxDecodeResponse { + return TxDecodeResponse.fromAmino(object.value); + }, + toAminoMsg(message: TxDecodeResponse): TxDecodeResponseAminoMsg { + return { + type: "cosmos-sdk/TxDecodeResponse", + value: TxDecodeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: TxDecodeResponseProtoMsg): TxDecodeResponse { + return TxDecodeResponse.decode(message.value); + }, + toProto(message: TxDecodeResponse): Uint8Array { + return TxDecodeResponse.encode(message).finish(); + }, + toProtoMsg(message: TxDecodeResponse): TxDecodeResponseProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeResponse", + value: TxDecodeResponse.encode(message).finish() + }; + } +}; +function createBaseTxEncodeRequest(): TxEncodeRequest { + return { + tx: undefined + }; +} +export const TxEncodeRequest = { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeRequest", + encode(message: TxEncodeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tx !== undefined) { + Tx.encode(message.tx, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxEncodeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxEncodeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = Tx.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TxEncodeRequest { + const message = createBaseTxEncodeRequest(); + message.tx = object.tx !== undefined && object.tx !== null ? Tx.fromPartial(object.tx) : undefined; + return message; + }, + fromAmino(object: TxEncodeRequestAmino): TxEncodeRequest { + const message = createBaseTxEncodeRequest(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = Tx.fromAmino(object.tx); + } + return message; + }, + toAmino(message: TxEncodeRequest): TxEncodeRequestAmino { + const obj: any = {}; + obj.tx = message.tx ? Tx.toAmino(message.tx) : undefined; + return obj; + }, + fromAminoMsg(object: TxEncodeRequestAminoMsg): TxEncodeRequest { + return TxEncodeRequest.fromAmino(object.value); + }, + toAminoMsg(message: TxEncodeRequest): TxEncodeRequestAminoMsg { + return { + type: "cosmos-sdk/TxEncodeRequest", + value: TxEncodeRequest.toAmino(message) + }; + }, + fromProtoMsg(message: TxEncodeRequestProtoMsg): TxEncodeRequest { + return TxEncodeRequest.decode(message.value); + }, + toProto(message: TxEncodeRequest): Uint8Array { + return TxEncodeRequest.encode(message).finish(); + }, + toProtoMsg(message: TxEncodeRequest): TxEncodeRequestProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeRequest", + value: TxEncodeRequest.encode(message).finish() + }; + } +}; +function createBaseTxEncodeResponse(): TxEncodeResponse { + return { + txBytes: new Uint8Array() + }; +} +export const TxEncodeResponse = { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeResponse", + encode(message: TxEncodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.txBytes.length !== 0) { + writer.uint32(10).bytes(message.txBytes); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxEncodeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxEncodeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txBytes = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TxEncodeResponse { + const message = createBaseTxEncodeResponse(); + message.txBytes = object.txBytes ?? new Uint8Array(); + return message; + }, + fromAmino(object: TxEncodeResponseAmino): TxEncodeResponse { + const message = createBaseTxEncodeResponse(); + if (object.tx_bytes !== undefined && object.tx_bytes !== null) { + message.txBytes = bytesFromBase64(object.tx_bytes); + } + return message; + }, + toAmino(message: TxEncodeResponse): TxEncodeResponseAmino { + const obj: any = {}; + obj.tx_bytes = message.txBytes ? base64FromBytes(message.txBytes) : undefined; + return obj; + }, + fromAminoMsg(object: TxEncodeResponseAminoMsg): TxEncodeResponse { + return TxEncodeResponse.fromAmino(object.value); + }, + toAminoMsg(message: TxEncodeResponse): TxEncodeResponseAminoMsg { + return { + type: "cosmos-sdk/TxEncodeResponse", + value: TxEncodeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: TxEncodeResponseProtoMsg): TxEncodeResponse { + return TxEncodeResponse.decode(message.value); + }, + toProto(message: TxEncodeResponse): Uint8Array { + return TxEncodeResponse.encode(message).finish(); + }, + toProtoMsg(message: TxEncodeResponse): TxEncodeResponseProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeResponse", + value: TxEncodeResponse.encode(message).finish() + }; + } +}; +function createBaseTxEncodeAminoRequest(): TxEncodeAminoRequest { + return { + aminoJson: "" + }; +} +export const TxEncodeAminoRequest = { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeAminoRequest", + encode(message: TxEncodeAminoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.aminoJson !== "") { + writer.uint32(10).string(message.aminoJson); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxEncodeAminoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxEncodeAminoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.aminoJson = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TxEncodeAminoRequest { + const message = createBaseTxEncodeAminoRequest(); + message.aminoJson = object.aminoJson ?? ""; + return message; + }, + fromAmino(object: TxEncodeAminoRequestAmino): TxEncodeAminoRequest { + const message = createBaseTxEncodeAminoRequest(); + if (object.amino_json !== undefined && object.amino_json !== null) { + message.aminoJson = object.amino_json; + } + return message; + }, + toAmino(message: TxEncodeAminoRequest): TxEncodeAminoRequestAmino { + const obj: any = {}; + obj.amino_json = message.aminoJson === "" ? undefined : message.aminoJson; + return obj; + }, + fromAminoMsg(object: TxEncodeAminoRequestAminoMsg): TxEncodeAminoRequest { + return TxEncodeAminoRequest.fromAmino(object.value); + }, + toAminoMsg(message: TxEncodeAminoRequest): TxEncodeAminoRequestAminoMsg { + return { + type: "cosmos-sdk/TxEncodeAminoRequest", + value: TxEncodeAminoRequest.toAmino(message) + }; + }, + fromProtoMsg(message: TxEncodeAminoRequestProtoMsg): TxEncodeAminoRequest { + return TxEncodeAminoRequest.decode(message.value); + }, + toProto(message: TxEncodeAminoRequest): Uint8Array { + return TxEncodeAminoRequest.encode(message).finish(); + }, + toProtoMsg(message: TxEncodeAminoRequest): TxEncodeAminoRequestProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeAminoRequest", + value: TxEncodeAminoRequest.encode(message).finish() + }; + } +}; +function createBaseTxEncodeAminoResponse(): TxEncodeAminoResponse { + return { + aminoBinary: new Uint8Array() + }; +} +export const TxEncodeAminoResponse = { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeAminoResponse", + encode(message: TxEncodeAminoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.aminoBinary.length !== 0) { + writer.uint32(10).bytes(message.aminoBinary); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxEncodeAminoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxEncodeAminoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.aminoBinary = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TxEncodeAminoResponse { + const message = createBaseTxEncodeAminoResponse(); + message.aminoBinary = object.aminoBinary ?? new Uint8Array(); + return message; + }, + fromAmino(object: TxEncodeAminoResponseAmino): TxEncodeAminoResponse { + const message = createBaseTxEncodeAminoResponse(); + if (object.amino_binary !== undefined && object.amino_binary !== null) { + message.aminoBinary = bytesFromBase64(object.amino_binary); + } + return message; + }, + toAmino(message: TxEncodeAminoResponse): TxEncodeAminoResponseAmino { + const obj: any = {}; + obj.amino_binary = message.aminoBinary ? base64FromBytes(message.aminoBinary) : undefined; + return obj; + }, + fromAminoMsg(object: TxEncodeAminoResponseAminoMsg): TxEncodeAminoResponse { + return TxEncodeAminoResponse.fromAmino(object.value); + }, + toAminoMsg(message: TxEncodeAminoResponse): TxEncodeAminoResponseAminoMsg { + return { + type: "cosmos-sdk/TxEncodeAminoResponse", + value: TxEncodeAminoResponse.toAmino(message) + }; + }, + fromProtoMsg(message: TxEncodeAminoResponseProtoMsg): TxEncodeAminoResponse { + return TxEncodeAminoResponse.decode(message.value); + }, + toProto(message: TxEncodeAminoResponse): Uint8Array { + return TxEncodeAminoResponse.encode(message).finish(); + }, + toProtoMsg(message: TxEncodeAminoResponse): TxEncodeAminoResponseProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.TxEncodeAminoResponse", + value: TxEncodeAminoResponse.encode(message).finish() + }; + } +}; +function createBaseTxDecodeAminoRequest(): TxDecodeAminoRequest { + return { + aminoBinary: new Uint8Array() + }; +} +export const TxDecodeAminoRequest = { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeAminoRequest", + encode(message: TxDecodeAminoRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.aminoBinary.length !== 0) { + writer.uint32(10).bytes(message.aminoBinary); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxDecodeAminoRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxDecodeAminoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.aminoBinary = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TxDecodeAminoRequest { + const message = createBaseTxDecodeAminoRequest(); + message.aminoBinary = object.aminoBinary ?? new Uint8Array(); + return message; + }, + fromAmino(object: TxDecodeAminoRequestAmino): TxDecodeAminoRequest { + const message = createBaseTxDecodeAminoRequest(); + if (object.amino_binary !== undefined && object.amino_binary !== null) { + message.aminoBinary = bytesFromBase64(object.amino_binary); + } + return message; + }, + toAmino(message: TxDecodeAminoRequest): TxDecodeAminoRequestAmino { + const obj: any = {}; + obj.amino_binary = message.aminoBinary ? base64FromBytes(message.aminoBinary) : undefined; + return obj; + }, + fromAminoMsg(object: TxDecodeAminoRequestAminoMsg): TxDecodeAminoRequest { + return TxDecodeAminoRequest.fromAmino(object.value); + }, + toAminoMsg(message: TxDecodeAminoRequest): TxDecodeAminoRequestAminoMsg { + return { + type: "cosmos-sdk/TxDecodeAminoRequest", + value: TxDecodeAminoRequest.toAmino(message) + }; + }, + fromProtoMsg(message: TxDecodeAminoRequestProtoMsg): TxDecodeAminoRequest { + return TxDecodeAminoRequest.decode(message.value); + }, + toProto(message: TxDecodeAminoRequest): Uint8Array { + return TxDecodeAminoRequest.encode(message).finish(); + }, + toProtoMsg(message: TxDecodeAminoRequest): TxDecodeAminoRequestProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeAminoRequest", + value: TxDecodeAminoRequest.encode(message).finish() + }; + } +}; +function createBaseTxDecodeAminoResponse(): TxDecodeAminoResponse { + return { + aminoJson: "" + }; +} +export const TxDecodeAminoResponse = { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeAminoResponse", + encode(message: TxDecodeAminoResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.aminoJson !== "") { + writer.uint32(10).string(message.aminoJson); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TxDecodeAminoResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTxDecodeAminoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.aminoJson = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TxDecodeAminoResponse { + const message = createBaseTxDecodeAminoResponse(); + message.aminoJson = object.aminoJson ?? ""; + return message; + }, + fromAmino(object: TxDecodeAminoResponseAmino): TxDecodeAminoResponse { + const message = createBaseTxDecodeAminoResponse(); + if (object.amino_json !== undefined && object.amino_json !== null) { + message.aminoJson = object.amino_json; + } + return message; + }, + toAmino(message: TxDecodeAminoResponse): TxDecodeAminoResponseAmino { + const obj: any = {}; + obj.amino_json = message.aminoJson === "" ? undefined : message.aminoJson; + return obj; + }, + fromAminoMsg(object: TxDecodeAminoResponseAminoMsg): TxDecodeAminoResponse { + return TxDecodeAminoResponse.fromAmino(object.value); + }, + toAminoMsg(message: TxDecodeAminoResponse): TxDecodeAminoResponseAminoMsg { + return { + type: "cosmos-sdk/TxDecodeAminoResponse", + value: TxDecodeAminoResponse.toAmino(message) + }; + }, + fromProtoMsg(message: TxDecodeAminoResponseProtoMsg): TxDecodeAminoResponse { + return TxDecodeAminoResponse.decode(message.value); + }, + toProto(message: TxDecodeAminoResponse): Uint8Array { + return TxDecodeAminoResponse.encode(message).finish(); + }, + toProtoMsg(message: TxDecodeAminoResponse): TxDecodeAminoResponseProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.TxDecodeAminoResponse", + value: TxDecodeAminoResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/src/codegen/cosmos/tx/v1beta1/tx.ts b/src/codegen/cosmos/tx/v1beta1/tx.ts index 134d3a3..94acd08 100644 --- a/src/codegen/cosmos/tx/v1beta1/tx.ts +++ b/src/codegen/cosmos/tx/v1beta1/tx.ts @@ -177,6 +177,85 @@ export interface SignDocSDKType { chain_id: string; account_number: bigint; } +/** + * SignDocDirectAux is the type used for generating sign bytes for + * SIGN_MODE_DIRECT_AUX. + * + * Since: cosmos-sdk 0.46 + */ +export interface SignDocDirectAux { + /** + * body_bytes is protobuf serialization of a TxBody that matches the + * representation in TxRaw. + */ + bodyBytes: Uint8Array; + /** public_key is the public key of the signing account. */ + publicKey?: Any; + /** + * chain_id is the identifier of the chain this transaction targets. + * It prevents signed transactions from being used on another chain by an + * attacker. + */ + chainId: string; + /** account_number is the account number of the account in state. */ + accountNumber: bigint; + /** sequence is the sequence number of the signing account. */ + sequence: bigint; + /** tips have been depreacted and should not be used */ + /** @deprecated */ + tip?: Tip; +} +export interface SignDocDirectAuxProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.SignDocDirectAux"; + value: Uint8Array; +} +/** + * SignDocDirectAux is the type used for generating sign bytes for + * SIGN_MODE_DIRECT_AUX. + * + * Since: cosmos-sdk 0.46 + */ +export interface SignDocDirectAuxAmino { + /** + * body_bytes is protobuf serialization of a TxBody that matches the + * representation in TxRaw. + */ + body_bytes?: string; + /** public_key is the public key of the signing account. */ + public_key?: AnyAmino; + /** + * chain_id is the identifier of the chain this transaction targets. + * It prevents signed transactions from being used on another chain by an + * attacker. + */ + chain_id?: string; + /** account_number is the account number of the account in state. */ + account_number?: string; + /** sequence is the sequence number of the signing account. */ + sequence?: string; + /** tips have been depreacted and should not be used */ + /** @deprecated */ + tip?: TipAmino; +} +export interface SignDocDirectAuxAminoMsg { + type: "cosmos-sdk/SignDocDirectAux"; + value: SignDocDirectAuxAmino; +} +/** + * SignDocDirectAux is the type used for generating sign bytes for + * SIGN_MODE_DIRECT_AUX. + * + * Since: cosmos-sdk 0.46 + */ +export interface SignDocDirectAuxSDKType { + body_bytes: Uint8Array; + public_key?: AnySDKType; + chain_id: string; + account_number: bigint; + sequence: bigint; + /** @deprecated */ + tip?: TipSDKType; +} /** TxBody is the body of a transaction that all signers sign over. */ export interface TxBody { /** @@ -284,6 +363,16 @@ export interface AuthInfo { * of the signers. This can be estimated via simulation. */ fee?: Fee; + /** + * Tip is the optional tip used for transactions fees paid in another denom. + * + * This field is ignored if the chain didn't enable tips, i.e. didn't add the + * `TipDecorator` in its posthandler. + * + * Since: cosmos-sdk 0.46 + */ + /** @deprecated */ + tip?: Tip; } export interface AuthInfoProtoMsg { typeUrl: "/cosmos.tx.v1beta1.AuthInfo"; @@ -308,6 +397,16 @@ export interface AuthInfoAmino { * of the signers. This can be estimated via simulation. */ fee?: FeeAmino; + /** + * Tip is the optional tip used for transactions fees paid in another denom. + * + * This field is ignored if the chain didn't enable tips, i.e. didn't add the + * `TipDecorator` in its posthandler. + * + * Since: cosmos-sdk 0.46 + */ + /** @deprecated */ + tip?: TipAmino; } export interface AuthInfoAminoMsg { type: "cosmos-sdk/AuthInfo"; @@ -320,6 +419,8 @@ export interface AuthInfoAminoMsg { export interface AuthInfoSDKType { signer_infos: SignerInfoSDKType[]; fee?: FeeSDKType; + /** @deprecated */ + tip?: TipSDKType; } /** * SignerInfo describes the public key and signing mode of a single top-level @@ -515,7 +616,7 @@ export interface FeeProtoMsg { */ export interface FeeAmino { /** amount is the amount of coins to be paid as a fee */ - amount?: CoinAmino[]; + amount: CoinAmino[]; /** * gas_limit is the maximum gas that can be used in transaction processing * before an out of gas error occurs @@ -549,6 +650,122 @@ export interface FeeSDKType { payer: string; granter: string; } +/** + * Tip is the tip used for meta-transactions. + * + * Since: cosmos-sdk 0.46 + */ +/** @deprecated */ +export interface Tip { + /** amount is the amount of the tip */ + amount: Coin[]; + /** tipper is the address of the account paying for the tip */ + tipper: string; +} +export interface TipProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.Tip"; + value: Uint8Array; +} +/** + * Tip is the tip used for meta-transactions. + * + * Since: cosmos-sdk 0.46 + */ +/** @deprecated */ +export interface TipAmino { + /** amount is the amount of the tip */ + amount: CoinAmino[]; + /** tipper is the address of the account paying for the tip */ + tipper?: string; +} +export interface TipAminoMsg { + type: "cosmos-sdk/Tip"; + value: TipAmino; +} +/** + * Tip is the tip used for meta-transactions. + * + * Since: cosmos-sdk 0.46 + */ +/** @deprecated */ +export interface TipSDKType { + amount: CoinSDKType[]; + tipper: string; +} +/** + * AuxSignerData is the intermediary format that an auxiliary signer (e.g. a + * tipper) builds and sends to the fee payer (who will build and broadcast the + * actual tx). AuxSignerData is not a valid tx in itself, and will be rejected + * by the node if sent directly as-is. + * + * Since: cosmos-sdk 0.46 + */ +export interface AuxSignerData { + /** + * address is the bech32-encoded address of the auxiliary signer. If using + * AuxSignerData across different chains, the bech32 prefix of the target + * chain (where the final transaction is broadcasted) should be used. + */ + address: string; + /** + * sign_doc is the SIGN_MODE_DIRECT_AUX sign doc that the auxiliary signer + * signs. Note: we use the same sign doc even if we're signing with + * LEGACY_AMINO_JSON. + */ + signDoc?: SignDocDirectAux; + /** mode is the signing mode of the single signer. */ + mode: SignMode; + /** sig is the signature of the sign doc. */ + sig: Uint8Array; +} +export interface AuxSignerDataProtoMsg { + typeUrl: "/cosmos.tx.v1beta1.AuxSignerData"; + value: Uint8Array; +} +/** + * AuxSignerData is the intermediary format that an auxiliary signer (e.g. a + * tipper) builds and sends to the fee payer (who will build and broadcast the + * actual tx). AuxSignerData is not a valid tx in itself, and will be rejected + * by the node if sent directly as-is. + * + * Since: cosmos-sdk 0.46 + */ +export interface AuxSignerDataAmino { + /** + * address is the bech32-encoded address of the auxiliary signer. If using + * AuxSignerData across different chains, the bech32 prefix of the target + * chain (where the final transaction is broadcasted) should be used. + */ + address?: string; + /** + * sign_doc is the SIGN_MODE_DIRECT_AUX sign doc that the auxiliary signer + * signs. Note: we use the same sign doc even if we're signing with + * LEGACY_AMINO_JSON. + */ + sign_doc?: SignDocDirectAuxAmino; + /** mode is the signing mode of the single signer. */ + mode?: SignMode; + /** sig is the signature of the sign doc. */ + sig?: string; +} +export interface AuxSignerDataAminoMsg { + type: "cosmos-sdk/AuxSignerData"; + value: AuxSignerDataAmino; +} +/** + * AuxSignerData is the intermediary format that an auxiliary signer (e.g. a + * tipper) builds and sends to the fee payer (who will build and broadcast the + * actual tx). AuxSignerData is not a valid tx in itself, and will be rejected + * by the node if sent directly as-is. + * + * Since: cosmos-sdk 0.46 + */ +export interface AuxSignerDataSDKType { + address: string; + sign_doc?: SignDocDirectAuxSDKType; + mode: SignMode; + sig: Uint8Array; +} function createBaseTx(): Tx { return { body: undefined, @@ -844,6 +1061,135 @@ export const SignDoc = { }; } }; +function createBaseSignDocDirectAux(): SignDocDirectAux { + return { + bodyBytes: new Uint8Array(), + publicKey: undefined, + chainId: "", + accountNumber: BigInt(0), + sequence: BigInt(0), + tip: undefined + }; +} +export const SignDocDirectAux = { + typeUrl: "/cosmos.tx.v1beta1.SignDocDirectAux", + encode(message: SignDocDirectAux, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.bodyBytes.length !== 0) { + writer.uint32(10).bytes(message.bodyBytes); + } + if (message.publicKey !== undefined) { + Any.encode(message.publicKey, writer.uint32(18).fork()).ldelim(); + } + if (message.chainId !== "") { + writer.uint32(26).string(message.chainId); + } + if (message.accountNumber !== BigInt(0)) { + writer.uint32(32).uint64(message.accountNumber); + } + if (message.sequence !== BigInt(0)) { + writer.uint32(40).uint64(message.sequence); + } + if (message.tip !== undefined) { + Tip.encode(message.tip, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignDocDirectAux { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignDocDirectAux(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bodyBytes = reader.bytes(); + break; + case 2: + message.publicKey = Any.decode(reader, reader.uint32()); + break; + case 3: + message.chainId = reader.string(); + break; + case 4: + message.accountNumber = reader.uint64(); + break; + case 5: + message.sequence = reader.uint64(); + break; + case 6: + message.tip = Tip.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SignDocDirectAux { + const message = createBaseSignDocDirectAux(); + message.bodyBytes = object.bodyBytes ?? new Uint8Array(); + message.publicKey = object.publicKey !== undefined && object.publicKey !== null ? Any.fromPartial(object.publicKey) : undefined; + message.chainId = object.chainId ?? ""; + message.accountNumber = object.accountNumber !== undefined && object.accountNumber !== null ? BigInt(object.accountNumber.toString()) : BigInt(0); + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + message.tip = object.tip !== undefined && object.tip !== null ? Tip.fromPartial(object.tip) : undefined; + return message; + }, + fromAmino(object: SignDocDirectAuxAmino): SignDocDirectAux { + const message = createBaseSignDocDirectAux(); + if (object.body_bytes !== undefined && object.body_bytes !== null) { + message.bodyBytes = bytesFromBase64(object.body_bytes); + } + if (object.public_key !== undefined && object.public_key !== null) { + message.publicKey = Any.fromAmino(object.public_key); + } + if (object.chain_id !== undefined && object.chain_id !== null) { + message.chainId = object.chain_id; + } + if (object.account_number !== undefined && object.account_number !== null) { + message.accountNumber = BigInt(object.account_number); + } + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.tip !== undefined && object.tip !== null) { + message.tip = Tip.fromAmino(object.tip); + } + return message; + }, + toAmino(message: SignDocDirectAux): SignDocDirectAuxAmino { + const obj: any = {}; + obj.body_bytes = message.bodyBytes ? base64FromBytes(message.bodyBytes) : undefined; + obj.public_key = message.publicKey ? Any.toAmino(message.publicKey) : undefined; + obj.chain_id = message.chainId === "" ? undefined : message.chainId; + obj.account_number = message.accountNumber !== BigInt(0) ? message.accountNumber.toString() : undefined; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; + obj.tip = message.tip ? Tip.toAmino(message.tip) : undefined; + return obj; + }, + fromAminoMsg(object: SignDocDirectAuxAminoMsg): SignDocDirectAux { + return SignDocDirectAux.fromAmino(object.value); + }, + toAminoMsg(message: SignDocDirectAux): SignDocDirectAuxAminoMsg { + return { + type: "cosmos-sdk/SignDocDirectAux", + value: SignDocDirectAux.toAmino(message) + }; + }, + fromProtoMsg(message: SignDocDirectAuxProtoMsg): SignDocDirectAux { + return SignDocDirectAux.decode(message.value); + }, + toProto(message: SignDocDirectAux): Uint8Array { + return SignDocDirectAux.encode(message).finish(); + }, + toProtoMsg(message: SignDocDirectAux): SignDocDirectAuxProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.SignDocDirectAux", + value: SignDocDirectAux.encode(message).finish() + }; + } +}; function createBaseTxBody(): TxBody { return { messages: [], @@ -970,7 +1316,8 @@ export const TxBody = { function createBaseAuthInfo(): AuthInfo { return { signerInfos: [], - fee: undefined + fee: undefined, + tip: undefined }; } export const AuthInfo = { @@ -982,6 +1329,9 @@ export const AuthInfo = { if (message.fee !== undefined) { Fee.encode(message.fee, writer.uint32(18).fork()).ldelim(); } + if (message.tip !== undefined) { + Tip.encode(message.tip, writer.uint32(26).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): AuthInfo { @@ -997,6 +1347,9 @@ export const AuthInfo = { case 2: message.fee = Fee.decode(reader, reader.uint32()); break; + case 3: + message.tip = Tip.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -1008,6 +1361,7 @@ export const AuthInfo = { const message = createBaseAuthInfo(); message.signerInfos = object.signerInfos?.map(e => SignerInfo.fromPartial(e)) || []; message.fee = object.fee !== undefined && object.fee !== null ? Fee.fromPartial(object.fee) : undefined; + message.tip = object.tip !== undefined && object.tip !== null ? Tip.fromPartial(object.tip) : undefined; return message; }, fromAmino(object: AuthInfoAmino): AuthInfo { @@ -1016,6 +1370,9 @@ export const AuthInfo = { if (object.fee !== undefined && object.fee !== null) { message.fee = Fee.fromAmino(object.fee); } + if (object.tip !== undefined && object.tip !== null) { + message.tip = Tip.fromAmino(object.tip); + } return message; }, toAmino(message: AuthInfo): AuthInfoAmino { @@ -1026,6 +1383,7 @@ export const AuthInfo = { obj.signer_infos = message.signerInfos; } obj.fee = message.fee ? Fee.toAmino(message.fee) : undefined; + obj.tip = message.tip ? Tip.toAmino(message.tip) : undefined; return obj; }, fromAminoMsg(object: AuthInfoAminoMsg): AuthInfo { @@ -1482,4 +1840,192 @@ export const Fee = { value: Fee.encode(message).finish() }; } +}; +function createBaseTip(): Tip { + return { + amount: [], + tipper: "" + }; +} +export const Tip = { + typeUrl: "/cosmos.tx.v1beta1.Tip", + encode(message: Tip, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.tipper !== "") { + writer.uint32(18).string(message.tipper); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Tip { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTip(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.tipper = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Tip { + const message = createBaseTip(); + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + message.tipper = object.tipper ?? ""; + return message; + }, + fromAmino(object: TipAmino): Tip { + const message = createBaseTip(); + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + if (object.tipper !== undefined && object.tipper !== null) { + message.tipper = object.tipper; + } + return message; + }, + toAmino(message: Tip): TipAmino { + const obj: any = {}; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = message.amount; + } + obj.tipper = message.tipper === "" ? undefined : message.tipper; + return obj; + }, + fromAminoMsg(object: TipAminoMsg): Tip { + return Tip.fromAmino(object.value); + }, + toAminoMsg(message: Tip): TipAminoMsg { + return { + type: "cosmos-sdk/Tip", + value: Tip.toAmino(message) + }; + }, + fromProtoMsg(message: TipProtoMsg): Tip { + return Tip.decode(message.value); + }, + toProto(message: Tip): Uint8Array { + return Tip.encode(message).finish(); + }, + toProtoMsg(message: Tip): TipProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.Tip", + value: Tip.encode(message).finish() + }; + } +}; +function createBaseAuxSignerData(): AuxSignerData { + return { + address: "", + signDoc: undefined, + mode: 0, + sig: new Uint8Array() + }; +} +export const AuxSignerData = { + typeUrl: "/cosmos.tx.v1beta1.AuxSignerData", + encode(message: AuxSignerData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.signDoc !== undefined) { + SignDocDirectAux.encode(message.signDoc, writer.uint32(18).fork()).ldelim(); + } + if (message.mode !== 0) { + writer.uint32(24).int32(message.mode); + } + if (message.sig.length !== 0) { + writer.uint32(34).bytes(message.sig); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AuxSignerData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAuxSignerData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.signDoc = SignDocDirectAux.decode(reader, reader.uint32()); + break; + case 3: + message.mode = (reader.int32() as any); + break; + case 4: + message.sig = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AuxSignerData { + const message = createBaseAuxSignerData(); + message.address = object.address ?? ""; + message.signDoc = object.signDoc !== undefined && object.signDoc !== null ? SignDocDirectAux.fromPartial(object.signDoc) : undefined; + message.mode = object.mode ?? 0; + message.sig = object.sig ?? new Uint8Array(); + return message; + }, + fromAmino(object: AuxSignerDataAmino): AuxSignerData { + const message = createBaseAuxSignerData(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.sign_doc !== undefined && object.sign_doc !== null) { + message.signDoc = SignDocDirectAux.fromAmino(object.sign_doc); + } + if (object.mode !== undefined && object.mode !== null) { + message.mode = object.mode; + } + if (object.sig !== undefined && object.sig !== null) { + message.sig = bytesFromBase64(object.sig); + } + return message; + }, + toAmino(message: AuxSignerData): AuxSignerDataAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.sign_doc = message.signDoc ? SignDocDirectAux.toAmino(message.signDoc) : undefined; + obj.mode = message.mode === 0 ? undefined : message.mode; + obj.sig = message.sig ? base64FromBytes(message.sig) : undefined; + return obj; + }, + fromAminoMsg(object: AuxSignerDataAminoMsg): AuxSignerData { + return AuxSignerData.fromAmino(object.value); + }, + toAminoMsg(message: AuxSignerData): AuxSignerDataAminoMsg { + return { + type: "cosmos-sdk/AuxSignerData", + value: AuxSignerData.toAmino(message) + }; + }, + fromProtoMsg(message: AuxSignerDataProtoMsg): AuxSignerData { + return AuxSignerData.decode(message.value); + }, + toProto(message: AuxSignerData): Uint8Array { + return AuxSignerData.encode(message).finish(); + }, + toProtoMsg(message: AuxSignerData): AuxSignerDataProtoMsg { + return { + typeUrl: "/cosmos.tx.v1beta1.AuxSignerData", + value: AuxSignerData.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/src/codegen/cosmos/upgrade/v1beta1/query.lcd.ts b/src/codegen/cosmos/upgrade/v1beta1/query.lcd.ts index 49a57f7..40543d6 100644 --- a/src/codegen/cosmos/upgrade/v1beta1/query.lcd.ts +++ b/src/codegen/cosmos/upgrade/v1beta1/query.lcd.ts @@ -1,5 +1,5 @@ import { LCDClient } from "@cosmology/lcd"; -import { QueryCurrentPlanRequest, QueryCurrentPlanResponseSDKType, QueryAppliedPlanRequest, QueryAppliedPlanResponseSDKType, QueryUpgradedConsensusStateRequest, QueryUpgradedConsensusStateResponseSDKType, QueryModuleVersionsRequest, QueryModuleVersionsResponseSDKType } from "./query"; +import { QueryCurrentPlanRequest, QueryCurrentPlanResponseSDKType, QueryAppliedPlanRequest, QueryAppliedPlanResponseSDKType, QueryUpgradedConsensusStateRequest, QueryUpgradedConsensusStateResponseSDKType, QueryModuleVersionsRequest, QueryModuleVersionsResponseSDKType, QueryAuthorityRequest, QueryAuthorityResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -12,6 +12,7 @@ export class LCDQueryClient { this.appliedPlan = this.appliedPlan.bind(this); this.upgradedConsensusState = this.upgradedConsensusState.bind(this); this.moduleVersions = this.moduleVersions.bind(this); + this.authority = this.authority.bind(this); } /* CurrentPlan queries the current upgrade plan. */ async currentPlan(_params: QueryCurrentPlanRequest = {}): Promise { @@ -46,4 +47,11 @@ export class LCDQueryClient { const endpoint = `cosmos/upgrade/v1beta1/module_versions`; return await this.req.get(endpoint, options); } + /* Returns the account with authority to conduct upgrades + + Since: cosmos-sdk 0.46 */ + async authority(_params: QueryAuthorityRequest = {}): Promise { + const endpoint = `cosmos/upgrade/v1beta1/authority`; + return await this.req.get(endpoint); + } } \ No newline at end of file diff --git a/src/codegen/cosmos/upgrade/v1beta1/query.rpc.Query.ts b/src/codegen/cosmos/upgrade/v1beta1/query.rpc.Query.ts index df47fb3..042c6fd 100644 --- a/src/codegen/cosmos/upgrade/v1beta1/query.rpc.Query.ts +++ b/src/codegen/cosmos/upgrade/v1beta1/query.rpc.Query.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryCurrentPlanRequest, QueryCurrentPlanResponse, QueryAppliedPlanRequest, QueryAppliedPlanResponse, QueryUpgradedConsensusStateRequest, QueryUpgradedConsensusStateResponse, QueryModuleVersionsRequest, QueryModuleVersionsResponse } from "./query"; +import { QueryCurrentPlanRequest, QueryCurrentPlanResponse, QueryAppliedPlanRequest, QueryAppliedPlanResponse, QueryUpgradedConsensusStateRequest, QueryUpgradedConsensusStateResponse, QueryModuleVersionsRequest, QueryModuleVersionsResponse, QueryAuthorityRequest, QueryAuthorityResponse } from "./query"; /** Query defines the gRPC upgrade querier service. */ export interface Query { /** CurrentPlan queries the current upgrade plan. */ @@ -23,6 +23,12 @@ export interface Query { * Since: cosmos-sdk 0.43 */ moduleVersions(request: QueryModuleVersionsRequest): Promise; + /** + * Returns the account with authority to conduct upgrades + * + * Since: cosmos-sdk 0.46 + */ + authority(request?: QueryAuthorityRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -32,6 +38,7 @@ export class QueryClientImpl implements Query { this.appliedPlan = this.appliedPlan.bind(this); this.upgradedConsensusState = this.upgradedConsensusState.bind(this); this.moduleVersions = this.moduleVersions.bind(this); + this.authority = this.authority.bind(this); } currentPlan(request: QueryCurrentPlanRequest = {}): Promise { const data = QueryCurrentPlanRequest.encode(request).finish(); @@ -53,6 +60,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("cosmos.upgrade.v1beta1.Query", "ModuleVersions", data); return promise.then(data => QueryModuleVersionsResponse.decode(new BinaryReader(data))); } + authority(request: QueryAuthorityRequest = {}): Promise { + const data = QueryAuthorityRequest.encode(request).finish(); + const promise = this.rpc.request("cosmos.upgrade.v1beta1.Query", "Authority", data); + return promise.then(data => QueryAuthorityResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -69,6 +81,9 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, moduleVersions(request: QueryModuleVersionsRequest): Promise { return queryService.moduleVersions(request); + }, + authority(request?: QueryAuthorityRequest): Promise { + return queryService.authority(request); } }; }; \ No newline at end of file diff --git a/src/codegen/cosmos/upgrade/v1beta1/query.ts b/src/codegen/cosmos/upgrade/v1beta1/query.ts index 87614e6..84bfc4b 100644 --- a/src/codegen/cosmos/upgrade/v1beta1/query.ts +++ b/src/codegen/cosmos/upgrade/v1beta1/query.ts @@ -273,6 +273,64 @@ export interface QueryModuleVersionsResponseAminoMsg { export interface QueryModuleVersionsResponseSDKType { module_versions: ModuleVersionSDKType[]; } +/** + * QueryAuthorityRequest is the request type for Query/Authority + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryAuthorityRequest {} +export interface QueryAuthorityRequestProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAuthorityRequest"; + value: Uint8Array; +} +/** + * QueryAuthorityRequest is the request type for Query/Authority + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryAuthorityRequestAmino {} +export interface QueryAuthorityRequestAminoMsg { + type: "cosmos-sdk/QueryAuthorityRequest"; + value: QueryAuthorityRequestAmino; +} +/** + * QueryAuthorityRequest is the request type for Query/Authority + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryAuthorityRequestSDKType {} +/** + * QueryAuthorityResponse is the response type for Query/Authority + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryAuthorityResponse { + address: string; +} +export interface QueryAuthorityResponseProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAuthorityResponse"; + value: Uint8Array; +} +/** + * QueryAuthorityResponse is the response type for Query/Authority + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryAuthorityResponseAmino { + address?: string; +} +export interface QueryAuthorityResponseAminoMsg { + type: "cosmos-sdk/QueryAuthorityResponse"; + value: QueryAuthorityResponseAmino; +} +/** + * QueryAuthorityResponse is the response type for Query/Authority + * + * Since: cosmos-sdk 0.46 + */ +export interface QueryAuthorityResponseSDKType { + address: string; +} function createBaseQueryCurrentPlanRequest(): QueryCurrentPlanRequest { return {}; } @@ -813,4 +871,129 @@ export const QueryModuleVersionsResponse = { value: QueryModuleVersionsResponse.encode(message).finish() }; } +}; +function createBaseQueryAuthorityRequest(): QueryAuthorityRequest { + return {}; +} +export const QueryAuthorityRequest = { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAuthorityRequest", + encode(_: QueryAuthorityRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAuthorityRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAuthorityRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryAuthorityRequest { + const message = createBaseQueryAuthorityRequest(); + return message; + }, + fromAmino(_: QueryAuthorityRequestAmino): QueryAuthorityRequest { + const message = createBaseQueryAuthorityRequest(); + return message; + }, + toAmino(_: QueryAuthorityRequest): QueryAuthorityRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryAuthorityRequestAminoMsg): QueryAuthorityRequest { + return QueryAuthorityRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAuthorityRequest): QueryAuthorityRequestAminoMsg { + return { + type: "cosmos-sdk/QueryAuthorityRequest", + value: QueryAuthorityRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAuthorityRequestProtoMsg): QueryAuthorityRequest { + return QueryAuthorityRequest.decode(message.value); + }, + toProto(message: QueryAuthorityRequest): Uint8Array { + return QueryAuthorityRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryAuthorityRequest): QueryAuthorityRequestProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAuthorityRequest", + value: QueryAuthorityRequest.encode(message).finish() + }; + } +}; +function createBaseQueryAuthorityResponse(): QueryAuthorityResponse { + return { + address: "" + }; +} +export const QueryAuthorityResponse = { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAuthorityResponse", + encode(message: QueryAuthorityResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryAuthorityResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAuthorityResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryAuthorityResponse { + const message = createBaseQueryAuthorityResponse(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryAuthorityResponseAmino): QueryAuthorityResponse { + const message = createBaseQueryAuthorityResponse(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryAuthorityResponse): QueryAuthorityResponseAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: QueryAuthorityResponseAminoMsg): QueryAuthorityResponse { + return QueryAuthorityResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAuthorityResponse): QueryAuthorityResponseAminoMsg { + return { + type: "cosmos-sdk/QueryAuthorityResponse", + value: QueryAuthorityResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAuthorityResponseProtoMsg): QueryAuthorityResponse { + return QueryAuthorityResponse.decode(message.value); + }, + toProto(message: QueryAuthorityResponse): Uint8Array { + return QueryAuthorityResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryAuthorityResponse): QueryAuthorityResponseProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.QueryAuthorityResponse", + value: QueryAuthorityResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/src/codegen/cosmos/upgrade/v1beta1/tx.amino.ts b/src/codegen/cosmos/upgrade/v1beta1/tx.amino.ts new file mode 100644 index 0000000..1734b0f --- /dev/null +++ b/src/codegen/cosmos/upgrade/v1beta1/tx.amino.ts @@ -0,0 +1,13 @@ +import { MsgSoftwareUpgrade, MsgCancelUpgrade } from "./tx"; +export const AminoConverter = { + "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade": { + aminoType: "cosmos-sdk/MsgSoftwareUpgrade", + toAmino: MsgSoftwareUpgrade.toAmino, + fromAmino: MsgSoftwareUpgrade.fromAmino + }, + "/cosmos.upgrade.v1beta1.MsgCancelUpgrade": { + aminoType: "cosmos-sdk/MsgCancelUpgrade", + toAmino: MsgCancelUpgrade.toAmino, + fromAmino: MsgCancelUpgrade.fromAmino + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/upgrade/v1beta1/tx.registry.ts b/src/codegen/cosmos/upgrade/v1beta1/tx.registry.ts new file mode 100644 index 0000000..d7bcb32 --- /dev/null +++ b/src/codegen/cosmos/upgrade/v1beta1/tx.registry.ts @@ -0,0 +1,52 @@ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgSoftwareUpgrade, MsgCancelUpgrade } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", MsgSoftwareUpgrade], ["/cosmos.upgrade.v1beta1.MsgCancelUpgrade", MsgCancelUpgrade]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + softwareUpgrade(value: MsgSoftwareUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", + value: MsgSoftwareUpgrade.encode(value).finish() + }; + }, + cancelUpgrade(value: MsgCancelUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade", + value: MsgCancelUpgrade.encode(value).finish() + }; + } + }, + withTypeUrl: { + softwareUpgrade(value: MsgSoftwareUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", + value + }; + }, + cancelUpgrade(value: MsgCancelUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade", + value + }; + } + }, + fromPartial: { + softwareUpgrade(value: MsgSoftwareUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", + value: MsgSoftwareUpgrade.fromPartial(value) + }; + }, + cancelUpgrade(value: MsgCancelUpgrade) { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade", + value: MsgCancelUpgrade.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/upgrade/v1beta1/tx.rpc.msg.ts b/src/codegen/cosmos/upgrade/v1beta1/tx.rpc.msg.ts new file mode 100644 index 0000000..04f8d62 --- /dev/null +++ b/src/codegen/cosmos/upgrade/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,37 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgSoftwareUpgrade, MsgSoftwareUpgradeResponse, MsgCancelUpgrade, MsgCancelUpgradeResponse } from "./tx"; +/** Msg defines the upgrade Msg service. */ +export interface Msg { + /** + * SoftwareUpgrade is a governance operation for initiating a software upgrade. + * + * Since: cosmos-sdk 0.46 + */ + softwareUpgrade(request: MsgSoftwareUpgrade): Promise; + /** + * CancelUpgrade is a governance operation for cancelling a previously + * approved software upgrade. + * + * Since: cosmos-sdk 0.46 + */ + cancelUpgrade(request: MsgCancelUpgrade): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.softwareUpgrade = this.softwareUpgrade.bind(this); + this.cancelUpgrade = this.cancelUpgrade.bind(this); + } + softwareUpgrade(request: MsgSoftwareUpgrade): Promise { + const data = MsgSoftwareUpgrade.encode(request).finish(); + const promise = this.rpc.request("cosmos.upgrade.v1beta1.Msg", "SoftwareUpgrade", data); + return promise.then(data => MsgSoftwareUpgradeResponse.decode(new BinaryReader(data))); + } + cancelUpgrade(request: MsgCancelUpgrade): Promise { + const data = MsgCancelUpgrade.encode(request).finish(); + const promise = this.rpc.request("cosmos.upgrade.v1beta1.Msg", "CancelUpgrade", data); + return promise.then(data => MsgCancelUpgradeResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/src/codegen/cosmos/upgrade/v1beta1/tx.ts b/src/codegen/cosmos/upgrade/v1beta1/tx.ts new file mode 100644 index 0000000..f85e0ae --- /dev/null +++ b/src/codegen/cosmos/upgrade/v1beta1/tx.ts @@ -0,0 +1,389 @@ +import { Plan, PlanAmino, PlanSDKType } from "./upgrade"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgrade { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** plan is the upgrade plan. */ + plan: Plan; +} +export interface MsgSoftwareUpgradeProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade"; + value: Uint8Array; +} +/** + * MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgradeAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; + /** plan is the upgrade plan. */ + plan: PlanAmino; +} +export interface MsgSoftwareUpgradeAminoMsg { + type: "cosmos-sdk/MsgSoftwareUpgrade"; + value: MsgSoftwareUpgradeAmino; +} +/** + * MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgradeSDKType { + authority: string; + plan: PlanSDKType; +} +/** + * MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgradeResponse {} +export interface MsgSoftwareUpgradeResponseProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse"; + value: Uint8Array; +} +/** + * MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgradeResponseAmino {} +export interface MsgSoftwareUpgradeResponseAminoMsg { + type: "cosmos-sdk/MsgSoftwareUpgradeResponse"; + value: MsgSoftwareUpgradeResponseAmino; +} +/** + * MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgSoftwareUpgradeResponseSDKType {} +/** + * MsgCancelUpgrade is the Msg/CancelUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgrade { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; +} +export interface MsgCancelUpgradeProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade"; + value: Uint8Array; +} +/** + * MsgCancelUpgrade is the Msg/CancelUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgradeAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; +} +export interface MsgCancelUpgradeAminoMsg { + type: "cosmos-sdk/MsgCancelUpgrade"; + value: MsgCancelUpgradeAmino; +} +/** + * MsgCancelUpgrade is the Msg/CancelUpgrade request type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgradeSDKType { + authority: string; +} +/** + * MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgradeResponse {} +export interface MsgCancelUpgradeResponseProtoMsg { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgradeResponse"; + value: Uint8Array; +} +/** + * MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgradeResponseAmino {} +export interface MsgCancelUpgradeResponseAminoMsg { + type: "cosmos-sdk/MsgCancelUpgradeResponse"; + value: MsgCancelUpgradeResponseAmino; +} +/** + * MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCancelUpgradeResponseSDKType {} +function createBaseMsgSoftwareUpgrade(): MsgSoftwareUpgrade { + return { + authority: "", + plan: Plan.fromPartial({}) + }; +} +export const MsgSoftwareUpgrade = { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", + encode(message: MsgSoftwareUpgrade, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.plan !== undefined) { + Plan.encode(message.plan, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSoftwareUpgrade { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSoftwareUpgrade(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.plan = Plan.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSoftwareUpgrade { + const message = createBaseMsgSoftwareUpgrade(); + message.authority = object.authority ?? ""; + message.plan = object.plan !== undefined && object.plan !== null ? Plan.fromPartial(object.plan) : undefined; + return message; + }, + fromAmino(object: MsgSoftwareUpgradeAmino): MsgSoftwareUpgrade { + const message = createBaseMsgSoftwareUpgrade(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.plan !== undefined && object.plan !== null) { + message.plan = Plan.fromAmino(object.plan); + } + return message; + }, + toAmino(message: MsgSoftwareUpgrade): MsgSoftwareUpgradeAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.plan = message.plan ? Plan.toAmino(message.plan) : Plan.toAmino(Plan.fromPartial({})); + return obj; + }, + fromAminoMsg(object: MsgSoftwareUpgradeAminoMsg): MsgSoftwareUpgrade { + return MsgSoftwareUpgrade.fromAmino(object.value); + }, + toAminoMsg(message: MsgSoftwareUpgrade): MsgSoftwareUpgradeAminoMsg { + return { + type: "cosmos-sdk/MsgSoftwareUpgrade", + value: MsgSoftwareUpgrade.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSoftwareUpgradeProtoMsg): MsgSoftwareUpgrade { + return MsgSoftwareUpgrade.decode(message.value); + }, + toProto(message: MsgSoftwareUpgrade): Uint8Array { + return MsgSoftwareUpgrade.encode(message).finish(); + }, + toProtoMsg(message: MsgSoftwareUpgrade): MsgSoftwareUpgradeProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", + value: MsgSoftwareUpgrade.encode(message).finish() + }; + } +}; +function createBaseMsgSoftwareUpgradeResponse(): MsgSoftwareUpgradeResponse { + return {}; +} +export const MsgSoftwareUpgradeResponse = { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse", + encode(_: MsgSoftwareUpgradeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSoftwareUpgradeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSoftwareUpgradeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSoftwareUpgradeResponse { + const message = createBaseMsgSoftwareUpgradeResponse(); + return message; + }, + fromAmino(_: MsgSoftwareUpgradeResponseAmino): MsgSoftwareUpgradeResponse { + const message = createBaseMsgSoftwareUpgradeResponse(); + return message; + }, + toAmino(_: MsgSoftwareUpgradeResponse): MsgSoftwareUpgradeResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSoftwareUpgradeResponseAminoMsg): MsgSoftwareUpgradeResponse { + return MsgSoftwareUpgradeResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSoftwareUpgradeResponse): MsgSoftwareUpgradeResponseAminoMsg { + return { + type: "cosmos-sdk/MsgSoftwareUpgradeResponse", + value: MsgSoftwareUpgradeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSoftwareUpgradeResponseProtoMsg): MsgSoftwareUpgradeResponse { + return MsgSoftwareUpgradeResponse.decode(message.value); + }, + toProto(message: MsgSoftwareUpgradeResponse): Uint8Array { + return MsgSoftwareUpgradeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSoftwareUpgradeResponse): MsgSoftwareUpgradeResponseProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse", + value: MsgSoftwareUpgradeResponse.encode(message).finish() + }; + } +}; +function createBaseMsgCancelUpgrade(): MsgCancelUpgrade { + return { + authority: "" + }; +} +export const MsgCancelUpgrade = { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade", + encode(message: MsgCancelUpgrade, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelUpgrade { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelUpgrade(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCancelUpgrade { + const message = createBaseMsgCancelUpgrade(); + message.authority = object.authority ?? ""; + return message; + }, + fromAmino(object: MsgCancelUpgradeAmino): MsgCancelUpgrade { + const message = createBaseMsgCancelUpgrade(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + return message; + }, + toAmino(message: MsgCancelUpgrade): MsgCancelUpgradeAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + return obj; + }, + fromAminoMsg(object: MsgCancelUpgradeAminoMsg): MsgCancelUpgrade { + return MsgCancelUpgrade.fromAmino(object.value); + }, + toAminoMsg(message: MsgCancelUpgrade): MsgCancelUpgradeAminoMsg { + return { + type: "cosmos-sdk/MsgCancelUpgrade", + value: MsgCancelUpgrade.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCancelUpgradeProtoMsg): MsgCancelUpgrade { + return MsgCancelUpgrade.decode(message.value); + }, + toProto(message: MsgCancelUpgrade): Uint8Array { + return MsgCancelUpgrade.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelUpgrade): MsgCancelUpgradeProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgrade", + value: MsgCancelUpgrade.encode(message).finish() + }; + } +}; +function createBaseMsgCancelUpgradeResponse(): MsgCancelUpgradeResponse { + return {}; +} +export const MsgCancelUpgradeResponse = { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgradeResponse", + encode(_: MsgCancelUpgradeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCancelUpgradeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCancelUpgradeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgCancelUpgradeResponse { + const message = createBaseMsgCancelUpgradeResponse(); + return message; + }, + fromAmino(_: MsgCancelUpgradeResponseAmino): MsgCancelUpgradeResponse { + const message = createBaseMsgCancelUpgradeResponse(); + return message; + }, + toAmino(_: MsgCancelUpgradeResponse): MsgCancelUpgradeResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCancelUpgradeResponseAminoMsg): MsgCancelUpgradeResponse { + return MsgCancelUpgradeResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCancelUpgradeResponse): MsgCancelUpgradeResponseAminoMsg { + return { + type: "cosmos-sdk/MsgCancelUpgradeResponse", + value: MsgCancelUpgradeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCancelUpgradeResponseProtoMsg): MsgCancelUpgradeResponse { + return MsgCancelUpgradeResponse.decode(message.value); + }, + toProto(message: MsgCancelUpgradeResponse): Uint8Array { + return MsgCancelUpgradeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCancelUpgradeResponse): MsgCancelUpgradeResponseProtoMsg { + return { + typeUrl: "/cosmos.upgrade.v1beta1.MsgCancelUpgradeResponse", + value: MsgCancelUpgradeResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmos/upgrade/v1beta1/upgrade.ts b/src/codegen/cosmos/upgrade/v1beta1/upgrade.ts index cb8c956..b08e46d 100644 --- a/src/codegen/cosmos/upgrade/v1beta1/upgrade.ts +++ b/src/codegen/cosmos/upgrade/v1beta1/upgrade.ts @@ -21,10 +21,7 @@ export interface Plan { */ /** @deprecated */ time: Date; - /** - * The height at which the upgrade must be performed. - * Only used if Time is not set. - */ + /** The height at which the upgrade must be performed. */ height: bigint; /** * Any application specific upgrade info to be included on-chain @@ -61,11 +58,8 @@ export interface PlanAmino { * If this field is not empty, an error will be thrown. */ /** @deprecated */ - time?: string; - /** - * The height at which the upgrade must be performed. - * Only used if Time is not set. - */ + time: string; + /** The height at which the upgrade must be performed. */ height?: string; /** * Any application specific upgrade info to be included on-chain @@ -97,10 +91,16 @@ export interface PlanSDKType { /** * SoftwareUpgradeProposal is a gov Content type for initiating a software * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgSoftwareUpgrade. */ +/** @deprecated */ export interface SoftwareUpgradeProposal { + /** title of the proposal */ title: string; + /** description of the proposal */ description: string; + /** plan of the proposal */ plan: Plan; } export interface SoftwareUpgradeProposalProtoMsg { @@ -110,11 +110,17 @@ export interface SoftwareUpgradeProposalProtoMsg { /** * SoftwareUpgradeProposal is a gov Content type for initiating a software * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgSoftwareUpgrade. */ +/** @deprecated */ export interface SoftwareUpgradeProposalAmino { + /** title of the proposal */ title?: string; + /** description of the proposal */ description?: string; - plan?: PlanAmino; + /** plan of the proposal */ + plan: PlanAmino; } export interface SoftwareUpgradeProposalAminoMsg { type: "cosmos-sdk/SoftwareUpgradeProposal"; @@ -123,7 +129,10 @@ export interface SoftwareUpgradeProposalAminoMsg { /** * SoftwareUpgradeProposal is a gov Content type for initiating a software * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgSoftwareUpgrade. */ +/** @deprecated */ export interface SoftwareUpgradeProposalSDKType { title: string; description: string; @@ -132,9 +141,14 @@ export interface SoftwareUpgradeProposalSDKType { /** * CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgCancelUpgrade. */ +/** @deprecated */ export interface CancelSoftwareUpgradeProposal { + /** title of the proposal */ title: string; + /** description of the proposal */ description: string; } export interface CancelSoftwareUpgradeProposalProtoMsg { @@ -144,9 +158,14 @@ export interface CancelSoftwareUpgradeProposalProtoMsg { /** * CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgCancelUpgrade. */ +/** @deprecated */ export interface CancelSoftwareUpgradeProposalAmino { + /** title of the proposal */ title?: string; + /** description of the proposal */ description?: string; } export interface CancelSoftwareUpgradeProposalAminoMsg { @@ -156,7 +175,10 @@ export interface CancelSoftwareUpgradeProposalAminoMsg { /** * CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software * upgrade. + * Deprecated: This legacy proposal is deprecated in favor of Msg-based gov + * proposals, see MsgCancelUpgrade. */ +/** @deprecated */ export interface CancelSoftwareUpgradeProposalSDKType { title: string; description: string; @@ -289,7 +311,7 @@ export const Plan = { toAmino(message: Plan): PlanAmino { const obj: any = {}; obj.name = message.name === "" ? undefined : message.name; - obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : new Date(); obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; obj.info = message.info === "" ? undefined : message.info; obj.upgraded_client_state = message.upgradedClientState ? Any.toAmino(message.upgradedClientState) : undefined; @@ -385,7 +407,7 @@ export const SoftwareUpgradeProposal = { const obj: any = {}; obj.title = message.title === "" ? undefined : message.title; obj.description = message.description === "" ? undefined : message.description; - obj.plan = message.plan ? Plan.toAmino(message.plan) : undefined; + obj.plan = message.plan ? Plan.toAmino(message.plan) : Plan.toAmino(Plan.fromPartial({})); return obj; }, fromAminoMsg(object: SoftwareUpgradeProposalAminoMsg): SoftwareUpgradeProposal { diff --git a/src/codegen/cosmos/vesting/v1beta1/tx.amino.ts b/src/codegen/cosmos/vesting/v1beta1/tx.amino.ts index f3dc7ec..3085e0b 100644 --- a/src/codegen/cosmos/vesting/v1beta1/tx.amino.ts +++ b/src/codegen/cosmos/vesting/v1beta1/tx.amino.ts @@ -1,8 +1,18 @@ -import { MsgCreateVestingAccount } from "./tx"; +import { MsgCreateVestingAccount, MsgCreatePermanentLockedAccount, MsgCreatePeriodicVestingAccount } from "./tx"; export const AminoConverter = { "/cosmos.vesting.v1beta1.MsgCreateVestingAccount": { aminoType: "cosmos-sdk/MsgCreateVestingAccount", toAmino: MsgCreateVestingAccount.toAmino, fromAmino: MsgCreateVestingAccount.fromAmino + }, + "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount": { + aminoType: "cosmos-sdk/MsgCreatePermLockedAccount", + toAmino: MsgCreatePermanentLockedAccount.toAmino, + fromAmino: MsgCreatePermanentLockedAccount.fromAmino + }, + "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount": { + aminoType: "cosmos-sdk/MsgCreatePeriodVestAccount", + toAmino: MsgCreatePeriodicVestingAccount.toAmino, + fromAmino: MsgCreatePeriodicVestingAccount.fromAmino } }; \ No newline at end of file diff --git a/src/codegen/cosmos/vesting/v1beta1/tx.registry.ts b/src/codegen/cosmos/vesting/v1beta1/tx.registry.ts index 04aff71..4084be1 100644 --- a/src/codegen/cosmos/vesting/v1beta1/tx.registry.ts +++ b/src/codegen/cosmos/vesting/v1beta1/tx.registry.ts @@ -1,6 +1,6 @@ import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgCreateVestingAccount } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.vesting.v1beta1.MsgCreateVestingAccount", MsgCreateVestingAccount]]; +import { MsgCreateVestingAccount, MsgCreatePermanentLockedAccount, MsgCreatePeriodicVestingAccount } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.vesting.v1beta1.MsgCreateVestingAccount", MsgCreateVestingAccount], ["/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount", MsgCreatePermanentLockedAccount], ["/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount", MsgCreatePeriodicVestingAccount]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -13,6 +13,18 @@ export const MessageComposer = { typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccount", value: MsgCreateVestingAccount.encode(value).finish() }; + }, + createPermanentLockedAccount(value: MsgCreatePermanentLockedAccount) { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount", + value: MsgCreatePermanentLockedAccount.encode(value).finish() + }; + }, + createPeriodicVestingAccount(value: MsgCreatePeriodicVestingAccount) { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount", + value: MsgCreatePeriodicVestingAccount.encode(value).finish() + }; } }, withTypeUrl: { @@ -21,6 +33,18 @@ export const MessageComposer = { typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccount", value }; + }, + createPermanentLockedAccount(value: MsgCreatePermanentLockedAccount) { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount", + value + }; + }, + createPeriodicVestingAccount(value: MsgCreatePeriodicVestingAccount) { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount", + value + }; } }, fromPartial: { @@ -29,6 +53,18 @@ export const MessageComposer = { typeUrl: "/cosmos.vesting.v1beta1.MsgCreateVestingAccount", value: MsgCreateVestingAccount.fromPartial(value) }; + }, + createPermanentLockedAccount(value: MsgCreatePermanentLockedAccount) { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount", + value: MsgCreatePermanentLockedAccount.fromPartial(value) + }; + }, + createPeriodicVestingAccount(value: MsgCreatePeriodicVestingAccount) { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount", + value: MsgCreatePeriodicVestingAccount.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/src/codegen/cosmos/vesting/v1beta1/tx.rpc.msg.ts b/src/codegen/cosmos/vesting/v1beta1/tx.rpc.msg.ts index 99aa41a..e588f16 100644 --- a/src/codegen/cosmos/vesting/v1beta1/tx.rpc.msg.ts +++ b/src/codegen/cosmos/vesting/v1beta1/tx.rpc.msg.ts @@ -1,6 +1,6 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; -import { MsgCreateVestingAccount, MsgCreateVestingAccountResponse } from "./tx"; +import { MsgCreateVestingAccount, MsgCreateVestingAccountResponse, MsgCreatePermanentLockedAccount, MsgCreatePermanentLockedAccountResponse, MsgCreatePeriodicVestingAccount, MsgCreatePeriodicVestingAccountResponse } from "./tx"; /** Msg defines the bank Msg service. */ export interface Msg { /** @@ -8,16 +8,42 @@ export interface Msg { * account. */ createVestingAccount(request: MsgCreateVestingAccount): Promise; + /** + * CreatePermanentLockedAccount defines a method that enables creating a permanent + * locked account. + * + * Since: cosmos-sdk 0.46 + */ + createPermanentLockedAccount(request: MsgCreatePermanentLockedAccount): Promise; + /** + * CreatePeriodicVestingAccount defines a method that enables creating a + * periodic vesting account. + * + * Since: cosmos-sdk 0.46 + */ + createPeriodicVestingAccount(request: MsgCreatePeriodicVestingAccount): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; this.createVestingAccount = this.createVestingAccount.bind(this); + this.createPermanentLockedAccount = this.createPermanentLockedAccount.bind(this); + this.createPeriodicVestingAccount = this.createPeriodicVestingAccount.bind(this); } createVestingAccount(request: MsgCreateVestingAccount): Promise { const data = MsgCreateVestingAccount.encode(request).finish(); const promise = this.rpc.request("cosmos.vesting.v1beta1.Msg", "CreateVestingAccount", data); return promise.then(data => MsgCreateVestingAccountResponse.decode(new BinaryReader(data))); } + createPermanentLockedAccount(request: MsgCreatePermanentLockedAccount): Promise { + const data = MsgCreatePermanentLockedAccount.encode(request).finish(); + const promise = this.rpc.request("cosmos.vesting.v1beta1.Msg", "CreatePermanentLockedAccount", data); + return promise.then(data => MsgCreatePermanentLockedAccountResponse.decode(new BinaryReader(data))); + } + createPeriodicVestingAccount(request: MsgCreatePeriodicVestingAccount): Promise { + const data = MsgCreatePeriodicVestingAccount.encode(request).finish(); + const promise = this.rpc.request("cosmos.vesting.v1beta1.Msg", "CreatePeriodicVestingAccount", data); + return promise.then(data => MsgCreatePeriodicVestingAccountResponse.decode(new BinaryReader(data))); + } } \ No newline at end of file diff --git a/src/codegen/cosmos/vesting/v1beta1/tx.ts b/src/codegen/cosmos/vesting/v1beta1/tx.ts index eae0202..331554d 100644 --- a/src/codegen/cosmos/vesting/v1beta1/tx.ts +++ b/src/codegen/cosmos/vesting/v1beta1/tx.ts @@ -1,4 +1,5 @@ import { Coin, CoinAmino, CoinSDKType } from "../../base/v1beta1/coin"; +import { Period, PeriodAmino, PeriodSDKType } from "./vesting"; import { BinaryReader, BinaryWriter } from "../../../binary"; /** * MsgCreateVestingAccount defines a message that enables creating a vesting @@ -8,6 +9,7 @@ export interface MsgCreateVestingAccount { fromAddress: string; toAddress: string; amount: Coin[]; + /** end of vesting as unix time (in seconds). */ endTime: bigint; delayed: boolean; } @@ -22,7 +24,8 @@ export interface MsgCreateVestingAccountProtoMsg { export interface MsgCreateVestingAccountAmino { from_address?: string; to_address?: string; - amount?: CoinAmino[]; + amount: CoinAmino[]; + /** end of vesting as unix time (in seconds). */ end_time?: string; delayed?: boolean; } @@ -55,6 +58,148 @@ export interface MsgCreateVestingAccountResponseAminoMsg { } /** MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. */ export interface MsgCreateVestingAccountResponseSDKType {} +/** + * MsgCreatePermanentLockedAccount defines a message that enables creating a permanent + * locked account. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCreatePermanentLockedAccount { + fromAddress: string; + toAddress: string; + amount: Coin[]; +} +export interface MsgCreatePermanentLockedAccountProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount"; + value: Uint8Array; +} +/** + * MsgCreatePermanentLockedAccount defines a message that enables creating a permanent + * locked account. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCreatePermanentLockedAccountAmino { + from_address?: string; + to_address?: string; + amount: CoinAmino[]; +} +export interface MsgCreatePermanentLockedAccountAminoMsg { + type: "cosmos-sdk/MsgCreatePermLockedAccount"; + value: MsgCreatePermanentLockedAccountAmino; +} +/** + * MsgCreatePermanentLockedAccount defines a message that enables creating a permanent + * locked account. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCreatePermanentLockedAccountSDKType { + from_address: string; + to_address: string; + amount: CoinSDKType[]; +} +/** + * MsgCreatePermanentLockedAccountResponse defines the Msg/CreatePermanentLockedAccount response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCreatePermanentLockedAccountResponse {} +export interface MsgCreatePermanentLockedAccountResponseProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccountResponse"; + value: Uint8Array; +} +/** + * MsgCreatePermanentLockedAccountResponse defines the Msg/CreatePermanentLockedAccount response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCreatePermanentLockedAccountResponseAmino {} +export interface MsgCreatePermanentLockedAccountResponseAminoMsg { + type: "cosmos-sdk/MsgCreatePermanentLockedAccountResponse"; + value: MsgCreatePermanentLockedAccountResponseAmino; +} +/** + * MsgCreatePermanentLockedAccountResponse defines the Msg/CreatePermanentLockedAccount response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCreatePermanentLockedAccountResponseSDKType {} +/** + * MsgCreateVestingAccount defines a message that enables creating a vesting + * account. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCreatePeriodicVestingAccount { + fromAddress: string; + toAddress: string; + /** start of vesting as unix time (in seconds). */ + startTime: bigint; + vestingPeriods: Period[]; +} +export interface MsgCreatePeriodicVestingAccountProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount"; + value: Uint8Array; +} +/** + * MsgCreateVestingAccount defines a message that enables creating a vesting + * account. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCreatePeriodicVestingAccountAmino { + from_address?: string; + to_address?: string; + /** start of vesting as unix time (in seconds). */ + start_time?: string; + vesting_periods: PeriodAmino[]; +} +export interface MsgCreatePeriodicVestingAccountAminoMsg { + type: "cosmos-sdk/MsgCreatePeriodVestAccount"; + value: MsgCreatePeriodicVestingAccountAmino; +} +/** + * MsgCreateVestingAccount defines a message that enables creating a vesting + * account. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCreatePeriodicVestingAccountSDKType { + from_address: string; + to_address: string; + start_time: bigint; + vesting_periods: PeriodSDKType[]; +} +/** + * MsgCreateVestingAccountResponse defines the Msg/CreatePeriodicVestingAccount + * response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCreatePeriodicVestingAccountResponse {} +export interface MsgCreatePeriodicVestingAccountResponseProtoMsg { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccountResponse"; + value: Uint8Array; +} +/** + * MsgCreateVestingAccountResponse defines the Msg/CreatePeriodicVestingAccount + * response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCreatePeriodicVestingAccountResponseAmino {} +export interface MsgCreatePeriodicVestingAccountResponseAminoMsg { + type: "cosmos-sdk/MsgCreatePeriodicVestingAccountResponse"; + value: MsgCreatePeriodicVestingAccountResponseAmino; +} +/** + * MsgCreateVestingAccountResponse defines the Msg/CreatePeriodicVestingAccount + * response type. + * + * Since: cosmos-sdk 0.46 + */ +export interface MsgCreatePeriodicVestingAccountResponseSDKType {} function createBaseMsgCreateVestingAccount(): MsgCreateVestingAccount { return { fromAddress: "", @@ -229,4 +374,318 @@ export const MsgCreateVestingAccountResponse = { value: MsgCreateVestingAccountResponse.encode(message).finish() }; } +}; +function createBaseMsgCreatePermanentLockedAccount(): MsgCreatePermanentLockedAccount { + return { + fromAddress: "", + toAddress: "", + amount: [] + }; +} +export const MsgCreatePermanentLockedAccount = { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount", + encode(message: MsgCreatePermanentLockedAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.fromAddress !== "") { + writer.uint32(10).string(message.fromAddress); + } + if (message.toAddress !== "") { + writer.uint32(18).string(message.toAddress); + } + for (const v of message.amount) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreatePermanentLockedAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreatePermanentLockedAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fromAddress = reader.string(); + break; + case 2: + message.toAddress = reader.string(); + break; + case 3: + message.amount.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreatePermanentLockedAccount { + const message = createBaseMsgCreatePermanentLockedAccount(); + message.fromAddress = object.fromAddress ?? ""; + message.toAddress = object.toAddress ?? ""; + message.amount = object.amount?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgCreatePermanentLockedAccountAmino): MsgCreatePermanentLockedAccount { + const message = createBaseMsgCreatePermanentLockedAccount(); + if (object.from_address !== undefined && object.from_address !== null) { + message.fromAddress = object.from_address; + } + if (object.to_address !== undefined && object.to_address !== null) { + message.toAddress = object.to_address; + } + message.amount = object.amount?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgCreatePermanentLockedAccount): MsgCreatePermanentLockedAccountAmino { + const obj: any = {}; + obj.from_address = message.fromAddress === "" ? undefined : message.fromAddress; + obj.to_address = message.toAddress === "" ? undefined : message.toAddress; + if (message.amount) { + obj.amount = message.amount.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.amount = message.amount; + } + return obj; + }, + fromAminoMsg(object: MsgCreatePermanentLockedAccountAminoMsg): MsgCreatePermanentLockedAccount { + return MsgCreatePermanentLockedAccount.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreatePermanentLockedAccount): MsgCreatePermanentLockedAccountAminoMsg { + return { + type: "cosmos-sdk/MsgCreatePermLockedAccount", + value: MsgCreatePermanentLockedAccount.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreatePermanentLockedAccountProtoMsg): MsgCreatePermanentLockedAccount { + return MsgCreatePermanentLockedAccount.decode(message.value); + }, + toProto(message: MsgCreatePermanentLockedAccount): Uint8Array { + return MsgCreatePermanentLockedAccount.encode(message).finish(); + }, + toProtoMsg(message: MsgCreatePermanentLockedAccount): MsgCreatePermanentLockedAccountProtoMsg { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount", + value: MsgCreatePermanentLockedAccount.encode(message).finish() + }; + } +}; +function createBaseMsgCreatePermanentLockedAccountResponse(): MsgCreatePermanentLockedAccountResponse { + return {}; +} +export const MsgCreatePermanentLockedAccountResponse = { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccountResponse", + encode(_: MsgCreatePermanentLockedAccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreatePermanentLockedAccountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreatePermanentLockedAccountResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgCreatePermanentLockedAccountResponse { + const message = createBaseMsgCreatePermanentLockedAccountResponse(); + return message; + }, + fromAmino(_: MsgCreatePermanentLockedAccountResponseAmino): MsgCreatePermanentLockedAccountResponse { + const message = createBaseMsgCreatePermanentLockedAccountResponse(); + return message; + }, + toAmino(_: MsgCreatePermanentLockedAccountResponse): MsgCreatePermanentLockedAccountResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCreatePermanentLockedAccountResponseAminoMsg): MsgCreatePermanentLockedAccountResponse { + return MsgCreatePermanentLockedAccountResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreatePermanentLockedAccountResponse): MsgCreatePermanentLockedAccountResponseAminoMsg { + return { + type: "cosmos-sdk/MsgCreatePermanentLockedAccountResponse", + value: MsgCreatePermanentLockedAccountResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreatePermanentLockedAccountResponseProtoMsg): MsgCreatePermanentLockedAccountResponse { + return MsgCreatePermanentLockedAccountResponse.decode(message.value); + }, + toProto(message: MsgCreatePermanentLockedAccountResponse): Uint8Array { + return MsgCreatePermanentLockedAccountResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreatePermanentLockedAccountResponse): MsgCreatePermanentLockedAccountResponseProtoMsg { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccountResponse", + value: MsgCreatePermanentLockedAccountResponse.encode(message).finish() + }; + } +}; +function createBaseMsgCreatePeriodicVestingAccount(): MsgCreatePeriodicVestingAccount { + return { + fromAddress: "", + toAddress: "", + startTime: BigInt(0), + vestingPeriods: [] + }; +} +export const MsgCreatePeriodicVestingAccount = { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount", + encode(message: MsgCreatePeriodicVestingAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.fromAddress !== "") { + writer.uint32(10).string(message.fromAddress); + } + if (message.toAddress !== "") { + writer.uint32(18).string(message.toAddress); + } + if (message.startTime !== BigInt(0)) { + writer.uint32(24).int64(message.startTime); + } + for (const v of message.vestingPeriods) { + Period.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreatePeriodicVestingAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreatePeriodicVestingAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fromAddress = reader.string(); + break; + case 2: + message.toAddress = reader.string(); + break; + case 3: + message.startTime = reader.int64(); + break; + case 4: + message.vestingPeriods.push(Period.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreatePeriodicVestingAccount { + const message = createBaseMsgCreatePeriodicVestingAccount(); + message.fromAddress = object.fromAddress ?? ""; + message.toAddress = object.toAddress ?? ""; + message.startTime = object.startTime !== undefined && object.startTime !== null ? BigInt(object.startTime.toString()) : BigInt(0); + message.vestingPeriods = object.vestingPeriods?.map(e => Period.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgCreatePeriodicVestingAccountAmino): MsgCreatePeriodicVestingAccount { + const message = createBaseMsgCreatePeriodicVestingAccount(); + if (object.from_address !== undefined && object.from_address !== null) { + message.fromAddress = object.from_address; + } + if (object.to_address !== undefined && object.to_address !== null) { + message.toAddress = object.to_address; + } + if (object.start_time !== undefined && object.start_time !== null) { + message.startTime = BigInt(object.start_time); + } + message.vestingPeriods = object.vesting_periods?.map(e => Period.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgCreatePeriodicVestingAccount): MsgCreatePeriodicVestingAccountAmino { + const obj: any = {}; + obj.from_address = message.fromAddress === "" ? undefined : message.fromAddress; + obj.to_address = message.toAddress === "" ? undefined : message.toAddress; + obj.start_time = message.startTime !== BigInt(0) ? message.startTime.toString() : undefined; + if (message.vestingPeriods) { + obj.vesting_periods = message.vestingPeriods.map(e => e ? Period.toAmino(e) : undefined); + } else { + obj.vesting_periods = message.vestingPeriods; + } + return obj; + }, + fromAminoMsg(object: MsgCreatePeriodicVestingAccountAminoMsg): MsgCreatePeriodicVestingAccount { + return MsgCreatePeriodicVestingAccount.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreatePeriodicVestingAccount): MsgCreatePeriodicVestingAccountAminoMsg { + return { + type: "cosmos-sdk/MsgCreatePeriodVestAccount", + value: MsgCreatePeriodicVestingAccount.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreatePeriodicVestingAccountProtoMsg): MsgCreatePeriodicVestingAccount { + return MsgCreatePeriodicVestingAccount.decode(message.value); + }, + toProto(message: MsgCreatePeriodicVestingAccount): Uint8Array { + return MsgCreatePeriodicVestingAccount.encode(message).finish(); + }, + toProtoMsg(message: MsgCreatePeriodicVestingAccount): MsgCreatePeriodicVestingAccountProtoMsg { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount", + value: MsgCreatePeriodicVestingAccount.encode(message).finish() + }; + } +}; +function createBaseMsgCreatePeriodicVestingAccountResponse(): MsgCreatePeriodicVestingAccountResponse { + return {}; +} +export const MsgCreatePeriodicVestingAccountResponse = { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccountResponse", + encode(_: MsgCreatePeriodicVestingAccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreatePeriodicVestingAccountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreatePeriodicVestingAccountResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgCreatePeriodicVestingAccountResponse { + const message = createBaseMsgCreatePeriodicVestingAccountResponse(); + return message; + }, + fromAmino(_: MsgCreatePeriodicVestingAccountResponseAmino): MsgCreatePeriodicVestingAccountResponse { + const message = createBaseMsgCreatePeriodicVestingAccountResponse(); + return message; + }, + toAmino(_: MsgCreatePeriodicVestingAccountResponse): MsgCreatePeriodicVestingAccountResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgCreatePeriodicVestingAccountResponseAminoMsg): MsgCreatePeriodicVestingAccountResponse { + return MsgCreatePeriodicVestingAccountResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreatePeriodicVestingAccountResponse): MsgCreatePeriodicVestingAccountResponseAminoMsg { + return { + type: "cosmos-sdk/MsgCreatePeriodicVestingAccountResponse", + value: MsgCreatePeriodicVestingAccountResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreatePeriodicVestingAccountResponseProtoMsg): MsgCreatePeriodicVestingAccountResponse { + return MsgCreatePeriodicVestingAccountResponse.decode(message.value); + }, + toProto(message: MsgCreatePeriodicVestingAccountResponse): Uint8Array { + return MsgCreatePeriodicVestingAccountResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreatePeriodicVestingAccountResponse): MsgCreatePeriodicVestingAccountResponseProtoMsg { + return { + typeUrl: "/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccountResponse", + value: MsgCreatePeriodicVestingAccountResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/src/codegen/cosmos/vesting/v1beta1/vesting.ts b/src/codegen/cosmos/vesting/v1beta1/vesting.ts index dd98cf5..0df9a4a 100644 --- a/src/codegen/cosmos/vesting/v1beta1/vesting.ts +++ b/src/codegen/cosmos/vesting/v1beta1/vesting.ts @@ -10,6 +10,7 @@ export interface BaseVestingAccount { originalVesting: Coin[]; delegatedFree: Coin[]; delegatedVesting: Coin[]; + /** Vesting end time, as unix timestamp (in seconds). */ endTime: bigint; } export interface BaseVestingAccountProtoMsg { @@ -22,9 +23,10 @@ export interface BaseVestingAccountProtoMsg { */ export interface BaseVestingAccountAmino { base_account?: BaseAccountAmino; - original_vesting?: CoinAmino[]; - delegated_free?: CoinAmino[]; - delegated_vesting?: CoinAmino[]; + original_vesting: CoinAmino[]; + delegated_free: CoinAmino[]; + delegated_vesting: CoinAmino[]; + /** Vesting end time, as unix timestamp (in seconds). */ end_time?: string; } export interface BaseVestingAccountAminoMsg { @@ -48,6 +50,7 @@ export interface BaseVestingAccountSDKType { */ export interface ContinuousVestingAccount { baseVestingAccount?: BaseVestingAccount; + /** Vesting start time, as unix timestamp (in seconds). */ startTime: bigint; } export interface ContinuousVestingAccountProtoMsg { @@ -60,6 +63,7 @@ export interface ContinuousVestingAccountProtoMsg { */ export interface ContinuousVestingAccountAmino { base_vesting_account?: BaseVestingAccountAmino; + /** Vesting start time, as unix timestamp (in seconds). */ start_time?: string; } export interface ContinuousVestingAccountAminoMsg { @@ -108,6 +112,7 @@ export interface DelayedVestingAccountSDKType { } /** Period defines a length of time and amount of coins that will vest. */ export interface Period { + /** Period duration in seconds. */ length: bigint; amount: Coin[]; } @@ -117,8 +122,9 @@ export interface PeriodProtoMsg { } /** Period defines a length of time and amount of coins that will vest. */ export interface PeriodAmino { + /** Period duration in seconds. */ length?: string; - amount?: CoinAmino[]; + amount: CoinAmino[]; } export interface PeriodAminoMsg { type: "cosmos-sdk/Period"; @@ -149,7 +155,7 @@ export interface PeriodicVestingAccountProtoMsg { export interface PeriodicVestingAccountAmino { base_vesting_account?: BaseVestingAccountAmino; start_time?: string; - vesting_periods?: PeriodAmino[]; + vesting_periods: PeriodAmino[]; } export interface PeriodicVestingAccountAminoMsg { type: "cosmos-sdk/PeriodicVestingAccount"; diff --git a/src/codegen/cosmos_proto/bundle.ts b/src/codegen/cosmos_proto/bundle.ts index a938b2d..61b90a8 100644 --- a/src/codegen/cosmos_proto/bundle.ts +++ b/src/codegen/cosmos_proto/bundle.ts @@ -1,4 +1,4 @@ -import * as _2 from "./cosmos"; +import * as _3 from "./cosmos"; export const cosmos_proto = { - ..._2 + ..._3 }; \ No newline at end of file diff --git a/src/codegen/cosmwasm/bundle.ts b/src/codegen/cosmwasm/bundle.ts index e4330cb..376fa81 100644 --- a/src/codegen/cosmwasm/bundle.ts +++ b/src/codegen/cosmwasm/bundle.ts @@ -1,38 +1,68 @@ -import * as _73 from "./wasm/v1/authz"; -import * as _74 from "./wasm/v1/genesis"; -import * as _75 from "./wasm/v1/ibc"; -import * as _76 from "./wasm/v1/proposal"; -import * as _77 from "./wasm/v1/query"; -import * as _78 from "./wasm/v1/tx"; -import * as _79 from "./wasm/v1/types"; -import * as _197 from "./wasm/v1/tx.amino"; -import * as _198 from "./wasm/v1/tx.registry"; -import * as _199 from "./wasm/v1/query.lcd"; -import * as _200 from "./wasm/v1/query.rpc.Query"; -import * as _201 from "./wasm/v1/tx.rpc.msg"; -import * as _234 from "./lcd"; -import * as _235 from "./rpc.query"; -import * as _236 from "./rpc.tx"; +import * as _139 from "./tokenfactory/v1beta1/authorityMetadata"; +import * as _140 from "./tokenfactory/v1beta1/genesis"; +import * as _141 from "./tokenfactory/v1beta1/params"; +import * as _142 from "./tokenfactory/v1beta1/query"; +import * as _143 from "./tokenfactory/v1beta1/tx"; +import * as _144 from "./wasm/v1/authz"; +import * as _145 from "./wasm/v1/genesis"; +import * as _146 from "./wasm/v1/ibc"; +import * as _147 from "./wasm/v1/proposal_legacy"; +import * as _148 from "./wasm/v1/proposal"; +import * as _149 from "./wasm/v1/query"; +import * as _150 from "./wasm/v1/tx"; +import * as _151 from "./wasm/v1/types"; +import * as _152 from "./wasm/v1beta1/proposal_legacy_v1beta1"; +import * as _317 from "./tokenfactory/v1beta1/tx.amino"; +import * as _318 from "./wasm/v1/tx.amino"; +import * as _319 from "./tokenfactory/v1beta1/tx.registry"; +import * as _320 from "./wasm/v1/tx.registry"; +import * as _321 from "./tokenfactory/v1beta1/query.lcd"; +import * as _322 from "./wasm/v1/query.lcd"; +import * as _323 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _324 from "./wasm/v1/query.rpc.Query"; +import * as _325 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _326 from "./wasm/v1/tx.rpc.msg"; +import * as _370 from "./lcd"; +import * as _371 from "./rpc.query"; +import * as _372 from "./rpc.tx"; export namespace cosmwasm { + export namespace tokenfactory { + export const v1beta1 = { + ..._139, + ..._140, + ..._141, + ..._142, + ..._143, + ..._317, + ..._319, + ..._321, + ..._323, + ..._325 + }; + } export namespace wasm { export const v1 = { - ..._73, - ..._74, - ..._75, - ..._76, - ..._77, - ..._78, - ..._79, - ..._197, - ..._198, - ..._199, - ..._200, - ..._201 + ..._144, + ..._145, + ..._146, + ..._147, + ..._148, + ..._149, + ..._150, + ..._151, + ..._318, + ..._320, + ..._322, + ..._324, + ..._326 + }; + export const v1beta1 = { + ..._152 }; } export const ClientFactory = { - ..._234, - ..._235, - ..._236 + ..._370, + ..._371, + ..._372 }; } \ No newline at end of file diff --git a/src/codegen/cosmwasm/client.ts b/src/codegen/cosmwasm/client.ts index 1b6196f..96196b8 100644 --- a/src/codegen/cosmwasm/client.ts +++ b/src/codegen/cosmwasm/client.ts @@ -1,12 +1,15 @@ import { GeneratedType, Registry, OfflineSigner } from "@cosmjs/proto-signing"; import { defaultRegistryTypes, AminoTypes, SigningStargateClient } from "@cosmjs/stargate"; import { HttpEndpoint } from "@cosmjs/tendermint-rpc"; +import * as cosmwasmTokenfactoryV1beta1TxRegistry from "./tokenfactory/v1beta1/tx.registry"; import * as cosmwasmWasmV1TxRegistry from "./wasm/v1/tx.registry"; +import * as cosmwasmTokenfactoryV1beta1TxAmino from "./tokenfactory/v1beta1/tx.amino"; import * as cosmwasmWasmV1TxAmino from "./wasm/v1/tx.amino"; export const cosmwasmAminoConverters = { + ...cosmwasmTokenfactoryV1beta1TxAmino.AminoConverter, ...cosmwasmWasmV1TxAmino.AminoConverter }; -export const cosmwasmProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...cosmwasmWasmV1TxRegistry.registry]; +export const cosmwasmProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...cosmwasmTokenfactoryV1beta1TxRegistry.registry, ...cosmwasmWasmV1TxRegistry.registry]; export const getSigningCosmwasmClientOptions = ({ defaultTypes = defaultRegistryTypes }: { diff --git a/src/codegen/cosmwasm/lcd.ts b/src/codegen/cosmwasm/lcd.ts index 2365738..28a52d1 100644 --- a/src/codegen/cosmwasm/lcd.ts +++ b/src/codegen/cosmwasm/lcd.ts @@ -36,6 +36,16 @@ export const createLCDClient = async ({ }) } }, + circuit: { + v1: new (await import("../cosmos/circuit/v1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, + consensus: { + v1: new (await import("../cosmos/consensus/v1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, distribution: { v1beta1: new (await import("../cosmos/distribution/v1beta1/query.lcd")).LCDQueryClient({ requestClient @@ -52,15 +62,28 @@ export const createLCDClient = async ({ }) }, gov: { + v1: new (await import("../cosmos/gov/v1/query.lcd")).LCDQueryClient({ + requestClient + }), v1beta1: new (await import("../cosmos/gov/v1beta1/query.lcd")).LCDQueryClient({ requestClient }) }, + group: { + v1: new (await import("../cosmos/group/v1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, mint: { v1beta1: new (await import("../cosmos/mint/v1beta1/query.lcd")).LCDQueryClient({ requestClient }) }, + nft: { + v1beta1: new (await import("../cosmos/nft/v1beta1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, params: { v1beta1: new (await import("../cosmos/params/v1beta1/query.lcd")).LCDQueryClient({ requestClient @@ -88,6 +111,11 @@ export const createLCDClient = async ({ } }, cosmwasm: { + tokenfactory: { + v1beta1: new (await import("./tokenfactory/v1beta1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, wasm: { v1: new (await import("./wasm/v1/query.lcd")).LCDQueryClient({ requestClient diff --git a/src/codegen/cosmwasm/rpc.query.ts b/src/codegen/cosmwasm/rpc.query.ts index 3b3564d..42bcc65 100644 --- a/src/codegen/cosmwasm/rpc.query.ts +++ b/src/codegen/cosmwasm/rpc.query.ts @@ -9,12 +9,18 @@ export const createRPCQueryClient = async ({ const client = new QueryClient(tmClient); return { cosmos: { + app: { + v1alpha1: (await import("../cosmos/app/v1alpha1/query.rpc.Query")).createRpcQueryExtension(client) + }, auth: { v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, authz: { v1beta1: (await import("../cosmos/authz/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, + autocli: { + v1: (await import("../cosmos/autocli/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, bank: { v1beta1: (await import("../cosmos/bank/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, @@ -26,6 +32,12 @@ export const createRPCQueryClient = async ({ v1beta1: (await import("../cosmos/base/tendermint/v1beta1/query.rpc.Service")).createRpcQueryExtension(client) } }, + circuit: { + v1: (await import("../cosmos/circuit/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, + consensus: { + v1: (await import("../cosmos/consensus/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, distribution: { v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, @@ -36,11 +48,23 @@ export const createRPCQueryClient = async ({ v1beta1: (await import("../cosmos/feegrant/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, gov: { + v1: (await import("../cosmos/gov/v1/query.rpc.Query")).createRpcQueryExtension(client), v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, + group: { + v1: (await import("../cosmos/group/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, mint: { v1beta1: (await import("../cosmos/mint/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, + nft: { + v1beta1: (await import("../cosmos/nft/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + orm: { + query: { + v1alpha1: (await import("../cosmos/orm/query/v1alpha1/query.rpc.Query")).createRpcQueryExtension(client) + } + }, params: { v1beta1: (await import("../cosmos/params/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, @@ -58,6 +82,9 @@ export const createRPCQueryClient = async ({ } }, cosmwasm: { + tokenfactory: { + v1beta1: (await import("./tokenfactory/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, wasm: { v1: (await import("./wasm/v1/query.rpc.Query")).createRpcQueryExtension(client) } diff --git a/src/codegen/cosmwasm/rpc.tx.ts b/src/codegen/cosmwasm/rpc.tx.ts index dbd5aca..a6862da 100644 --- a/src/codegen/cosmwasm/rpc.tx.ts +++ b/src/codegen/cosmwasm/rpc.tx.ts @@ -5,12 +5,21 @@ export const createRPCMsgClient = async ({ rpc: Rpc; }) => ({ cosmos: { + auth: { + v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, authz: { v1beta1: new (await import("../cosmos/authz/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, bank: { v1beta1: new (await import("../cosmos/bank/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, + circuit: { + v1: new (await import("../cosmos/circuit/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + consensus: { + v1: new (await import("../cosmos/consensus/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, crisis: { v1beta1: new (await import("../cosmos/crisis/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, @@ -24,19 +33,35 @@ export const createRPCMsgClient = async ({ v1beta1: new (await import("../cosmos/feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, gov: { + v1: new (await import("../cosmos/gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), v1beta1: new (await import("../cosmos/gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, + group: { + v1: new (await import("../cosmos/group/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + mint: { + v1beta1: new (await import("../cosmos/mint/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + nft: { + v1beta1: new (await import("../cosmos/nft/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, slashing: { v1beta1: new (await import("../cosmos/slashing/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, staking: { v1beta1: new (await import("../cosmos/staking/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, + upgrade: { + v1beta1: new (await import("../cosmos/upgrade/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, vesting: { v1beta1: new (await import("../cosmos/vesting/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) } }, cosmwasm: { + tokenfactory: { + v1beta1: new (await import("./tokenfactory/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, wasm: { v1: new (await import("./wasm/v1/tx.rpc.msg")).MsgClientImpl(rpc) } diff --git a/src/codegen/cosmwasm/tokenfactory/v1beta1/authorityMetadata.ts b/src/codegen/cosmwasm/tokenfactory/v1beta1/authorityMetadata.ts new file mode 100644 index 0000000..79ff2dc --- /dev/null +++ b/src/codegen/cosmwasm/tokenfactory/v1beta1/authorityMetadata.ts @@ -0,0 +1,104 @@ +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * DenomAuthorityMetadata specifies metadata for addresses that have specific + * capabilities over a token factory denom. Right now there is only one Admin + * permission, but is planned to be extended to the future. + */ +export interface DenomAuthorityMetadata { + /** Can be empty for no admin, or a valid cosmwasm address */ + admin: string; +} +export interface DenomAuthorityMetadataProtoMsg { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.DenomAuthorityMetadata"; + value: Uint8Array; +} +/** + * DenomAuthorityMetadata specifies metadata for addresses that have specific + * capabilities over a token factory denom. Right now there is only one Admin + * permission, but is planned to be extended to the future. + */ +export interface DenomAuthorityMetadataAmino { + /** Can be empty for no admin, or a valid cosmwasm address */ + admin?: string; +} +export interface DenomAuthorityMetadataAminoMsg { + type: "wasm/DenomAuthorityMetadata"; + value: DenomAuthorityMetadataAmino; +} +/** + * DenomAuthorityMetadata specifies metadata for addresses that have specific + * capabilities over a token factory denom. Right now there is only one Admin + * permission, but is planned to be extended to the future. + */ +export interface DenomAuthorityMetadataSDKType { + admin: string; +} +function createBaseDenomAuthorityMetadata(): DenomAuthorityMetadata { + return { + admin: "" + }; +} +export const DenomAuthorityMetadata = { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.DenomAuthorityMetadata", + encode(message: DenomAuthorityMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.admin !== "") { + writer.uint32(10).string(message.admin); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): DenomAuthorityMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenomAuthorityMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.admin = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): DenomAuthorityMetadata { + const message = createBaseDenomAuthorityMetadata(); + message.admin = object.admin ?? ""; + return message; + }, + fromAmino(object: DenomAuthorityMetadataAmino): DenomAuthorityMetadata { + const message = createBaseDenomAuthorityMetadata(); + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + return message; + }, + toAmino(message: DenomAuthorityMetadata): DenomAuthorityMetadataAmino { + const obj: any = {}; + obj.admin = message.admin === "" ? undefined : message.admin; + return obj; + }, + fromAminoMsg(object: DenomAuthorityMetadataAminoMsg): DenomAuthorityMetadata { + return DenomAuthorityMetadata.fromAmino(object.value); + }, + toAminoMsg(message: DenomAuthorityMetadata): DenomAuthorityMetadataAminoMsg { + return { + type: "wasm/DenomAuthorityMetadata", + value: DenomAuthorityMetadata.toAmino(message) + }; + }, + fromProtoMsg(message: DenomAuthorityMetadataProtoMsg): DenomAuthorityMetadata { + return DenomAuthorityMetadata.decode(message.value); + }, + toProto(message: DenomAuthorityMetadata): Uint8Array { + return DenomAuthorityMetadata.encode(message).finish(); + }, + toProtoMsg(message: DenomAuthorityMetadata): DenomAuthorityMetadataProtoMsg { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.DenomAuthorityMetadata", + value: DenomAuthorityMetadata.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmwasm/tokenfactory/v1beta1/genesis.ts b/src/codegen/cosmwasm/tokenfactory/v1beta1/genesis.ts new file mode 100644 index 0000000..48ad67f --- /dev/null +++ b/src/codegen/cosmwasm/tokenfactory/v1beta1/genesis.ts @@ -0,0 +1,227 @@ +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { DenomAuthorityMetadata, DenomAuthorityMetadataAmino, DenomAuthorityMetadataSDKType } from "./authorityMetadata"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** GenesisState defines the tokenfactory module's genesis state. */ +export interface GenesisState { + /** params defines the paramaters of the module. */ + params: Params; + factoryDenoms: GenesisDenom[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the tokenfactory module's genesis state. */ +export interface GenesisStateAmino { + /** params defines the paramaters of the module. */ + params?: ParamsAmino; + factory_denoms?: GenesisDenomAmino[]; +} +export interface GenesisStateAminoMsg { + type: "wasm/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the tokenfactory module's genesis state. */ +export interface GenesisStateSDKType { + params: ParamsSDKType; + factory_denoms: GenesisDenomSDKType[]; +} +/** + * GenesisDenom defines a tokenfactory denom that is defined within genesis + * state. The structure contains DenomAuthorityMetadata which defines the + * denom's admin. + */ +export interface GenesisDenom { + denom: string; + authorityMetadata: DenomAuthorityMetadata; +} +export interface GenesisDenomProtoMsg { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.GenesisDenom"; + value: Uint8Array; +} +/** + * GenesisDenom defines a tokenfactory denom that is defined within genesis + * state. The structure contains DenomAuthorityMetadata which defines the + * denom's admin. + */ +export interface GenesisDenomAmino { + denom?: string; + authority_metadata?: DenomAuthorityMetadataAmino; +} +export interface GenesisDenomAminoMsg { + type: "wasm/GenesisDenom"; + value: GenesisDenomAmino; +} +/** + * GenesisDenom defines a tokenfactory denom that is defined within genesis + * state. The structure contains DenomAuthorityMetadata which defines the + * denom's admin. + */ +export interface GenesisDenomSDKType { + denom: string; + authority_metadata: DenomAuthorityMetadataSDKType; +} +function createBaseGenesisState(): GenesisState { + return { + params: Params.fromPartial({}), + factoryDenoms: [] + }; +} +export const GenesisState = { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.factoryDenoms) { + GenesisDenom.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + case 2: + message.factoryDenoms.push(GenesisDenom.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.factoryDenoms = object.factoryDenoms?.map(e => GenesisDenom.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + message.factoryDenoms = object.factory_denoms?.map(e => GenesisDenom.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + if (message.factoryDenoms) { + obj.factory_denoms = message.factoryDenoms.map(e => e ? GenesisDenom.toAmino(e) : undefined); + } else { + obj.factory_denoms = message.factoryDenoms; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: "wasm/GenesisState", + value: GenesisState.toAmino(message) + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +function createBaseGenesisDenom(): GenesisDenom { + return { + denom: "", + authorityMetadata: DenomAuthorityMetadata.fromPartial({}) + }; +} +export const GenesisDenom = { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.GenesisDenom", + encode(message: GenesisDenom, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + if (message.authorityMetadata !== undefined) { + DenomAuthorityMetadata.encode(message.authorityMetadata, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisDenom { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisDenom(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + case 2: + message.authorityMetadata = DenomAuthorityMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisDenom { + const message = createBaseGenesisDenom(); + message.denom = object.denom ?? ""; + message.authorityMetadata = object.authorityMetadata !== undefined && object.authorityMetadata !== null ? DenomAuthorityMetadata.fromPartial(object.authorityMetadata) : undefined; + return message; + }, + fromAmino(object: GenesisDenomAmino): GenesisDenom { + const message = createBaseGenesisDenom(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.authority_metadata !== undefined && object.authority_metadata !== null) { + message.authorityMetadata = DenomAuthorityMetadata.fromAmino(object.authority_metadata); + } + return message; + }, + toAmino(message: GenesisDenom): GenesisDenomAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.authority_metadata = message.authorityMetadata ? DenomAuthorityMetadata.toAmino(message.authorityMetadata) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisDenomAminoMsg): GenesisDenom { + return GenesisDenom.fromAmino(object.value); + }, + toAminoMsg(message: GenesisDenom): GenesisDenomAminoMsg { + return { + type: "wasm/GenesisDenom", + value: GenesisDenom.toAmino(message) + }; + }, + fromProtoMsg(message: GenesisDenomProtoMsg): GenesisDenom { + return GenesisDenom.decode(message.value); + }, + toProto(message: GenesisDenom): Uint8Array { + return GenesisDenom.encode(message).finish(); + }, + toProtoMsg(message: GenesisDenom): GenesisDenomProtoMsg { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.GenesisDenom", + value: GenesisDenom.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmwasm/tokenfactory/v1beta1/params.ts b/src/codegen/cosmwasm/tokenfactory/v1beta1/params.ts new file mode 100644 index 0000000..cf5848b --- /dev/null +++ b/src/codegen/cosmwasm/tokenfactory/v1beta1/params.ts @@ -0,0 +1,110 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** Params defines the parameters for the tokenfactory module. */ +export interface Params { + denomCreationFee: Coin[]; + /** https://github.com/CosmWasm/wasmd/issues/11 */ + denomCreationGasConsume?: bigint; +} +export interface ParamsProtoMsg { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.Params"; + value: Uint8Array; +} +/** Params defines the parameters for the tokenfactory module. */ +export interface ParamsAmino { + denom_creation_fee?: CoinAmino[]; + /** https://github.com/CosmWasm/wasmd/issues/11 */ + denom_creation_gas_consume?: string; +} +export interface ParamsAminoMsg { + type: "wasm/Params"; + value: ParamsAmino; +} +/** Params defines the parameters for the tokenfactory module. */ +export interface ParamsSDKType { + denom_creation_fee: CoinSDKType[]; + denom_creation_gas_consume?: bigint; +} +function createBaseParams(): Params { + return { + denomCreationFee: [], + denomCreationGasConsume: undefined + }; +} +export const Params = { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.denomCreationFee) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.denomCreationGasConsume !== undefined) { + writer.uint32(16).uint64(message.denomCreationGasConsume); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denomCreationFee.push(Coin.decode(reader, reader.uint32())); + break; + case 2: + message.denomCreationGasConsume = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.denomCreationFee = object.denomCreationFee?.map(e => Coin.fromPartial(e)) || []; + message.denomCreationGasConsume = object.denomCreationGasConsume !== undefined && object.denomCreationGasConsume !== null ? BigInt(object.denomCreationGasConsume.toString()) : undefined; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + message.denomCreationFee = object.denom_creation_fee?.map(e => Coin.fromAmino(e)) || []; + if (object.denom_creation_gas_consume !== undefined && object.denom_creation_gas_consume !== null) { + message.denomCreationGasConsume = BigInt(object.denom_creation_gas_consume); + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + if (message.denomCreationFee) { + obj.denom_creation_fee = message.denomCreationFee.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.denom_creation_fee = message.denomCreationFee; + } + obj.denom_creation_gas_consume = message.denomCreationGasConsume !== BigInt(0) ? message.denomCreationGasConsume.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "wasm/Params", + value: Params.toAmino(message) + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.Params", + value: Params.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmwasm/tokenfactory/v1beta1/query.lcd.ts b/src/codegen/cosmwasm/tokenfactory/v1beta1/query.lcd.ts new file mode 100644 index 0000000..1b4b8eb --- /dev/null +++ b/src/codegen/cosmwasm/tokenfactory/v1beta1/query.lcd.ts @@ -0,0 +1,33 @@ +import { LCDClient } from "@cosmology/lcd"; +import { QueryParamsRequest, QueryParamsResponseSDKType, QueryDenomAuthorityMetadataRequest, QueryDenomAuthorityMetadataResponseSDKType, QueryDenomsFromCreatorRequest, QueryDenomsFromCreatorResponseSDKType } from "./query"; +export class LCDQueryClient { + req: LCDClient; + constructor({ + requestClient + }: { + requestClient: LCDClient; + }) { + this.req = requestClient; + this.params = this.params.bind(this); + this.denomAuthorityMetadata = this.denomAuthorityMetadata.bind(this); + this.denomsFromCreator = this.denomsFromCreator.bind(this); + } + /* Params defines a gRPC query method that returns the tokenfactory module's + parameters. */ + async params(_params: QueryParamsRequest = {}): Promise { + const endpoint = `cosmwasm/tokenfactory/v1beta1/params`; + return await this.req.get(endpoint); + } + /* DenomAuthorityMetadata defines a gRPC query method for fetching + DenomAuthorityMetadata for a particular denom. */ + async denomAuthorityMetadata(params: QueryDenomAuthorityMetadataRequest): Promise { + const endpoint = `cosmwasm/tokenfactory/v1beta1/denoms/${params.denom}/authority_metadata`; + return await this.req.get(endpoint); + } + /* DenomsFromCreator defines a gRPC query method for fetching all + denominations created by a specific admin/creator. */ + async denomsFromCreator(params: QueryDenomsFromCreatorRequest): Promise { + const endpoint = `cosmwasm/tokenfactory/v1beta1/denoms_from_creator/${params.creator}`; + return await this.req.get(endpoint); + } +} \ No newline at end of file diff --git a/src/codegen/cosmwasm/tokenfactory/v1beta1/query.rpc.Query.ts b/src/codegen/cosmwasm/tokenfactory/v1beta1/query.rpc.Query.ts new file mode 100644 index 0000000..cbf1e64 --- /dev/null +++ b/src/codegen/cosmwasm/tokenfactory/v1beta1/query.rpc.Query.ts @@ -0,0 +1,61 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryParamsRequest, QueryParamsResponse, QueryDenomAuthorityMetadataRequest, QueryDenomAuthorityMetadataResponse, QueryDenomsFromCreatorRequest, QueryDenomsFromCreatorResponse } from "./query"; +/** Query defines the gRPC querier service. */ +export interface Query { + /** + * Params defines a gRPC query method that returns the tokenfactory module's + * parameters. + */ + params(request?: QueryParamsRequest): Promise; + /** + * DenomAuthorityMetadata defines a gRPC query method for fetching + * DenomAuthorityMetadata for a particular denom. + */ + denomAuthorityMetadata(request: QueryDenomAuthorityMetadataRequest): Promise; + /** + * DenomsFromCreator defines a gRPC query method for fetching all + * denominations created by a specific admin/creator. + */ + denomsFromCreator(request: QueryDenomsFromCreatorRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.params = this.params.bind(this); + this.denomAuthorityMetadata = this.denomAuthorityMetadata.bind(this); + this.denomsFromCreator = this.denomsFromCreator.bind(this); + } + params(request: QueryParamsRequest = {}): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.tokenfactory.v1beta1.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new BinaryReader(data))); + } + denomAuthorityMetadata(request: QueryDenomAuthorityMetadataRequest): Promise { + const data = QueryDenomAuthorityMetadataRequest.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.tokenfactory.v1beta1.Query", "DenomAuthorityMetadata", data); + return promise.then(data => QueryDenomAuthorityMetadataResponse.decode(new BinaryReader(data))); + } + denomsFromCreator(request: QueryDenomsFromCreatorRequest): Promise { + const data = QueryDenomsFromCreatorRequest.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.tokenfactory.v1beta1.Query", "DenomsFromCreator", data); + return promise.then(data => QueryDenomsFromCreatorResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + params(request?: QueryParamsRequest): Promise { + return queryService.params(request); + }, + denomAuthorityMetadata(request: QueryDenomAuthorityMetadataRequest): Promise { + return queryService.denomAuthorityMetadata(request); + }, + denomsFromCreator(request: QueryDenomsFromCreatorRequest): Promise { + return queryService.denomsFromCreator(request); + } + }; +}; \ No newline at end of file diff --git a/src/codegen/cosmwasm/tokenfactory/v1beta1/query.ts b/src/codegen/cosmwasm/tokenfactory/v1beta1/query.ts new file mode 100644 index 0000000..d9e91b4 --- /dev/null +++ b/src/codegen/cosmwasm/tokenfactory/v1beta1/query.ts @@ -0,0 +1,558 @@ +import { Params, ParamsAmino, ParamsSDKType } from "./params"; +import { DenomAuthorityMetadata, DenomAuthorityMetadataAmino, DenomAuthorityMetadataSDKType } from "./authorityMetadata"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} +export interface QueryParamsRequestProtoMsg { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.QueryParamsRequest"; + value: Uint8Array; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestAmino {} +export interface QueryParamsRequestAminoMsg { + type: "wasm/QueryParamsRequest"; + value: QueryParamsRequestAmino; +} +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestSDKType {} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params defines the parameters of the module. */ + params: Params; +} +export interface QueryParamsResponseProtoMsg { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.QueryParamsResponse"; + value: Uint8Array; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponseAmino { + /** params defines the parameters of the module. */ + params?: ParamsAmino; +} +export interface QueryParamsResponseAminoMsg { + type: "wasm/QueryParamsResponse"; + value: QueryParamsResponseAmino; +} +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponseSDKType { + params: ParamsSDKType; +} +/** + * QueryDenomAuthorityMetadataRequest defines the request structure for the + * DenomAuthorityMetadata gRPC query. + */ +export interface QueryDenomAuthorityMetadataRequest { + denom: string; +} +export interface QueryDenomAuthorityMetadataRequestProtoMsg { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest"; + value: Uint8Array; +} +/** + * QueryDenomAuthorityMetadataRequest defines the request structure for the + * DenomAuthorityMetadata gRPC query. + */ +export interface QueryDenomAuthorityMetadataRequestAmino { + denom?: string; +} +export interface QueryDenomAuthorityMetadataRequestAminoMsg { + type: "wasm/QueryDenomAuthorityMetadataRequest"; + value: QueryDenomAuthorityMetadataRequestAmino; +} +/** + * QueryDenomAuthorityMetadataRequest defines the request structure for the + * DenomAuthorityMetadata gRPC query. + */ +export interface QueryDenomAuthorityMetadataRequestSDKType { + denom: string; +} +/** + * QueryDenomAuthorityMetadataResponse defines the response structure for the + * DenomAuthorityMetadata gRPC query. + */ +export interface QueryDenomAuthorityMetadataResponse { + authorityMetadata: DenomAuthorityMetadata; +} +export interface QueryDenomAuthorityMetadataResponseProtoMsg { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse"; + value: Uint8Array; +} +/** + * QueryDenomAuthorityMetadataResponse defines the response structure for the + * DenomAuthorityMetadata gRPC query. + */ +export interface QueryDenomAuthorityMetadataResponseAmino { + authority_metadata?: DenomAuthorityMetadataAmino; +} +export interface QueryDenomAuthorityMetadataResponseAminoMsg { + type: "wasm/QueryDenomAuthorityMetadataResponse"; + value: QueryDenomAuthorityMetadataResponseAmino; +} +/** + * QueryDenomAuthorityMetadataResponse defines the response structure for the + * DenomAuthorityMetadata gRPC query. + */ +export interface QueryDenomAuthorityMetadataResponseSDKType { + authority_metadata: DenomAuthorityMetadataSDKType; +} +/** + * QueryDenomsFromCreatorRequest defines the request structure for the + * DenomsFromCreator gRPC query. + */ +export interface QueryDenomsFromCreatorRequest { + creator: string; +} +export interface QueryDenomsFromCreatorRequestProtoMsg { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest"; + value: Uint8Array; +} +/** + * QueryDenomsFromCreatorRequest defines the request structure for the + * DenomsFromCreator gRPC query. + */ +export interface QueryDenomsFromCreatorRequestAmino { + creator?: string; +} +export interface QueryDenomsFromCreatorRequestAminoMsg { + type: "wasm/QueryDenomsFromCreatorRequest"; + value: QueryDenomsFromCreatorRequestAmino; +} +/** + * QueryDenomsFromCreatorRequest defines the request structure for the + * DenomsFromCreator gRPC query. + */ +export interface QueryDenomsFromCreatorRequestSDKType { + creator: string; +} +/** + * QueryDenomsFromCreatorRequest defines the response structure for the + * DenomsFromCreator gRPC query. + */ +export interface QueryDenomsFromCreatorResponse { + denoms: string[]; +} +export interface QueryDenomsFromCreatorResponseProtoMsg { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse"; + value: Uint8Array; +} +/** + * QueryDenomsFromCreatorRequest defines the response structure for the + * DenomsFromCreator gRPC query. + */ +export interface QueryDenomsFromCreatorResponseAmino { + denoms?: string[]; +} +export interface QueryDenomsFromCreatorResponseAminoMsg { + type: "wasm/QueryDenomsFromCreatorResponse"; + value: QueryDenomsFromCreatorResponseAmino; +} +/** + * QueryDenomsFromCreatorRequest defines the response structure for the + * DenomsFromCreator gRPC query. + */ +export interface QueryDenomsFromCreatorResponseSDKType { + denoms: string[]; +} +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} +export const QueryParamsRequest = { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.QueryParamsRequest", + encode(_: QueryParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + fromAmino(_: QueryParamsRequestAmino): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + toAmino(_: QueryParamsRequest): QueryParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryParamsRequestAminoMsg): QueryParamsRequest { + return QueryParamsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsRequest): QueryParamsRequestAminoMsg { + return { + type: "wasm/QueryParamsRequest", + value: QueryParamsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsRequestProtoMsg): QueryParamsRequest { + return QueryParamsRequest.decode(message.value); + }, + toProto(message: QueryParamsRequest): Uint8Array { + return QueryParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsRequest): QueryParamsRequestProtoMsg { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.QueryParamsRequest", + value: QueryParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: Params.fromPartial({}) + }; +} +export const QueryParamsResponse = { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.QueryParamsResponse", + encode(message: QueryParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryParamsResponseAmino): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { + return QueryParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryParamsResponse): QueryParamsResponseAminoMsg { + return { + type: "wasm/QueryParamsResponse", + value: QueryParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryParamsResponseProtoMsg): QueryParamsResponse { + return QueryParamsResponse.decode(message.value); + }, + toProto(message: QueryParamsResponse): Uint8Array { + return QueryParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryParamsResponse): QueryParamsResponseProtoMsg { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.QueryParamsResponse", + value: QueryParamsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryDenomAuthorityMetadataRequest(): QueryDenomAuthorityMetadataRequest { + return { + denom: "" + }; +} +export const QueryDenomAuthorityMetadataRequest = { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest", + encode(message: QueryDenomAuthorityMetadataRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomAuthorityMetadataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomAuthorityMetadataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDenomAuthorityMetadataRequest { + const message = createBaseQueryDenomAuthorityMetadataRequest(); + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: QueryDenomAuthorityMetadataRequestAmino): QueryDenomAuthorityMetadataRequest { + const message = createBaseQueryDenomAuthorityMetadataRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: QueryDenomAuthorityMetadataRequest): QueryDenomAuthorityMetadataRequestAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + return obj; + }, + fromAminoMsg(object: QueryDenomAuthorityMetadataRequestAminoMsg): QueryDenomAuthorityMetadataRequest { + return QueryDenomAuthorityMetadataRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDenomAuthorityMetadataRequest): QueryDenomAuthorityMetadataRequestAminoMsg { + return { + type: "wasm/QueryDenomAuthorityMetadataRequest", + value: QueryDenomAuthorityMetadataRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDenomAuthorityMetadataRequestProtoMsg): QueryDenomAuthorityMetadataRequest { + return QueryDenomAuthorityMetadataRequest.decode(message.value); + }, + toProto(message: QueryDenomAuthorityMetadataRequest): Uint8Array { + return QueryDenomAuthorityMetadataRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomAuthorityMetadataRequest): QueryDenomAuthorityMetadataRequestProtoMsg { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest", + value: QueryDenomAuthorityMetadataRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDenomAuthorityMetadataResponse(): QueryDenomAuthorityMetadataResponse { + return { + authorityMetadata: DenomAuthorityMetadata.fromPartial({}) + }; +} +export const QueryDenomAuthorityMetadataResponse = { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse", + encode(message: QueryDenomAuthorityMetadataResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authorityMetadata !== undefined) { + DenomAuthorityMetadata.encode(message.authorityMetadata, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomAuthorityMetadataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomAuthorityMetadataResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authorityMetadata = DenomAuthorityMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDenomAuthorityMetadataResponse { + const message = createBaseQueryDenomAuthorityMetadataResponse(); + message.authorityMetadata = object.authorityMetadata !== undefined && object.authorityMetadata !== null ? DenomAuthorityMetadata.fromPartial(object.authorityMetadata) : undefined; + return message; + }, + fromAmino(object: QueryDenomAuthorityMetadataResponseAmino): QueryDenomAuthorityMetadataResponse { + const message = createBaseQueryDenomAuthorityMetadataResponse(); + if (object.authority_metadata !== undefined && object.authority_metadata !== null) { + message.authorityMetadata = DenomAuthorityMetadata.fromAmino(object.authority_metadata); + } + return message; + }, + toAmino(message: QueryDenomAuthorityMetadataResponse): QueryDenomAuthorityMetadataResponseAmino { + const obj: any = {}; + obj.authority_metadata = message.authorityMetadata ? DenomAuthorityMetadata.toAmino(message.authorityMetadata) : undefined; + return obj; + }, + fromAminoMsg(object: QueryDenomAuthorityMetadataResponseAminoMsg): QueryDenomAuthorityMetadataResponse { + return QueryDenomAuthorityMetadataResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDenomAuthorityMetadataResponse): QueryDenomAuthorityMetadataResponseAminoMsg { + return { + type: "wasm/QueryDenomAuthorityMetadataResponse", + value: QueryDenomAuthorityMetadataResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDenomAuthorityMetadataResponseProtoMsg): QueryDenomAuthorityMetadataResponse { + return QueryDenomAuthorityMetadataResponse.decode(message.value); + }, + toProto(message: QueryDenomAuthorityMetadataResponse): Uint8Array { + return QueryDenomAuthorityMetadataResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomAuthorityMetadataResponse): QueryDenomAuthorityMetadataResponseProtoMsg { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse", + value: QueryDenomAuthorityMetadataResponse.encode(message).finish() + }; + } +}; +function createBaseQueryDenomsFromCreatorRequest(): QueryDenomsFromCreatorRequest { + return { + creator: "" + }; +} +export const QueryDenomsFromCreatorRequest = { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest", + encode(message: QueryDenomsFromCreatorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomsFromCreatorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomsFromCreatorRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDenomsFromCreatorRequest { + const message = createBaseQueryDenomsFromCreatorRequest(); + message.creator = object.creator ?? ""; + return message; + }, + fromAmino(object: QueryDenomsFromCreatorRequestAmino): QueryDenomsFromCreatorRequest { + const message = createBaseQueryDenomsFromCreatorRequest(); + if (object.creator !== undefined && object.creator !== null) { + message.creator = object.creator; + } + return message; + }, + toAmino(message: QueryDenomsFromCreatorRequest): QueryDenomsFromCreatorRequestAmino { + const obj: any = {}; + obj.creator = message.creator === "" ? undefined : message.creator; + return obj; + }, + fromAminoMsg(object: QueryDenomsFromCreatorRequestAminoMsg): QueryDenomsFromCreatorRequest { + return QueryDenomsFromCreatorRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryDenomsFromCreatorRequest): QueryDenomsFromCreatorRequestAminoMsg { + return { + type: "wasm/QueryDenomsFromCreatorRequest", + value: QueryDenomsFromCreatorRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDenomsFromCreatorRequestProtoMsg): QueryDenomsFromCreatorRequest { + return QueryDenomsFromCreatorRequest.decode(message.value); + }, + toProto(message: QueryDenomsFromCreatorRequest): Uint8Array { + return QueryDenomsFromCreatorRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomsFromCreatorRequest): QueryDenomsFromCreatorRequestProtoMsg { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest", + value: QueryDenomsFromCreatorRequest.encode(message).finish() + }; + } +}; +function createBaseQueryDenomsFromCreatorResponse(): QueryDenomsFromCreatorResponse { + return { + denoms: [] + }; +} +export const QueryDenomsFromCreatorResponse = { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse", + encode(message: QueryDenomsFromCreatorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.denoms) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryDenomsFromCreatorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomsFromCreatorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denoms.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryDenomsFromCreatorResponse { + const message = createBaseQueryDenomsFromCreatorResponse(); + message.denoms = object.denoms?.map(e => e) || []; + return message; + }, + fromAmino(object: QueryDenomsFromCreatorResponseAmino): QueryDenomsFromCreatorResponse { + const message = createBaseQueryDenomsFromCreatorResponse(); + message.denoms = object.denoms?.map(e => e) || []; + return message; + }, + toAmino(message: QueryDenomsFromCreatorResponse): QueryDenomsFromCreatorResponseAmino { + const obj: any = {}; + if (message.denoms) { + obj.denoms = message.denoms.map(e => e); + } else { + obj.denoms = message.denoms; + } + return obj; + }, + fromAminoMsg(object: QueryDenomsFromCreatorResponseAminoMsg): QueryDenomsFromCreatorResponse { + return QueryDenomsFromCreatorResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryDenomsFromCreatorResponse): QueryDenomsFromCreatorResponseAminoMsg { + return { + type: "wasm/QueryDenomsFromCreatorResponse", + value: QueryDenomsFromCreatorResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryDenomsFromCreatorResponseProtoMsg): QueryDenomsFromCreatorResponse { + return QueryDenomsFromCreatorResponse.decode(message.value); + }, + toProto(message: QueryDenomsFromCreatorResponse): Uint8Array { + return QueryDenomsFromCreatorResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryDenomsFromCreatorResponse): QueryDenomsFromCreatorResponseProtoMsg { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse", + value: QueryDenomsFromCreatorResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmwasm/tokenfactory/v1beta1/tx.amino.ts b/src/codegen/cosmwasm/tokenfactory/v1beta1/tx.amino.ts new file mode 100644 index 0000000..4f43722 --- /dev/null +++ b/src/codegen/cosmwasm/tokenfactory/v1beta1/tx.amino.ts @@ -0,0 +1,33 @@ +import { MsgCreateDenom, MsgMint, MsgBurn, MsgChangeAdmin, MsgSetDenomMetadata, MsgForceTransfer } from "./tx"; +export const AminoConverter = { + "/cosmwasm.tokenfactory.v1beta1.MsgCreateDenom": { + aminoType: "wasm/MsgCreateDenom", + toAmino: MsgCreateDenom.toAmino, + fromAmino: MsgCreateDenom.fromAmino + }, + "/cosmwasm.tokenfactory.v1beta1.MsgMint": { + aminoType: "wasm/MsgMint", + toAmino: MsgMint.toAmino, + fromAmino: MsgMint.fromAmino + }, + "/cosmwasm.tokenfactory.v1beta1.MsgBurn": { + aminoType: "wasm/MsgBurn", + toAmino: MsgBurn.toAmino, + fromAmino: MsgBurn.fromAmino + }, + "/cosmwasm.tokenfactory.v1beta1.MsgChangeAdmin": { + aminoType: "wasm/MsgChangeAdmin", + toAmino: MsgChangeAdmin.toAmino, + fromAmino: MsgChangeAdmin.fromAmino + }, + "/cosmwasm.tokenfactory.v1beta1.MsgSetDenomMetadata": { + aminoType: "wasm/MsgSetDenomMetadata", + toAmino: MsgSetDenomMetadata.toAmino, + fromAmino: MsgSetDenomMetadata.fromAmino + }, + "/cosmwasm.tokenfactory.v1beta1.MsgForceTransfer": { + aminoType: "wasm/MsgForceTransfer", + toAmino: MsgForceTransfer.toAmino, + fromAmino: MsgForceTransfer.fromAmino + } +}; \ No newline at end of file diff --git a/src/codegen/cosmwasm/tokenfactory/v1beta1/tx.registry.ts b/src/codegen/cosmwasm/tokenfactory/v1beta1/tx.registry.ts new file mode 100644 index 0000000..d11e8a3 --- /dev/null +++ b/src/codegen/cosmwasm/tokenfactory/v1beta1/tx.registry.ts @@ -0,0 +1,124 @@ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgCreateDenom, MsgMint, MsgBurn, MsgChangeAdmin, MsgSetDenomMetadata, MsgForceTransfer } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmwasm.tokenfactory.v1beta1.MsgCreateDenom", MsgCreateDenom], ["/cosmwasm.tokenfactory.v1beta1.MsgMint", MsgMint], ["/cosmwasm.tokenfactory.v1beta1.MsgBurn", MsgBurn], ["/cosmwasm.tokenfactory.v1beta1.MsgChangeAdmin", MsgChangeAdmin], ["/cosmwasm.tokenfactory.v1beta1.MsgSetDenomMetadata", MsgSetDenomMetadata], ["/cosmwasm.tokenfactory.v1beta1.MsgForceTransfer", MsgForceTransfer]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + createDenom(value: MsgCreateDenom) { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgCreateDenom", + value: MsgCreateDenom.encode(value).finish() + }; + }, + mint(value: MsgMint) { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgMint", + value: MsgMint.encode(value).finish() + }; + }, + burn(value: MsgBurn) { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgBurn", + value: MsgBurn.encode(value).finish() + }; + }, + changeAdmin(value: MsgChangeAdmin) { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgChangeAdmin", + value: MsgChangeAdmin.encode(value).finish() + }; + }, + setDenomMetadata(value: MsgSetDenomMetadata) { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgSetDenomMetadata", + value: MsgSetDenomMetadata.encode(value).finish() + }; + }, + forceTransfer(value: MsgForceTransfer) { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgForceTransfer", + value: MsgForceTransfer.encode(value).finish() + }; + } + }, + withTypeUrl: { + createDenom(value: MsgCreateDenom) { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgCreateDenom", + value + }; + }, + mint(value: MsgMint) { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgMint", + value + }; + }, + burn(value: MsgBurn) { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgBurn", + value + }; + }, + changeAdmin(value: MsgChangeAdmin) { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgChangeAdmin", + value + }; + }, + setDenomMetadata(value: MsgSetDenomMetadata) { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgSetDenomMetadata", + value + }; + }, + forceTransfer(value: MsgForceTransfer) { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgForceTransfer", + value + }; + } + }, + fromPartial: { + createDenom(value: MsgCreateDenom) { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgCreateDenom", + value: MsgCreateDenom.fromPartial(value) + }; + }, + mint(value: MsgMint) { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgMint", + value: MsgMint.fromPartial(value) + }; + }, + burn(value: MsgBurn) { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgBurn", + value: MsgBurn.fromPartial(value) + }; + }, + changeAdmin(value: MsgChangeAdmin) { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgChangeAdmin", + value: MsgChangeAdmin.fromPartial(value) + }; + }, + setDenomMetadata(value: MsgSetDenomMetadata) { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgSetDenomMetadata", + value: MsgSetDenomMetadata.fromPartial(value) + }; + }, + forceTransfer(value: MsgForceTransfer) { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgForceTransfer", + value: MsgForceTransfer.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/src/codegen/cosmwasm/tokenfactory/v1beta1/tx.rpc.msg.ts b/src/codegen/cosmwasm/tokenfactory/v1beta1/tx.rpc.msg.ts new file mode 100644 index 0000000..61b2d2c --- /dev/null +++ b/src/codegen/cosmwasm/tokenfactory/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,54 @@ +import { Rpc } from "../../../helpers"; +import { BinaryReader } from "../../../binary"; +import { MsgCreateDenom, MsgCreateDenomResponse, MsgMint, MsgMintResponse, MsgBurn, MsgBurnResponse, MsgChangeAdmin, MsgChangeAdminResponse, MsgSetDenomMetadata, MsgSetDenomMetadataResponse, MsgForceTransfer, MsgForceTransferResponse } from "./tx"; +/** Msg defines the tokefactory module's gRPC message service. */ +export interface Msg { + createDenom(request: MsgCreateDenom): Promise; + mint(request: MsgMint): Promise; + burn(request: MsgBurn): Promise; + changeAdmin(request: MsgChangeAdmin): Promise; + setDenomMetadata(request: MsgSetDenomMetadata): Promise; + forceTransfer(request: MsgForceTransfer): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.createDenom = this.createDenom.bind(this); + this.mint = this.mint.bind(this); + this.burn = this.burn.bind(this); + this.changeAdmin = this.changeAdmin.bind(this); + this.setDenomMetadata = this.setDenomMetadata.bind(this); + this.forceTransfer = this.forceTransfer.bind(this); + } + createDenom(request: MsgCreateDenom): Promise { + const data = MsgCreateDenom.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.tokenfactory.v1beta1.Msg", "CreateDenom", data); + return promise.then(data => MsgCreateDenomResponse.decode(new BinaryReader(data))); + } + mint(request: MsgMint): Promise { + const data = MsgMint.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.tokenfactory.v1beta1.Msg", "Mint", data); + return promise.then(data => MsgMintResponse.decode(new BinaryReader(data))); + } + burn(request: MsgBurn): Promise { + const data = MsgBurn.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.tokenfactory.v1beta1.Msg", "Burn", data); + return promise.then(data => MsgBurnResponse.decode(new BinaryReader(data))); + } + changeAdmin(request: MsgChangeAdmin): Promise { + const data = MsgChangeAdmin.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.tokenfactory.v1beta1.Msg", "ChangeAdmin", data); + return promise.then(data => MsgChangeAdminResponse.decode(new BinaryReader(data))); + } + setDenomMetadata(request: MsgSetDenomMetadata): Promise { + const data = MsgSetDenomMetadata.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.tokenfactory.v1beta1.Msg", "SetDenomMetadata", data); + return promise.then(data => MsgSetDenomMetadataResponse.decode(new BinaryReader(data))); + } + forceTransfer(request: MsgForceTransfer): Promise { + const data = MsgForceTransfer.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.tokenfactory.v1beta1.Msg", "ForceTransfer", data); + return promise.then(data => MsgForceTransferResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/src/codegen/cosmwasm/tokenfactory/v1beta1/tx.ts b/src/codegen/cosmwasm/tokenfactory/v1beta1/tx.ts new file mode 100644 index 0000000..c541637 --- /dev/null +++ b/src/codegen/cosmwasm/tokenfactory/v1beta1/tx.ts @@ -0,0 +1,1224 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { Metadata, MetadataAmino, MetadataSDKType } from "../../../cosmos/bank/v1beta1/bank"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +/** + * MsgCreateDenom defines the message structure for the CreateDenom gRPC service + * method. It allows an account to create a new denom. It requires a sender + * address and a sub denomination. The (sender_address, sub_denomination) tuple + * must be unique and cannot be re-used. + * + * The resulting denom created is defined as + * . The resulting denom's admin is + * originally set to be the creator, but this can be changed later. The token + * denom does not indicate the current admin. + */ +export interface MsgCreateDenom { + sender: string; + /** subdenom can be up to 44 "alphanumeric" characters long. */ + subdenom: string; +} +export interface MsgCreateDenomProtoMsg { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgCreateDenom"; + value: Uint8Array; +} +/** + * MsgCreateDenom defines the message structure for the CreateDenom gRPC service + * method. It allows an account to create a new denom. It requires a sender + * address and a sub denomination. The (sender_address, sub_denomination) tuple + * must be unique and cannot be re-used. + * + * The resulting denom created is defined as + * . The resulting denom's admin is + * originally set to be the creator, but this can be changed later. The token + * denom does not indicate the current admin. + */ +export interface MsgCreateDenomAmino { + sender?: string; + /** subdenom can be up to 44 "alphanumeric" characters long. */ + subdenom?: string; +} +export interface MsgCreateDenomAminoMsg { + type: "wasm/MsgCreateDenom"; + value: MsgCreateDenomAmino; +} +/** + * MsgCreateDenom defines the message structure for the CreateDenom gRPC service + * method. It allows an account to create a new denom. It requires a sender + * address and a sub denomination. The (sender_address, sub_denomination) tuple + * must be unique and cannot be re-used. + * + * The resulting denom created is defined as + * . The resulting denom's admin is + * originally set to be the creator, but this can be changed later. The token + * denom does not indicate the current admin. + */ +export interface MsgCreateDenomSDKType { + sender: string; + subdenom: string; +} +/** + * MsgCreateDenomResponse is the return value of MsgCreateDenom + * It returns the full string of the newly created denom + */ +export interface MsgCreateDenomResponse { + newTokenDenom: string; +} +export interface MsgCreateDenomResponseProtoMsg { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgCreateDenomResponse"; + value: Uint8Array; +} +/** + * MsgCreateDenomResponse is the return value of MsgCreateDenom + * It returns the full string of the newly created denom + */ +export interface MsgCreateDenomResponseAmino { + new_token_denom?: string; +} +export interface MsgCreateDenomResponseAminoMsg { + type: "wasm/MsgCreateDenomResponse"; + value: MsgCreateDenomResponseAmino; +} +/** + * MsgCreateDenomResponse is the return value of MsgCreateDenom + * It returns the full string of the newly created denom + */ +export interface MsgCreateDenomResponseSDKType { + new_token_denom: string; +} +/** + * MsgMint is the sdk.Msg type for allowing an admin account to mint + * more of a token. For now, we only support minting to the sender account + */ +export interface MsgMint { + sender: string; + amount: Coin; + mintToAddress: string; +} +export interface MsgMintProtoMsg { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgMint"; + value: Uint8Array; +} +/** + * MsgMint is the sdk.Msg type for allowing an admin account to mint + * more of a token. For now, we only support minting to the sender account + */ +export interface MsgMintAmino { + sender?: string; + amount?: CoinAmino; + mintToAddress?: string; +} +export interface MsgMintAminoMsg { + type: "wasm/MsgMint"; + value: MsgMintAmino; +} +/** + * MsgMint is the sdk.Msg type for allowing an admin account to mint + * more of a token. For now, we only support minting to the sender account + */ +export interface MsgMintSDKType { + sender: string; + amount: CoinSDKType; + mintToAddress: string; +} +export interface MsgMintResponse {} +export interface MsgMintResponseProtoMsg { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgMintResponse"; + value: Uint8Array; +} +export interface MsgMintResponseAmino {} +export interface MsgMintResponseAminoMsg { + type: "wasm/MsgMintResponse"; + value: MsgMintResponseAmino; +} +export interface MsgMintResponseSDKType {} +/** + * MsgBurn is the sdk.Msg type for allowing an admin account to burn + * a token. For now, we only support burning from the sender account. + */ +export interface MsgBurn { + sender: string; + amount: Coin; + burnFromAddress: string; +} +export interface MsgBurnProtoMsg { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgBurn"; + value: Uint8Array; +} +/** + * MsgBurn is the sdk.Msg type for allowing an admin account to burn + * a token. For now, we only support burning from the sender account. + */ +export interface MsgBurnAmino { + sender?: string; + amount?: CoinAmino; + burnFromAddress?: string; +} +export interface MsgBurnAminoMsg { + type: "wasm/MsgBurn"; + value: MsgBurnAmino; +} +/** + * MsgBurn is the sdk.Msg type for allowing an admin account to burn + * a token. For now, we only support burning from the sender account. + */ +export interface MsgBurnSDKType { + sender: string; + amount: CoinSDKType; + burnFromAddress: string; +} +export interface MsgBurnResponse {} +export interface MsgBurnResponseProtoMsg { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgBurnResponse"; + value: Uint8Array; +} +export interface MsgBurnResponseAmino {} +export interface MsgBurnResponseAminoMsg { + type: "wasm/MsgBurnResponse"; + value: MsgBurnResponseAmino; +} +export interface MsgBurnResponseSDKType {} +/** + * MsgChangeAdmin is the sdk.Msg type for allowing an admin account to reassign + * adminship of a denom to a new account + */ +export interface MsgChangeAdmin { + sender: string; + denom: string; + newAdmin: string; +} +export interface MsgChangeAdminProtoMsg { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgChangeAdmin"; + value: Uint8Array; +} +/** + * MsgChangeAdmin is the sdk.Msg type for allowing an admin account to reassign + * adminship of a denom to a new account + */ +export interface MsgChangeAdminAmino { + sender?: string; + denom?: string; + new_admin?: string; +} +export interface MsgChangeAdminAminoMsg { + type: "wasm/MsgChangeAdmin"; + value: MsgChangeAdminAmino; +} +/** + * MsgChangeAdmin is the sdk.Msg type for allowing an admin account to reassign + * adminship of a denom to a new account + */ +export interface MsgChangeAdminSDKType { + sender: string; + denom: string; + new_admin: string; +} +/** + * MsgChangeAdminResponse defines the response structure for an executed + * MsgChangeAdmin message. + */ +export interface MsgChangeAdminResponse {} +export interface MsgChangeAdminResponseProtoMsg { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgChangeAdminResponse"; + value: Uint8Array; +} +/** + * MsgChangeAdminResponse defines the response structure for an executed + * MsgChangeAdmin message. + */ +export interface MsgChangeAdminResponseAmino {} +export interface MsgChangeAdminResponseAminoMsg { + type: "wasm/MsgChangeAdminResponse"; + value: MsgChangeAdminResponseAmino; +} +/** + * MsgChangeAdminResponse defines the response structure for an executed + * MsgChangeAdmin message. + */ +export interface MsgChangeAdminResponseSDKType {} +/** + * MsgSetDenomMetadata is the sdk.Msg type for allowing an admin account to set + * the denom's bank metadata + */ +export interface MsgSetDenomMetadata { + sender: string; + metadata: Metadata; +} +export interface MsgSetDenomMetadataProtoMsg { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgSetDenomMetadata"; + value: Uint8Array; +} +/** + * MsgSetDenomMetadata is the sdk.Msg type for allowing an admin account to set + * the denom's bank metadata + */ +export interface MsgSetDenomMetadataAmino { + sender?: string; + metadata?: MetadataAmino; +} +export interface MsgSetDenomMetadataAminoMsg { + type: "wasm/MsgSetDenomMetadata"; + value: MsgSetDenomMetadataAmino; +} +/** + * MsgSetDenomMetadata is the sdk.Msg type for allowing an admin account to set + * the denom's bank metadata + */ +export interface MsgSetDenomMetadataSDKType { + sender: string; + metadata: MetadataSDKType; +} +/** + * MsgSetDenomMetadataResponse defines the response structure for an executed + * MsgSetDenomMetadata message. + */ +export interface MsgSetDenomMetadataResponse {} +export interface MsgSetDenomMetadataResponseProtoMsg { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgSetDenomMetadataResponse"; + value: Uint8Array; +} +/** + * MsgSetDenomMetadataResponse defines the response structure for an executed + * MsgSetDenomMetadata message. + */ +export interface MsgSetDenomMetadataResponseAmino {} +export interface MsgSetDenomMetadataResponseAminoMsg { + type: "wasm/MsgSetDenomMetadataResponse"; + value: MsgSetDenomMetadataResponseAmino; +} +/** + * MsgSetDenomMetadataResponse defines the response structure for an executed + * MsgSetDenomMetadata message. + */ +export interface MsgSetDenomMetadataResponseSDKType {} +export interface MsgForceTransfer { + sender: string; + amount: Coin; + transferFromAddress: string; + transferToAddress: string; +} +export interface MsgForceTransferProtoMsg { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgForceTransfer"; + value: Uint8Array; +} +export interface MsgForceTransferAmino { + sender?: string; + amount?: CoinAmino; + transferFromAddress?: string; + transferToAddress?: string; +} +export interface MsgForceTransferAminoMsg { + type: "wasm/MsgForceTransfer"; + value: MsgForceTransferAmino; +} +export interface MsgForceTransferSDKType { + sender: string; + amount: CoinSDKType; + transferFromAddress: string; + transferToAddress: string; +} +export interface MsgForceTransferResponse {} +export interface MsgForceTransferResponseProtoMsg { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgForceTransferResponse"; + value: Uint8Array; +} +export interface MsgForceTransferResponseAmino {} +export interface MsgForceTransferResponseAminoMsg { + type: "wasm/MsgForceTransferResponse"; + value: MsgForceTransferResponseAmino; +} +export interface MsgForceTransferResponseSDKType {} +function createBaseMsgCreateDenom(): MsgCreateDenom { + return { + sender: "", + subdenom: "" + }; +} +export const MsgCreateDenom = { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgCreateDenom", + encode(message: MsgCreateDenom, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.subdenom !== "") { + writer.uint32(18).string(message.subdenom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateDenom { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateDenom(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.subdenom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateDenom { + const message = createBaseMsgCreateDenom(); + message.sender = object.sender ?? ""; + message.subdenom = object.subdenom ?? ""; + return message; + }, + fromAmino(object: MsgCreateDenomAmino): MsgCreateDenom { + const message = createBaseMsgCreateDenom(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.subdenom !== undefined && object.subdenom !== null) { + message.subdenom = object.subdenom; + } + return message; + }, + toAmino(message: MsgCreateDenom): MsgCreateDenomAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.subdenom = message.subdenom === "" ? undefined : message.subdenom; + return obj; + }, + fromAminoMsg(object: MsgCreateDenomAminoMsg): MsgCreateDenom { + return MsgCreateDenom.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateDenom): MsgCreateDenomAminoMsg { + return { + type: "wasm/MsgCreateDenom", + value: MsgCreateDenom.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateDenomProtoMsg): MsgCreateDenom { + return MsgCreateDenom.decode(message.value); + }, + toProto(message: MsgCreateDenom): Uint8Array { + return MsgCreateDenom.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateDenom): MsgCreateDenomProtoMsg { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgCreateDenom", + value: MsgCreateDenom.encode(message).finish() + }; + } +}; +function createBaseMsgCreateDenomResponse(): MsgCreateDenomResponse { + return { + newTokenDenom: "" + }; +} +export const MsgCreateDenomResponse = { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgCreateDenomResponse", + encode(message: MsgCreateDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.newTokenDenom !== "") { + writer.uint32(10).string(message.newTokenDenom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgCreateDenomResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateDenomResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.newTokenDenom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgCreateDenomResponse { + const message = createBaseMsgCreateDenomResponse(); + message.newTokenDenom = object.newTokenDenom ?? ""; + return message; + }, + fromAmino(object: MsgCreateDenomResponseAmino): MsgCreateDenomResponse { + const message = createBaseMsgCreateDenomResponse(); + if (object.new_token_denom !== undefined && object.new_token_denom !== null) { + message.newTokenDenom = object.new_token_denom; + } + return message; + }, + toAmino(message: MsgCreateDenomResponse): MsgCreateDenomResponseAmino { + const obj: any = {}; + obj.new_token_denom = message.newTokenDenom === "" ? undefined : message.newTokenDenom; + return obj; + }, + fromAminoMsg(object: MsgCreateDenomResponseAminoMsg): MsgCreateDenomResponse { + return MsgCreateDenomResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgCreateDenomResponse): MsgCreateDenomResponseAminoMsg { + return { + type: "wasm/MsgCreateDenomResponse", + value: MsgCreateDenomResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgCreateDenomResponseProtoMsg): MsgCreateDenomResponse { + return MsgCreateDenomResponse.decode(message.value); + }, + toProto(message: MsgCreateDenomResponse): Uint8Array { + return MsgCreateDenomResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgCreateDenomResponse): MsgCreateDenomResponseProtoMsg { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgCreateDenomResponse", + value: MsgCreateDenomResponse.encode(message).finish() + }; + } +}; +function createBaseMsgMint(): MsgMint { + return { + sender: "", + amount: Coin.fromPartial({}), + mintToAddress: "" + }; +} +export const MsgMint = { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgMint", + encode(message: MsgMint, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim(); + } + if (message.mintToAddress !== "") { + writer.uint32(26).string(message.mintToAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgMint { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMint(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.amount = Coin.decode(reader, reader.uint32()); + break; + case 3: + message.mintToAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgMint { + const message = createBaseMsgMint(); + message.sender = object.sender ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + message.mintToAddress = object.mintToAddress ?? ""; + return message; + }, + fromAmino(object: MsgMintAmino): MsgMint { + const message = createBaseMsgMint(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + if (object.mintToAddress !== undefined && object.mintToAddress !== null) { + message.mintToAddress = object.mintToAddress; + } + return message; + }, + toAmino(message: MsgMint): MsgMintAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + obj.mintToAddress = message.mintToAddress === "" ? undefined : message.mintToAddress; + return obj; + }, + fromAminoMsg(object: MsgMintAminoMsg): MsgMint { + return MsgMint.fromAmino(object.value); + }, + toAminoMsg(message: MsgMint): MsgMintAminoMsg { + return { + type: "wasm/MsgMint", + value: MsgMint.toAmino(message) + }; + }, + fromProtoMsg(message: MsgMintProtoMsg): MsgMint { + return MsgMint.decode(message.value); + }, + toProto(message: MsgMint): Uint8Array { + return MsgMint.encode(message).finish(); + }, + toProtoMsg(message: MsgMint): MsgMintProtoMsg { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgMint", + value: MsgMint.encode(message).finish() + }; + } +}; +function createBaseMsgMintResponse(): MsgMintResponse { + return {}; +} +export const MsgMintResponse = { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgMintResponse", + encode(_: MsgMintResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgMintResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMintResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgMintResponse { + const message = createBaseMsgMintResponse(); + return message; + }, + fromAmino(_: MsgMintResponseAmino): MsgMintResponse { + const message = createBaseMsgMintResponse(); + return message; + }, + toAmino(_: MsgMintResponse): MsgMintResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgMintResponseAminoMsg): MsgMintResponse { + return MsgMintResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgMintResponse): MsgMintResponseAminoMsg { + return { + type: "wasm/MsgMintResponse", + value: MsgMintResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgMintResponseProtoMsg): MsgMintResponse { + return MsgMintResponse.decode(message.value); + }, + toProto(message: MsgMintResponse): Uint8Array { + return MsgMintResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgMintResponse): MsgMintResponseProtoMsg { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgMintResponse", + value: MsgMintResponse.encode(message).finish() + }; + } +}; +function createBaseMsgBurn(): MsgBurn { + return { + sender: "", + amount: Coin.fromPartial({}), + burnFromAddress: "" + }; +} +export const MsgBurn = { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgBurn", + encode(message: MsgBurn, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim(); + } + if (message.burnFromAddress !== "") { + writer.uint32(26).string(message.burnFromAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBurn { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBurn(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.amount = Coin.decode(reader, reader.uint32()); + break; + case 3: + message.burnFromAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgBurn { + const message = createBaseMsgBurn(); + message.sender = object.sender ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + message.burnFromAddress = object.burnFromAddress ?? ""; + return message; + }, + fromAmino(object: MsgBurnAmino): MsgBurn { + const message = createBaseMsgBurn(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + if (object.burnFromAddress !== undefined && object.burnFromAddress !== null) { + message.burnFromAddress = object.burnFromAddress; + } + return message; + }, + toAmino(message: MsgBurn): MsgBurnAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + obj.burnFromAddress = message.burnFromAddress === "" ? undefined : message.burnFromAddress; + return obj; + }, + fromAminoMsg(object: MsgBurnAminoMsg): MsgBurn { + return MsgBurn.fromAmino(object.value); + }, + toAminoMsg(message: MsgBurn): MsgBurnAminoMsg { + return { + type: "wasm/MsgBurn", + value: MsgBurn.toAmino(message) + }; + }, + fromProtoMsg(message: MsgBurnProtoMsg): MsgBurn { + return MsgBurn.decode(message.value); + }, + toProto(message: MsgBurn): Uint8Array { + return MsgBurn.encode(message).finish(); + }, + toProtoMsg(message: MsgBurn): MsgBurnProtoMsg { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgBurn", + value: MsgBurn.encode(message).finish() + }; + } +}; +function createBaseMsgBurnResponse(): MsgBurnResponse { + return {}; +} +export const MsgBurnResponse = { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgBurnResponse", + encode(_: MsgBurnResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgBurnResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBurnResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgBurnResponse { + const message = createBaseMsgBurnResponse(); + return message; + }, + fromAmino(_: MsgBurnResponseAmino): MsgBurnResponse { + const message = createBaseMsgBurnResponse(); + return message; + }, + toAmino(_: MsgBurnResponse): MsgBurnResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgBurnResponseAminoMsg): MsgBurnResponse { + return MsgBurnResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgBurnResponse): MsgBurnResponseAminoMsg { + return { + type: "wasm/MsgBurnResponse", + value: MsgBurnResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgBurnResponseProtoMsg): MsgBurnResponse { + return MsgBurnResponse.decode(message.value); + }, + toProto(message: MsgBurnResponse): Uint8Array { + return MsgBurnResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgBurnResponse): MsgBurnResponseProtoMsg { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgBurnResponse", + value: MsgBurnResponse.encode(message).finish() + }; + } +}; +function createBaseMsgChangeAdmin(): MsgChangeAdmin { + return { + sender: "", + denom: "", + newAdmin: "" + }; +} +export const MsgChangeAdmin = { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgChangeAdmin", + encode(message: MsgChangeAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + if (message.newAdmin !== "") { + writer.uint32(26).string(message.newAdmin); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChangeAdmin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChangeAdmin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.denom = reader.string(); + break; + case 3: + message.newAdmin = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgChangeAdmin { + const message = createBaseMsgChangeAdmin(); + message.sender = object.sender ?? ""; + message.denom = object.denom ?? ""; + message.newAdmin = object.newAdmin ?? ""; + return message; + }, + fromAmino(object: MsgChangeAdminAmino): MsgChangeAdmin { + const message = createBaseMsgChangeAdmin(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + if (object.new_admin !== undefined && object.new_admin !== null) { + message.newAdmin = object.new_admin; + } + return message; + }, + toAmino(message: MsgChangeAdmin): MsgChangeAdminAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.denom = message.denom === "" ? undefined : message.denom; + obj.new_admin = message.newAdmin === "" ? undefined : message.newAdmin; + return obj; + }, + fromAminoMsg(object: MsgChangeAdminAminoMsg): MsgChangeAdmin { + return MsgChangeAdmin.fromAmino(object.value); + }, + toAminoMsg(message: MsgChangeAdmin): MsgChangeAdminAminoMsg { + return { + type: "wasm/MsgChangeAdmin", + value: MsgChangeAdmin.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChangeAdminProtoMsg): MsgChangeAdmin { + return MsgChangeAdmin.decode(message.value); + }, + toProto(message: MsgChangeAdmin): Uint8Array { + return MsgChangeAdmin.encode(message).finish(); + }, + toProtoMsg(message: MsgChangeAdmin): MsgChangeAdminProtoMsg { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgChangeAdmin", + value: MsgChangeAdmin.encode(message).finish() + }; + } +}; +function createBaseMsgChangeAdminResponse(): MsgChangeAdminResponse { + return {}; +} +export const MsgChangeAdminResponse = { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgChangeAdminResponse", + encode(_: MsgChangeAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChangeAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChangeAdminResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgChangeAdminResponse { + const message = createBaseMsgChangeAdminResponse(); + return message; + }, + fromAmino(_: MsgChangeAdminResponseAmino): MsgChangeAdminResponse { + const message = createBaseMsgChangeAdminResponse(); + return message; + }, + toAmino(_: MsgChangeAdminResponse): MsgChangeAdminResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgChangeAdminResponseAminoMsg): MsgChangeAdminResponse { + return MsgChangeAdminResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChangeAdminResponse): MsgChangeAdminResponseAminoMsg { + return { + type: "wasm/MsgChangeAdminResponse", + value: MsgChangeAdminResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChangeAdminResponseProtoMsg): MsgChangeAdminResponse { + return MsgChangeAdminResponse.decode(message.value); + }, + toProto(message: MsgChangeAdminResponse): Uint8Array { + return MsgChangeAdminResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChangeAdminResponse): MsgChangeAdminResponseProtoMsg { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgChangeAdminResponse", + value: MsgChangeAdminResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSetDenomMetadata(): MsgSetDenomMetadata { + return { + sender: "", + metadata: Metadata.fromPartial({}) + }; +} +export const MsgSetDenomMetadata = { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgSetDenomMetadata", + encode(message: MsgSetDenomMetadata, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.metadata !== undefined) { + Metadata.encode(message.metadata, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetDenomMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetDenomMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.metadata = Metadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSetDenomMetadata { + const message = createBaseMsgSetDenomMetadata(); + message.sender = object.sender ?? ""; + message.metadata = object.metadata !== undefined && object.metadata !== null ? Metadata.fromPartial(object.metadata) : undefined; + return message; + }, + fromAmino(object: MsgSetDenomMetadataAmino): MsgSetDenomMetadata { + const message = createBaseMsgSetDenomMetadata(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = Metadata.fromAmino(object.metadata); + } + return message; + }, + toAmino(message: MsgSetDenomMetadata): MsgSetDenomMetadataAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.metadata = message.metadata ? Metadata.toAmino(message.metadata) : undefined; + return obj; + }, + fromAminoMsg(object: MsgSetDenomMetadataAminoMsg): MsgSetDenomMetadata { + return MsgSetDenomMetadata.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetDenomMetadata): MsgSetDenomMetadataAminoMsg { + return { + type: "wasm/MsgSetDenomMetadata", + value: MsgSetDenomMetadata.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSetDenomMetadataProtoMsg): MsgSetDenomMetadata { + return MsgSetDenomMetadata.decode(message.value); + }, + toProto(message: MsgSetDenomMetadata): Uint8Array { + return MsgSetDenomMetadata.encode(message).finish(); + }, + toProtoMsg(message: MsgSetDenomMetadata): MsgSetDenomMetadataProtoMsg { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgSetDenomMetadata", + value: MsgSetDenomMetadata.encode(message).finish() + }; + } +}; +function createBaseMsgSetDenomMetadataResponse(): MsgSetDenomMetadataResponse { + return {}; +} +export const MsgSetDenomMetadataResponse = { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgSetDenomMetadataResponse", + encode(_: MsgSetDenomMetadataResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetDenomMetadataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSetDenomMetadataResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgSetDenomMetadataResponse { + const message = createBaseMsgSetDenomMetadataResponse(); + return message; + }, + fromAmino(_: MsgSetDenomMetadataResponseAmino): MsgSetDenomMetadataResponse { + const message = createBaseMsgSetDenomMetadataResponse(); + return message; + }, + toAmino(_: MsgSetDenomMetadataResponse): MsgSetDenomMetadataResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgSetDenomMetadataResponseAminoMsg): MsgSetDenomMetadataResponse { + return MsgSetDenomMetadataResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSetDenomMetadataResponse): MsgSetDenomMetadataResponseAminoMsg { + return { + type: "wasm/MsgSetDenomMetadataResponse", + value: MsgSetDenomMetadataResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSetDenomMetadataResponseProtoMsg): MsgSetDenomMetadataResponse { + return MsgSetDenomMetadataResponse.decode(message.value); + }, + toProto(message: MsgSetDenomMetadataResponse): Uint8Array { + return MsgSetDenomMetadataResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSetDenomMetadataResponse): MsgSetDenomMetadataResponseProtoMsg { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgSetDenomMetadataResponse", + value: MsgSetDenomMetadataResponse.encode(message).finish() + }; + } +}; +function createBaseMsgForceTransfer(): MsgForceTransfer { + return { + sender: "", + amount: Coin.fromPartial({}), + transferFromAddress: "", + transferToAddress: "" + }; +} +export const MsgForceTransfer = { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgForceTransfer", + encode(message: MsgForceTransfer, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim(); + } + if (message.transferFromAddress !== "") { + writer.uint32(26).string(message.transferFromAddress); + } + if (message.transferToAddress !== "") { + writer.uint32(34).string(message.transferToAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgForceTransfer { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgForceTransfer(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.amount = Coin.decode(reader, reader.uint32()); + break; + case 3: + message.transferFromAddress = reader.string(); + break; + case 4: + message.transferToAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgForceTransfer { + const message = createBaseMsgForceTransfer(); + message.sender = object.sender ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + message.transferFromAddress = object.transferFromAddress ?? ""; + message.transferToAddress = object.transferToAddress ?? ""; + return message; + }, + fromAmino(object: MsgForceTransferAmino): MsgForceTransfer { + const message = createBaseMsgForceTransfer(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + if (object.transferFromAddress !== undefined && object.transferFromAddress !== null) { + message.transferFromAddress = object.transferFromAddress; + } + if (object.transferToAddress !== undefined && object.transferToAddress !== null) { + message.transferToAddress = object.transferToAddress; + } + return message; + }, + toAmino(message: MsgForceTransfer): MsgForceTransferAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + obj.transferFromAddress = message.transferFromAddress === "" ? undefined : message.transferFromAddress; + obj.transferToAddress = message.transferToAddress === "" ? undefined : message.transferToAddress; + return obj; + }, + fromAminoMsg(object: MsgForceTransferAminoMsg): MsgForceTransfer { + return MsgForceTransfer.fromAmino(object.value); + }, + toAminoMsg(message: MsgForceTransfer): MsgForceTransferAminoMsg { + return { + type: "wasm/MsgForceTransfer", + value: MsgForceTransfer.toAmino(message) + }; + }, + fromProtoMsg(message: MsgForceTransferProtoMsg): MsgForceTransfer { + return MsgForceTransfer.decode(message.value); + }, + toProto(message: MsgForceTransfer): Uint8Array { + return MsgForceTransfer.encode(message).finish(); + }, + toProtoMsg(message: MsgForceTransfer): MsgForceTransferProtoMsg { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgForceTransfer", + value: MsgForceTransfer.encode(message).finish() + }; + } +}; +function createBaseMsgForceTransferResponse(): MsgForceTransferResponse { + return {}; +} +export const MsgForceTransferResponse = { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgForceTransferResponse", + encode(_: MsgForceTransferResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgForceTransferResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgForceTransferResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgForceTransferResponse { + const message = createBaseMsgForceTransferResponse(); + return message; + }, + fromAmino(_: MsgForceTransferResponseAmino): MsgForceTransferResponse { + const message = createBaseMsgForceTransferResponse(); + return message; + }, + toAmino(_: MsgForceTransferResponse): MsgForceTransferResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgForceTransferResponseAminoMsg): MsgForceTransferResponse { + return MsgForceTransferResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgForceTransferResponse): MsgForceTransferResponseAminoMsg { + return { + type: "wasm/MsgForceTransferResponse", + value: MsgForceTransferResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgForceTransferResponseProtoMsg): MsgForceTransferResponse { + return MsgForceTransferResponse.decode(message.value); + }, + toProto(message: MsgForceTransferResponse): Uint8Array { + return MsgForceTransferResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgForceTransferResponse): MsgForceTransferResponseProtoMsg { + return { + typeUrl: "/cosmwasm.tokenfactory.v1beta1.MsgForceTransferResponse", + value: MsgForceTransferResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmwasm/wasm/v1/authz.ts b/src/codegen/cosmwasm/wasm/v1/authz.ts index 2996bb7..2a54292 100644 --- a/src/codegen/cosmwasm/wasm/v1/authz.ts +++ b/src/codegen/cosmwasm/wasm/v1/authz.ts @@ -1,7 +1,40 @@ +import { AccessConfig, AccessConfigAmino, AccessConfigSDKType } from "./types"; import { Any, AnyAmino, AnySDKType } from "../../../google/protobuf/any"; import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; import { toUtf8, fromUtf8 } from "@cosmjs/encoding"; +/** + * StoreCodeAuthorization defines authorization for wasm code upload. + * Since: wasmd 0.42 + */ +export interface StoreCodeAuthorization { + /** Grants for code upload */ + grants: CodeGrant[]; +} +export interface StoreCodeAuthorizationProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.StoreCodeAuthorization"; + value: Uint8Array; +} +/** + * StoreCodeAuthorization defines authorization for wasm code upload. + * Since: wasmd 0.42 + */ +export interface StoreCodeAuthorizationAmino { + /** Grants for code upload */ + grants: CodeGrantAmino[]; +} +export interface StoreCodeAuthorizationAminoMsg { + type: "wasm/StoreCodeAuthorization"; + value: StoreCodeAuthorizationAmino; +} +/** + * StoreCodeAuthorization defines authorization for wasm code upload. + * Since: wasmd 0.42 + */ +export interface StoreCodeAuthorizationSDKType { + grants: CodeGrantSDKType[]; +} /** * ContractExecutionAuthorization defines authorization for wasm execute. * Since: wasmd 0.30 @@ -20,7 +53,7 @@ export interface ContractExecutionAuthorizationProtoMsg { */ export interface ContractExecutionAuthorizationAmino { /** Grants for contract executions */ - grants?: ContractGrantAmino[]; + grants: ContractGrantAmino[]; } export interface ContractExecutionAuthorizationAminoMsg { type: "wasm/ContractExecutionAuthorization"; @@ -51,7 +84,7 @@ export interface ContractMigrationAuthorizationProtoMsg { */ export interface ContractMigrationAuthorizationAmino { /** Grants for contract migrations */ - grants?: ContractGrantAmino[]; + grants: ContractGrantAmino[]; } export interface ContractMigrationAuthorizationAminoMsg { type: "wasm/ContractMigrationAuthorization"; @@ -64,6 +97,47 @@ export interface ContractMigrationAuthorizationAminoMsg { export interface ContractMigrationAuthorizationSDKType { grants: ContractGrantSDKType[]; } +/** CodeGrant a granted permission for a single code */ +export interface CodeGrant { + /** + * CodeHash is the unique identifier created by wasmvm + * Wildcard "*" is used to specify any kind of grant. + */ + codeHash: Uint8Array; + /** + * InstantiatePermission is the superset access control to apply + * on contract creation. + * Optional + */ + instantiatePermission?: AccessConfig; +} +export interface CodeGrantProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.CodeGrant"; + value: Uint8Array; +} +/** CodeGrant a granted permission for a single code */ +export interface CodeGrantAmino { + /** + * CodeHash is the unique identifier created by wasmvm + * Wildcard "*" is used to specify any kind of grant. + */ + code_hash?: string; + /** + * InstantiatePermission is the superset access control to apply + * on contract creation. + * Optional + */ + instantiate_permission?: AccessConfigAmino; +} +export interface CodeGrantAminoMsg { + type: "wasm/CodeGrant"; + value: CodeGrantAmino; +} +/** CodeGrant a granted permission for a single code */ +export interface CodeGrantSDKType { + code_hash: Uint8Array; + instantiate_permission?: AccessConfigSDKType; +} /** * ContractGrant a granted permission for a single contract * Since: wasmd 0.30 @@ -168,7 +242,7 @@ export interface MaxFundsLimitProtoMsg { */ export interface MaxFundsLimitAmino { /** Amounts is the maximal amount of tokens transferable to the contract. */ - amounts?: CoinAmino[]; + amounts: CoinAmino[]; } export interface MaxFundsLimitAminoMsg { type: "wasm/MaxFundsLimit"; @@ -205,7 +279,7 @@ export interface CombinedLimitAmino { /** Remaining number that is decremented on each execution */ calls_remaining?: string; /** Amounts is the maximal amount of tokens transferable to the contract. */ - amounts?: CoinAmino[]; + amounts: CoinAmino[]; } export interface CombinedLimitAminoMsg { type: "wasm/CombinedLimit"; @@ -314,6 +388,77 @@ export interface AcceptedMessagesFilterAminoMsg { export interface AcceptedMessagesFilterSDKType { messages: Uint8Array[]; } +function createBaseStoreCodeAuthorization(): StoreCodeAuthorization { + return { + grants: [] + }; +} +export const StoreCodeAuthorization = { + typeUrl: "/cosmwasm.wasm.v1.StoreCodeAuthorization", + encode(message: StoreCodeAuthorization, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.grants) { + CodeGrant.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StoreCodeAuthorization { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStoreCodeAuthorization(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.grants.push(CodeGrant.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StoreCodeAuthorization { + const message = createBaseStoreCodeAuthorization(); + message.grants = object.grants?.map(e => CodeGrant.fromPartial(e)) || []; + return message; + }, + fromAmino(object: StoreCodeAuthorizationAmino): StoreCodeAuthorization { + const message = createBaseStoreCodeAuthorization(); + message.grants = object.grants?.map(e => CodeGrant.fromAmino(e)) || []; + return message; + }, + toAmino(message: StoreCodeAuthorization): StoreCodeAuthorizationAmino { + const obj: any = {}; + if (message.grants) { + obj.grants = message.grants.map(e => e ? CodeGrant.toAmino(e) : undefined); + } else { + obj.grants = message.grants; + } + return obj; + }, + fromAminoMsg(object: StoreCodeAuthorizationAminoMsg): StoreCodeAuthorization { + return StoreCodeAuthorization.fromAmino(object.value); + }, + toAminoMsg(message: StoreCodeAuthorization): StoreCodeAuthorizationAminoMsg { + return { + type: "wasm/StoreCodeAuthorization", + value: StoreCodeAuthorization.toAmino(message) + }; + }, + fromProtoMsg(message: StoreCodeAuthorizationProtoMsg): StoreCodeAuthorization { + return StoreCodeAuthorization.decode(message.value); + }, + toProto(message: StoreCodeAuthorization): Uint8Array { + return StoreCodeAuthorization.encode(message).finish(); + }, + toProtoMsg(message: StoreCodeAuthorization): StoreCodeAuthorizationProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.StoreCodeAuthorization", + value: StoreCodeAuthorization.encode(message).finish() + }; + } +}; function createBaseContractExecutionAuthorization(): ContractExecutionAuthorization { return { grants: [] @@ -456,6 +601,87 @@ export const ContractMigrationAuthorization = { }; } }; +function createBaseCodeGrant(): CodeGrant { + return { + codeHash: new Uint8Array(), + instantiatePermission: undefined + }; +} +export const CodeGrant = { + typeUrl: "/cosmwasm.wasm.v1.CodeGrant", + encode(message: CodeGrant, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeHash.length !== 0) { + writer.uint32(10).bytes(message.codeHash); + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): CodeGrant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCodeGrant(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeHash = reader.bytes(); + break; + case 2: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): CodeGrant { + const message = createBaseCodeGrant(); + message.codeHash = object.codeHash ?? new Uint8Array(); + message.instantiatePermission = object.instantiatePermission !== undefined && object.instantiatePermission !== null ? AccessConfig.fromPartial(object.instantiatePermission) : undefined; + return message; + }, + fromAmino(object: CodeGrantAmino): CodeGrant { + const message = createBaseCodeGrant(); + if (object.code_hash !== undefined && object.code_hash !== null) { + message.codeHash = bytesFromBase64(object.code_hash); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); + } + return message; + }, + toAmino(message: CodeGrant): CodeGrantAmino { + const obj: any = {}; + obj.code_hash = message.codeHash ? base64FromBytes(message.codeHash) : undefined; + obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : undefined; + return obj; + }, + fromAminoMsg(object: CodeGrantAminoMsg): CodeGrant { + return CodeGrant.fromAmino(object.value); + }, + toAminoMsg(message: CodeGrant): CodeGrantAminoMsg { + return { + type: "wasm/CodeGrant", + value: CodeGrant.toAmino(message) + }; + }, + fromProtoMsg(message: CodeGrantProtoMsg): CodeGrant { + return CodeGrant.decode(message.value); + }, + toProto(message: CodeGrant): Uint8Array { + return CodeGrant.encode(message).finish(); + }, + toProtoMsg(message: CodeGrant): CodeGrantProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.CodeGrant", + value: CodeGrant.encode(message).finish() + }; + } +}; function createBaseContractGrant(): ContractGrant { return { contract: "", diff --git a/src/codegen/cosmwasm/wasm/v1/genesis.ts b/src/codegen/cosmwasm/wasm/v1/genesis.ts index c8e458c..d3c01d7 100644 --- a/src/codegen/cosmwasm/wasm/v1/genesis.ts +++ b/src/codegen/cosmwasm/wasm/v1/genesis.ts @@ -14,7 +14,7 @@ export interface GenesisStateProtoMsg { } /** GenesisState - genesis state of x/wasm */ export interface GenesisStateAmino { - params?: ParamsAmino; + params: ParamsAmino; codes?: CodeAmino[]; contracts?: ContractAmino[]; sequences?: SequenceAmino[]; @@ -45,7 +45,7 @@ export interface CodeProtoMsg { /** Code struct encompasses CodeInfo and CodeBytes */ export interface CodeAmino { code_id?: string; - code_info?: CodeInfoAmino; + code_info: CodeInfoAmino; code_bytes?: string; /** Pinned to wasmvm cache */ pinned?: boolean; @@ -75,9 +75,9 @@ export interface ContractProtoMsg { /** Contract struct encompasses ContractAddress, ContractInfo, and ContractState */ export interface ContractAmino { contract_address?: string; - contract_info?: ContractInfoAmino; - contract_state?: ModelAmino[]; - contract_code_history?: ContractCodeHistoryEntryAmino[]; + contract_info: ContractInfoAmino; + contract_state: ModelAmino[]; + contract_code_history: ContractCodeHistoryEntryAmino[]; } export interface ContractAminoMsg { type: "wasm/Contract"; @@ -184,7 +184,7 @@ export const GenesisState = { }, toAmino(message: GenesisState): GenesisStateAmino { const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.params = message.params ? Params.toAmino(message.params) : Params.toAmino(Params.fromPartial({})); if (message.codes) { obj.codes = message.codes.map(e => e ? Code.toAmino(e) : undefined); } else { @@ -302,7 +302,7 @@ export const Code = { toAmino(message: Code): CodeAmino { const obj: any = {}; obj.code_id = message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; - obj.code_info = message.codeInfo ? CodeInfo.toAmino(message.codeInfo) : undefined; + obj.code_info = message.codeInfo ? CodeInfo.toAmino(message.codeInfo) : CodeInfo.toAmino(CodeInfo.fromPartial({})); obj.code_bytes = message.codeBytes ? base64FromBytes(message.codeBytes) : undefined; obj.pinned = message.pinned === false ? undefined : message.pinned; return obj; @@ -403,7 +403,7 @@ export const Contract = { toAmino(message: Contract): ContractAmino { const obj: any = {}; obj.contract_address = message.contractAddress === "" ? undefined : message.contractAddress; - obj.contract_info = message.contractInfo ? ContractInfo.toAmino(message.contractInfo) : undefined; + obj.contract_info = message.contractInfo ? ContractInfo.toAmino(message.contractInfo) : ContractInfo.toAmino(ContractInfo.fromPartial({})); if (message.contractState) { obj.contract_state = message.contractState.map(e => e ? Model.toAmino(e) : undefined); } else { diff --git a/src/codegen/cosmwasm/wasm/v1/ibc.ts b/src/codegen/cosmwasm/wasm/v1/ibc.ts index 6369913..1561cad 100644 --- a/src/codegen/cosmwasm/wasm/v1/ibc.ts +++ b/src/codegen/cosmwasm/wasm/v1/ibc.ts @@ -77,6 +77,20 @@ export interface MsgIBCSendResponseAminoMsg { export interface MsgIBCSendResponseSDKType { sequence: bigint; } +/** MsgIBCWriteAcknowledgementResponse */ +export interface MsgIBCWriteAcknowledgementResponse {} +export interface MsgIBCWriteAcknowledgementResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgIBCWriteAcknowledgementResponse"; + value: Uint8Array; +} +/** MsgIBCWriteAcknowledgementResponse */ +export interface MsgIBCWriteAcknowledgementResponseAmino {} +export interface MsgIBCWriteAcknowledgementResponseAminoMsg { + type: "wasm/MsgIBCWriteAcknowledgementResponse"; + value: MsgIBCWriteAcknowledgementResponseAmino; +} +/** MsgIBCWriteAcknowledgementResponse */ +export interface MsgIBCWriteAcknowledgementResponseSDKType {} /** MsgIBCCloseChannel port and channel need to be owned by the contract */ export interface MsgIBCCloseChannel { channel: string; @@ -271,6 +285,62 @@ export const MsgIBCSendResponse = { }; } }; +function createBaseMsgIBCWriteAcknowledgementResponse(): MsgIBCWriteAcknowledgementResponse { + return {}; +} +export const MsgIBCWriteAcknowledgementResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgIBCWriteAcknowledgementResponse", + encode(_: MsgIBCWriteAcknowledgementResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgIBCWriteAcknowledgementResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgIBCWriteAcknowledgementResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgIBCWriteAcknowledgementResponse { + const message = createBaseMsgIBCWriteAcknowledgementResponse(); + return message; + }, + fromAmino(_: MsgIBCWriteAcknowledgementResponseAmino): MsgIBCWriteAcknowledgementResponse { + const message = createBaseMsgIBCWriteAcknowledgementResponse(); + return message; + }, + toAmino(_: MsgIBCWriteAcknowledgementResponse): MsgIBCWriteAcknowledgementResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgIBCWriteAcknowledgementResponseAminoMsg): MsgIBCWriteAcknowledgementResponse { + return MsgIBCWriteAcknowledgementResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgIBCWriteAcknowledgementResponse): MsgIBCWriteAcknowledgementResponseAminoMsg { + return { + type: "wasm/MsgIBCWriteAcknowledgementResponse", + value: MsgIBCWriteAcknowledgementResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgIBCWriteAcknowledgementResponseProtoMsg): MsgIBCWriteAcknowledgementResponse { + return MsgIBCWriteAcknowledgementResponse.decode(message.value); + }, + toProto(message: MsgIBCWriteAcknowledgementResponse): Uint8Array { + return MsgIBCWriteAcknowledgementResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgIBCWriteAcknowledgementResponse): MsgIBCWriteAcknowledgementResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgIBCWriteAcknowledgementResponse", + value: MsgIBCWriteAcknowledgementResponse.encode(message).finish() + }; + } +}; function createBaseMsgIBCCloseChannel(): MsgIBCCloseChannel { return { channel: "" diff --git a/src/codegen/cosmwasm/wasm/v1/proposal_legacy.ts b/src/codegen/cosmwasm/wasm/v1/proposal_legacy.ts new file mode 100644 index 0000000..6dbeebd --- /dev/null +++ b/src/codegen/cosmwasm/wasm/v1/proposal_legacy.ts @@ -0,0 +1,2773 @@ +import { AccessConfig, AccessConfigAmino, AccessConfigSDKType } from "./types"; +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { fromBase64, toBase64, toUtf8, fromUtf8 } from "@cosmjs/encoding"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit StoreCodeProposal. To submit WASM code to the system, + * a simple MsgStoreCode can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface StoreCodeProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + runAs: string; + /** WASMByteCode can be raw or gzip compressed */ + wasmByteCode: Uint8Array; + /** InstantiatePermission to apply on contract creation, optional */ + instantiatePermission?: AccessConfig; + /** UnpinCode code on upload, optional */ + unpinCode: boolean; + /** Source is the URL where the code is hosted */ + source: string; + /** + * Builder is the docker image used to build the code deterministically, used + * for smart contract verification + */ + builder: string; + /** + * CodeHash is the SHA256 sum of the code outputted by builder, used for smart + * contract verification + */ + codeHash: Uint8Array; +} +export interface StoreCodeProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.StoreCodeProposal"; + value: Uint8Array; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit StoreCodeProposal. To submit WASM code to the system, + * a simple MsgStoreCode can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface StoreCodeProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + run_as?: string; + /** WASMByteCode can be raw or gzip compressed */ + wasm_byte_code?: string; + /** InstantiatePermission to apply on contract creation, optional */ + instantiate_permission?: AccessConfigAmino; + /** UnpinCode code on upload, optional */ + unpin_code?: boolean; + /** Source is the URL where the code is hosted */ + source?: string; + /** + * Builder is the docker image used to build the code deterministically, used + * for smart contract verification + */ + builder?: string; + /** + * CodeHash is the SHA256 sum of the code outputted by builder, used for smart + * contract verification + */ + code_hash?: string; +} +export interface StoreCodeProposalAminoMsg { + type: "wasm/StoreCodeProposal"; + value: StoreCodeProposalAmino; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit StoreCodeProposal. To submit WASM code to the system, + * a simple MsgStoreCode can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface StoreCodeProposalSDKType { + title: string; + description: string; + run_as: string; + wasm_byte_code: Uint8Array; + instantiate_permission?: AccessConfigSDKType; + unpin_code: boolean; + source: string; + builder: string; + code_hash: Uint8Array; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit InstantiateContractProposal. To instantiate a contract, + * a simple MsgInstantiateContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface InstantiateContractProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + runAs: string; + /** Admin is an optional address that can execute migrations */ + admin: string; + /** CodeID is the reference to the stored WASM code */ + codeId: bigint; + /** Label is optional metadata to be stored with a constract instance. */ + label: string; + /** Msg json encoded message to be passed to the contract on instantiation */ + msg: Uint8Array; + /** Funds coins that are transferred to the contract on instantiation */ + funds: Coin[]; +} +export interface InstantiateContractProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.InstantiateContractProposal"; + value: Uint8Array; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit InstantiateContractProposal. To instantiate a contract, + * a simple MsgInstantiateContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface InstantiateContractProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + run_as?: string; + /** Admin is an optional address that can execute migrations */ + admin?: string; + /** CodeID is the reference to the stored WASM code */ + code_id?: string; + /** Label is optional metadata to be stored with a constract instance. */ + label?: string; + /** Msg json encoded message to be passed to the contract on instantiation */ + msg?: any; + /** Funds coins that are transferred to the contract on instantiation */ + funds: CoinAmino[]; +} +export interface InstantiateContractProposalAminoMsg { + type: "wasm/InstantiateContractProposal"; + value: InstantiateContractProposalAmino; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit InstantiateContractProposal. To instantiate a contract, + * a simple MsgInstantiateContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface InstantiateContractProposalSDKType { + title: string; + description: string; + run_as: string; + admin: string; + code_id: bigint; + label: string; + msg: Uint8Array; + funds: CoinSDKType[]; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit InstantiateContract2Proposal. To instantiate contract 2, + * a simple MsgInstantiateContract2 can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface InstantiateContract2Proposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** RunAs is the address that is passed to the contract's enviroment as sender */ + runAs: string; + /** Admin is an optional address that can execute migrations */ + admin: string; + /** CodeID is the reference to the stored WASM code */ + codeId: bigint; + /** Label is optional metadata to be stored with a constract instance. */ + label: string; + /** Msg json encode message to be passed to the contract on instantiation */ + msg: Uint8Array; + /** Funds coins that are transferred to the contract on instantiation */ + funds: Coin[]; + /** Salt is an arbitrary value provided by the sender. Size can be 1 to 64. */ + salt: Uint8Array; + /** + * FixMsg include the msg value into the hash for the predictable address. + * Default is false + */ + fixMsg: boolean; +} +export interface InstantiateContract2ProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.InstantiateContract2Proposal"; + value: Uint8Array; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit InstantiateContract2Proposal. To instantiate contract 2, + * a simple MsgInstantiateContract2 can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface InstantiateContract2ProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** RunAs is the address that is passed to the contract's enviroment as sender */ + run_as?: string; + /** Admin is an optional address that can execute migrations */ + admin?: string; + /** CodeID is the reference to the stored WASM code */ + code_id?: string; + /** Label is optional metadata to be stored with a constract instance. */ + label?: string; + /** Msg json encode message to be passed to the contract on instantiation */ + msg?: any; + /** Funds coins that are transferred to the contract on instantiation */ + funds: CoinAmino[]; + /** Salt is an arbitrary value provided by the sender. Size can be 1 to 64. */ + salt?: string; + /** + * FixMsg include the msg value into the hash for the predictable address. + * Default is false + */ + fix_msg?: boolean; +} +export interface InstantiateContract2ProposalAminoMsg { + type: "wasm/InstantiateContract2Proposal"; + value: InstantiateContract2ProposalAmino; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit InstantiateContract2Proposal. To instantiate contract 2, + * a simple MsgInstantiateContract2 can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface InstantiateContract2ProposalSDKType { + title: string; + description: string; + run_as: string; + admin: string; + code_id: bigint; + label: string; + msg: Uint8Array; + funds: CoinSDKType[]; + salt: Uint8Array; + fix_msg: boolean; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit MigrateContractProposal. To migrate a contract, + * a simple MsgMigrateContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface MigrateContractProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** Contract is the address of the smart contract */ + contract: string; + /** CodeID references the new WASM code */ + codeId: bigint; + /** Msg json encoded message to be passed to the contract on migration */ + msg: Uint8Array; +} +export interface MigrateContractProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MigrateContractProposal"; + value: Uint8Array; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit MigrateContractProposal. To migrate a contract, + * a simple MsgMigrateContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface MigrateContractProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** Contract is the address of the smart contract */ + contract?: string; + /** CodeID references the new WASM code */ + code_id?: string; + /** Msg json encoded message to be passed to the contract on migration */ + msg?: any; +} +export interface MigrateContractProposalAminoMsg { + type: "wasm/MigrateContractProposal"; + value: MigrateContractProposalAmino; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit MigrateContractProposal. To migrate a contract, + * a simple MsgMigrateContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface MigrateContractProposalSDKType { + title: string; + description: string; + contract: string; + code_id: bigint; + msg: Uint8Array; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit SudoContractProposal. To call sudo on a contract, + * a simple MsgSudoContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface SudoContractProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** Contract is the address of the smart contract */ + contract: string; + /** Msg json encoded message to be passed to the contract as sudo */ + msg: Uint8Array; +} +export interface SudoContractProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.SudoContractProposal"; + value: Uint8Array; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit SudoContractProposal. To call sudo on a contract, + * a simple MsgSudoContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface SudoContractProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** Contract is the address of the smart contract */ + contract?: string; + /** Msg json encoded message to be passed to the contract as sudo */ + msg?: any; +} +export interface SudoContractProposalAminoMsg { + type: "wasm/SudoContractProposal"; + value: SudoContractProposalAmino; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit SudoContractProposal. To call sudo on a contract, + * a simple MsgSudoContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface SudoContractProposalSDKType { + title: string; + description: string; + contract: string; + msg: Uint8Array; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit ExecuteContractProposal. To call execute on a contract, + * a simple MsgExecuteContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface ExecuteContractProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + runAs: string; + /** Contract is the address of the smart contract */ + contract: string; + /** Msg json encoded message to be passed to the contract as execute */ + msg: Uint8Array; + /** Funds coins that are transferred to the contract on instantiation */ + funds: Coin[]; +} +export interface ExecuteContractProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.ExecuteContractProposal"; + value: Uint8Array; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit ExecuteContractProposal. To call execute on a contract, + * a simple MsgExecuteContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface ExecuteContractProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + run_as?: string; + /** Contract is the address of the smart contract */ + contract?: string; + /** Msg json encoded message to be passed to the contract as execute */ + msg?: any; + /** Funds coins that are transferred to the contract on instantiation */ + funds: CoinAmino[]; +} +export interface ExecuteContractProposalAminoMsg { + type: "wasm/ExecuteContractProposal"; + value: ExecuteContractProposalAmino; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit ExecuteContractProposal. To call execute on a contract, + * a simple MsgExecuteContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface ExecuteContractProposalSDKType { + title: string; + description: string; + run_as: string; + contract: string; + msg: Uint8Array; + funds: CoinSDKType[]; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UpdateAdminProposal. To set an admin for a contract, + * a simple MsgUpdateAdmin can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface UpdateAdminProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** NewAdmin address to be set */ + newAdmin: string; + /** Contract is the address of the smart contract */ + contract: string; +} +export interface UpdateAdminProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.UpdateAdminProposal"; + value: Uint8Array; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UpdateAdminProposal. To set an admin for a contract, + * a simple MsgUpdateAdmin can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface UpdateAdminProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** NewAdmin address to be set */ + new_admin?: string; + /** Contract is the address of the smart contract */ + contract?: string; +} +export interface UpdateAdminProposalAminoMsg { + type: "wasm/UpdateAdminProposal"; + value: UpdateAdminProposalAmino; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UpdateAdminProposal. To set an admin for a contract, + * a simple MsgUpdateAdmin can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface UpdateAdminProposalSDKType { + title: string; + description: string; + new_admin: string; + contract: string; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit ClearAdminProposal. To clear the admin of a contract, + * a simple MsgClearAdmin can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface ClearAdminProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** Contract is the address of the smart contract */ + contract: string; +} +export interface ClearAdminProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.ClearAdminProposal"; + value: Uint8Array; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit ClearAdminProposal. To clear the admin of a contract, + * a simple MsgClearAdmin can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface ClearAdminProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** Contract is the address of the smart contract */ + contract?: string; +} +export interface ClearAdminProposalAminoMsg { + type: "wasm/ClearAdminProposal"; + value: ClearAdminProposalAmino; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit ClearAdminProposal. To clear the admin of a contract, + * a simple MsgClearAdmin can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface ClearAdminProposalSDKType { + title: string; + description: string; + contract: string; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit PinCodesProposal. To pin a set of code ids in the wasmvm + * cache, a simple MsgPinCodes can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface PinCodesProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** CodeIDs references the new WASM codes */ + codeIds: bigint[]; +} +export interface PinCodesProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.PinCodesProposal"; + value: Uint8Array; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit PinCodesProposal. To pin a set of code ids in the wasmvm + * cache, a simple MsgPinCodes can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface PinCodesProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** CodeIDs references the new WASM codes */ + code_ids?: string[]; +} +export interface PinCodesProposalAminoMsg { + type: "wasm/PinCodesProposal"; + value: PinCodesProposalAmino; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit PinCodesProposal. To pin a set of code ids in the wasmvm + * cache, a simple MsgPinCodes can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface PinCodesProposalSDKType { + title: string; + description: string; + code_ids: bigint[]; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UnpinCodesProposal. To unpin a set of code ids in the wasmvm + * cache, a simple MsgUnpinCodes can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface UnpinCodesProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** CodeIDs references the WASM codes */ + codeIds: bigint[]; +} +export interface UnpinCodesProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.UnpinCodesProposal"; + value: Uint8Array; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UnpinCodesProposal. To unpin a set of code ids in the wasmvm + * cache, a simple MsgUnpinCodes can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface UnpinCodesProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** CodeIDs references the WASM codes */ + code_ids?: string[]; +} +export interface UnpinCodesProposalAminoMsg { + type: "wasm/UnpinCodesProposal"; + value: UnpinCodesProposalAmino; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UnpinCodesProposal. To unpin a set of code ids in the wasmvm + * cache, a simple MsgUnpinCodes can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface UnpinCodesProposalSDKType { + title: string; + description: string; + code_ids: bigint[]; +} +/** + * SetGasLessContractsProposal gov proposal content type to set gassless a set of contract addresses in the + * wasmvm cache. + */ +export interface SetGasLessContractsProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** ContractAddresses references the new WASM addresses */ + contractAddresses: string[]; +} +export interface SetGasLessContractsProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.SetGasLessContractsProposal"; + value: Uint8Array; +} +/** + * SetGasLessContractsProposal gov proposal content type to set gassless a set of contract addresses in the + * wasmvm cache. + */ +export interface SetGasLessContractsProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** ContractAddresses references the new WASM addresses */ + contract_addresses?: string[]; +} +export interface SetGasLessContractsProposalAminoMsg { + type: "wasm/SetGasLessContractsProposal"; + value: SetGasLessContractsProposalAmino; +} +/** + * SetGasLessContractsProposal gov proposal content type to set gassless a set of contract addresses in the + * wasmvm cache. + */ +export interface SetGasLessContractsProposalSDKType { + title: string; + description: string; + contract_addresses: string[]; +} +/** + * UnsetGasLessContractsProposal gov proposal content type to unset gassless a set of contract addresses in + * the wasmvm cache. + */ +export interface UnsetGasLessContractsProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** ContractAddresses references the new WASM addresses */ + contractAddresses: string[]; +} +export interface UnsetGasLessContractsProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.UnsetGasLessContractsProposal"; + value: Uint8Array; +} +/** + * UnsetGasLessContractsProposal gov proposal content type to unset gassless a set of contract addresses in + * the wasmvm cache. + */ +export interface UnsetGasLessContractsProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** ContractAddresses references the new WASM addresses */ + contract_addresses?: string[]; +} +export interface UnsetGasLessContractsProposalAminoMsg { + type: "wasm/UnsetGasLessContractsProposal"; + value: UnsetGasLessContractsProposalAmino; +} +/** + * UnsetGasLessContractsProposal gov proposal content type to unset gassless a set of contract addresses in + * the wasmvm cache. + */ +export interface UnsetGasLessContractsProposalSDKType { + title: string; + description: string; + contract_addresses: string[]; +} +/** + * AccessConfigUpdate contains the code id and the access config to be + * applied. + */ +export interface AccessConfigUpdate { + /** CodeID is the reference to the stored WASM code to be updated */ + codeId: bigint; + /** InstantiatePermission to apply to the set of code ids */ + instantiatePermission: AccessConfig; +} +export interface AccessConfigUpdateProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.AccessConfigUpdate"; + value: Uint8Array; +} +/** + * AccessConfigUpdate contains the code id and the access config to be + * applied. + */ +export interface AccessConfigUpdateAmino { + /** CodeID is the reference to the stored WASM code to be updated */ + code_id?: string; + /** InstantiatePermission to apply to the set of code ids */ + instantiate_permission: AccessConfigAmino; +} +export interface AccessConfigUpdateAminoMsg { + type: "wasm/AccessConfigUpdate"; + value: AccessConfigUpdateAmino; +} +/** + * AccessConfigUpdate contains the code id and the access config to be + * applied. + */ +export interface AccessConfigUpdateSDKType { + code_id: bigint; + instantiate_permission: AccessConfigSDKType; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UpdateInstantiateConfigProposal. To update instantiate config + * to a set of code ids, a simple MsgUpdateInstantiateConfig can be invoked from + * the x/gov module via a v1 governance proposal. + */ +/** @deprecated */ +export interface UpdateInstantiateConfigProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** + * AccessConfigUpdate contains the list of code ids and the access config + * to be applied. + */ + accessConfigUpdates: AccessConfigUpdate[]; +} +export interface UpdateInstantiateConfigProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal"; + value: Uint8Array; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UpdateInstantiateConfigProposal. To update instantiate config + * to a set of code ids, a simple MsgUpdateInstantiateConfig can be invoked from + * the x/gov module via a v1 governance proposal. + */ +/** @deprecated */ +export interface UpdateInstantiateConfigProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** + * AccessConfigUpdate contains the list of code ids and the access config + * to be applied. + */ + access_config_updates: AccessConfigUpdateAmino[]; +} +export interface UpdateInstantiateConfigProposalAminoMsg { + type: "wasm/UpdateInstantiateConfigProposal"; + value: UpdateInstantiateConfigProposalAmino; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UpdateInstantiateConfigProposal. To update instantiate config + * to a set of code ids, a simple MsgUpdateInstantiateConfig can be invoked from + * the x/gov module via a v1 governance proposal. + */ +/** @deprecated */ +export interface UpdateInstantiateConfigProposalSDKType { + title: string; + description: string; + access_config_updates: AccessConfigUpdateSDKType[]; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit StoreAndInstantiateContractProposal. To store and instantiate + * the contract, a simple MsgStoreAndInstantiateContract can be invoked from + * the x/gov module via a v1 governance proposal. + */ +/** @deprecated */ +export interface StoreAndInstantiateContractProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + runAs: string; + /** WASMByteCode can be raw or gzip compressed */ + wasmByteCode: Uint8Array; + /** InstantiatePermission to apply on contract creation, optional */ + instantiatePermission?: AccessConfig; + /** UnpinCode code on upload, optional */ + unpinCode: boolean; + /** Admin is an optional address that can execute migrations */ + admin: string; + /** Label is optional metadata to be stored with a constract instance. */ + label: string; + /** Msg json encoded message to be passed to the contract on instantiation */ + msg: Uint8Array; + /** Funds coins that are transferred to the contract on instantiation */ + funds: Coin[]; + /** Source is the URL where the code is hosted */ + source: string; + /** + * Builder is the docker image used to build the code deterministically, used + * for smart contract verification + */ + builder: string; + /** + * CodeHash is the SHA256 sum of the code outputted by builder, used for smart + * contract verification + */ + codeHash: Uint8Array; +} +export interface StoreAndInstantiateContractProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal"; + value: Uint8Array; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit StoreAndInstantiateContractProposal. To store and instantiate + * the contract, a simple MsgStoreAndInstantiateContract can be invoked from + * the x/gov module via a v1 governance proposal. + */ +/** @deprecated */ +export interface StoreAndInstantiateContractProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + run_as?: string; + /** WASMByteCode can be raw or gzip compressed */ + wasm_byte_code?: string; + /** InstantiatePermission to apply on contract creation, optional */ + instantiate_permission?: AccessConfigAmino; + /** UnpinCode code on upload, optional */ + unpin_code?: boolean; + /** Admin is an optional address that can execute migrations */ + admin?: string; + /** Label is optional metadata to be stored with a constract instance. */ + label?: string; + /** Msg json encoded message to be passed to the contract on instantiation */ + msg?: any; + /** Funds coins that are transferred to the contract on instantiation */ + funds: CoinAmino[]; + /** Source is the URL where the code is hosted */ + source?: string; + /** + * Builder is the docker image used to build the code deterministically, used + * for smart contract verification + */ + builder?: string; + /** + * CodeHash is the SHA256 sum of the code outputted by builder, used for smart + * contract verification + */ + code_hash?: string; +} +export interface StoreAndInstantiateContractProposalAminoMsg { + type: "wasm/StoreAndInstantiateContractProposal"; + value: StoreAndInstantiateContractProposalAmino; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit StoreAndInstantiateContractProposal. To store and instantiate + * the contract, a simple MsgStoreAndInstantiateContract can be invoked from + * the x/gov module via a v1 governance proposal. + */ +/** @deprecated */ +export interface StoreAndInstantiateContractProposalSDKType { + title: string; + description: string; + run_as: string; + wasm_byte_code: Uint8Array; + instantiate_permission?: AccessConfigSDKType; + unpin_code: boolean; + admin: string; + label: string; + msg: Uint8Array; + funds: CoinSDKType[]; + source: string; + builder: string; + code_hash: Uint8Array; +} +function createBaseStoreCodeProposal(): StoreCodeProposal { + return { + title: "", + description: "", + runAs: "", + wasmByteCode: new Uint8Array(), + instantiatePermission: undefined, + unpinCode: false, + source: "", + builder: "", + codeHash: new Uint8Array() + }; +} +export const StoreCodeProposal = { + typeUrl: "/cosmwasm.wasm.v1.StoreCodeProposal", + encode(message: StoreCodeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.runAs !== "") { + writer.uint32(26).string(message.runAs); + } + if (message.wasmByteCode.length !== 0) { + writer.uint32(34).bytes(message.wasmByteCode); + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(58).fork()).ldelim(); + } + if (message.unpinCode === true) { + writer.uint32(64).bool(message.unpinCode); + } + if (message.source !== "") { + writer.uint32(74).string(message.source); + } + if (message.builder !== "") { + writer.uint32(82).string(message.builder); + } + if (message.codeHash.length !== 0) { + writer.uint32(90).bytes(message.codeHash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StoreCodeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStoreCodeProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.runAs = reader.string(); + break; + case 4: + message.wasmByteCode = reader.bytes(); + break; + case 7: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + case 8: + message.unpinCode = reader.bool(); + break; + case 9: + message.source = reader.string(); + break; + case 10: + message.builder = reader.string(); + break; + case 11: + message.codeHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StoreCodeProposal { + const message = createBaseStoreCodeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.runAs = object.runAs ?? ""; + message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); + message.instantiatePermission = object.instantiatePermission !== undefined && object.instantiatePermission !== null ? AccessConfig.fromPartial(object.instantiatePermission) : undefined; + message.unpinCode = object.unpinCode ?? false; + message.source = object.source ?? ""; + message.builder = object.builder ?? ""; + message.codeHash = object.codeHash ?? new Uint8Array(); + return message; + }, + fromAmino(object: StoreCodeProposalAmino): StoreCodeProposal { + const message = createBaseStoreCodeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.run_as !== undefined && object.run_as !== null) { + message.runAs = object.run_as; + } + if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { + message.wasmByteCode = fromBase64(object.wasm_byte_code); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); + } + if (object.unpin_code !== undefined && object.unpin_code !== null) { + message.unpinCode = object.unpin_code; + } + if (object.source !== undefined && object.source !== null) { + message.source = object.source; + } + if (object.builder !== undefined && object.builder !== null) { + message.builder = object.builder; + } + if (object.code_hash !== undefined && object.code_hash !== null) { + message.codeHash = bytesFromBase64(object.code_hash); + } + return message; + }, + toAmino(message: StoreCodeProposal): StoreCodeProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.run_as = message.runAs === "" ? undefined : message.runAs; + obj.wasm_byte_code = message.wasmByteCode ? toBase64(message.wasmByteCode) : undefined; + obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : undefined; + obj.unpin_code = message.unpinCode === false ? undefined : message.unpinCode; + obj.source = message.source === "" ? undefined : message.source; + obj.builder = message.builder === "" ? undefined : message.builder; + obj.code_hash = message.codeHash ? base64FromBytes(message.codeHash) : undefined; + return obj; + }, + fromAminoMsg(object: StoreCodeProposalAminoMsg): StoreCodeProposal { + return StoreCodeProposal.fromAmino(object.value); + }, + toAminoMsg(message: StoreCodeProposal): StoreCodeProposalAminoMsg { + return { + type: "wasm/StoreCodeProposal", + value: StoreCodeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: StoreCodeProposalProtoMsg): StoreCodeProposal { + return StoreCodeProposal.decode(message.value); + }, + toProto(message: StoreCodeProposal): Uint8Array { + return StoreCodeProposal.encode(message).finish(); + }, + toProtoMsg(message: StoreCodeProposal): StoreCodeProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.StoreCodeProposal", + value: StoreCodeProposal.encode(message).finish() + }; + } +}; +function createBaseInstantiateContractProposal(): InstantiateContractProposal { + return { + title: "", + description: "", + runAs: "", + admin: "", + codeId: BigInt(0), + label: "", + msg: new Uint8Array(), + funds: [] + }; +} +export const InstantiateContractProposal = { + typeUrl: "/cosmwasm.wasm.v1.InstantiateContractProposal", + encode(message: InstantiateContractProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.runAs !== "") { + writer.uint32(26).string(message.runAs); + } + if (message.admin !== "") { + writer.uint32(34).string(message.admin); + } + if (message.codeId !== BigInt(0)) { + writer.uint32(40).uint64(message.codeId); + } + if (message.label !== "") { + writer.uint32(50).string(message.label); + } + if (message.msg.length !== 0) { + writer.uint32(58).bytes(message.msg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(66).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): InstantiateContractProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInstantiateContractProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.runAs = reader.string(); + break; + case 4: + message.admin = reader.string(); + break; + case 5: + message.codeId = reader.uint64(); + break; + case 6: + message.label = reader.string(); + break; + case 7: + message.msg = reader.bytes(); + break; + case 8: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): InstantiateContractProposal { + const message = createBaseInstantiateContractProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.runAs = object.runAs ?? ""; + message.admin = object.admin ?? ""; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.label = object.label ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: InstantiateContractProposalAmino): InstantiateContractProposal { + const message = createBaseInstantiateContractProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.run_as !== undefined && object.run_as !== null) { + message.runAs = object.run_as; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: InstantiateContractProposal): InstantiateContractProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.run_as = message.runAs === "" ? undefined : message.runAs; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + obj.label = message.label === "" ? undefined : message.label; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.funds = message.funds; + } + return obj; + }, + fromAminoMsg(object: InstantiateContractProposalAminoMsg): InstantiateContractProposal { + return InstantiateContractProposal.fromAmino(object.value); + }, + toAminoMsg(message: InstantiateContractProposal): InstantiateContractProposalAminoMsg { + return { + type: "wasm/InstantiateContractProposal", + value: InstantiateContractProposal.toAmino(message) + }; + }, + fromProtoMsg(message: InstantiateContractProposalProtoMsg): InstantiateContractProposal { + return InstantiateContractProposal.decode(message.value); + }, + toProto(message: InstantiateContractProposal): Uint8Array { + return InstantiateContractProposal.encode(message).finish(); + }, + toProtoMsg(message: InstantiateContractProposal): InstantiateContractProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.InstantiateContractProposal", + value: InstantiateContractProposal.encode(message).finish() + }; + } +}; +function createBaseInstantiateContract2Proposal(): InstantiateContract2Proposal { + return { + title: "", + description: "", + runAs: "", + admin: "", + codeId: BigInt(0), + label: "", + msg: new Uint8Array(), + funds: [], + salt: new Uint8Array(), + fixMsg: false + }; +} +export const InstantiateContract2Proposal = { + typeUrl: "/cosmwasm.wasm.v1.InstantiateContract2Proposal", + encode(message: InstantiateContract2Proposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.runAs !== "") { + writer.uint32(26).string(message.runAs); + } + if (message.admin !== "") { + writer.uint32(34).string(message.admin); + } + if (message.codeId !== BigInt(0)) { + writer.uint32(40).uint64(message.codeId); + } + if (message.label !== "") { + writer.uint32(50).string(message.label); + } + if (message.msg.length !== 0) { + writer.uint32(58).bytes(message.msg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(66).fork()).ldelim(); + } + if (message.salt.length !== 0) { + writer.uint32(74).bytes(message.salt); + } + if (message.fixMsg === true) { + writer.uint32(80).bool(message.fixMsg); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): InstantiateContract2Proposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInstantiateContract2Proposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.runAs = reader.string(); + break; + case 4: + message.admin = reader.string(); + break; + case 5: + message.codeId = reader.uint64(); + break; + case 6: + message.label = reader.string(); + break; + case 7: + message.msg = reader.bytes(); + break; + case 8: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + case 9: + message.salt = reader.bytes(); + break; + case 10: + message.fixMsg = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): InstantiateContract2Proposal { + const message = createBaseInstantiateContract2Proposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.runAs = object.runAs ?? ""; + message.admin = object.admin ?? ""; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.label = object.label ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; + message.salt = object.salt ?? new Uint8Array(); + message.fixMsg = object.fixMsg ?? false; + return message; + }, + fromAmino(object: InstantiateContract2ProposalAmino): InstantiateContract2Proposal { + const message = createBaseInstantiateContract2Proposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.run_as !== undefined && object.run_as !== null) { + message.runAs = object.run_as; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + if (object.salt !== undefined && object.salt !== null) { + message.salt = bytesFromBase64(object.salt); + } + if (object.fix_msg !== undefined && object.fix_msg !== null) { + message.fixMsg = object.fix_msg; + } + return message; + }, + toAmino(message: InstantiateContract2Proposal): InstantiateContract2ProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.run_as = message.runAs === "" ? undefined : message.runAs; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + obj.label = message.label === "" ? undefined : message.label; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.funds = message.funds; + } + obj.salt = message.salt ? base64FromBytes(message.salt) : undefined; + obj.fix_msg = message.fixMsg === false ? undefined : message.fixMsg; + return obj; + }, + fromAminoMsg(object: InstantiateContract2ProposalAminoMsg): InstantiateContract2Proposal { + return InstantiateContract2Proposal.fromAmino(object.value); + }, + toAminoMsg(message: InstantiateContract2Proposal): InstantiateContract2ProposalAminoMsg { + return { + type: "wasm/InstantiateContract2Proposal", + value: InstantiateContract2Proposal.toAmino(message) + }; + }, + fromProtoMsg(message: InstantiateContract2ProposalProtoMsg): InstantiateContract2Proposal { + return InstantiateContract2Proposal.decode(message.value); + }, + toProto(message: InstantiateContract2Proposal): Uint8Array { + return InstantiateContract2Proposal.encode(message).finish(); + }, + toProtoMsg(message: InstantiateContract2Proposal): InstantiateContract2ProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.InstantiateContract2Proposal", + value: InstantiateContract2Proposal.encode(message).finish() + }; + } +}; +function createBaseMigrateContractProposal(): MigrateContractProposal { + return { + title: "", + description: "", + contract: "", + codeId: BigInt(0), + msg: new Uint8Array() + }; +} +export const MigrateContractProposal = { + typeUrl: "/cosmwasm.wasm.v1.MigrateContractProposal", + encode(message: MigrateContractProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.contract !== "") { + writer.uint32(34).string(message.contract); + } + if (message.codeId !== BigInt(0)) { + writer.uint32(40).uint64(message.codeId); + } + if (message.msg.length !== 0) { + writer.uint32(50).bytes(message.msg); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MigrateContractProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMigrateContractProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 4: + message.contract = reader.string(); + break; + case 5: + message.codeId = reader.uint64(); + break; + case 6: + message.msg = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MigrateContractProposal { + const message = createBaseMigrateContractProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.contract = object.contract ?? ""; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.msg = object.msg ?? new Uint8Array(); + return message; + }, + fromAmino(object: MigrateContractProposalAmino): MigrateContractProposal { + const message = createBaseMigrateContractProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + return message; + }, + toAmino(message: MigrateContractProposal): MigrateContractProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.contract = message.contract === "" ? undefined : message.contract; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + return obj; + }, + fromAminoMsg(object: MigrateContractProposalAminoMsg): MigrateContractProposal { + return MigrateContractProposal.fromAmino(object.value); + }, + toAminoMsg(message: MigrateContractProposal): MigrateContractProposalAminoMsg { + return { + type: "wasm/MigrateContractProposal", + value: MigrateContractProposal.toAmino(message) + }; + }, + fromProtoMsg(message: MigrateContractProposalProtoMsg): MigrateContractProposal { + return MigrateContractProposal.decode(message.value); + }, + toProto(message: MigrateContractProposal): Uint8Array { + return MigrateContractProposal.encode(message).finish(); + }, + toProtoMsg(message: MigrateContractProposal): MigrateContractProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MigrateContractProposal", + value: MigrateContractProposal.encode(message).finish() + }; + } +}; +function createBaseSudoContractProposal(): SudoContractProposal { + return { + title: "", + description: "", + contract: "", + msg: new Uint8Array() + }; +} +export const SudoContractProposal = { + typeUrl: "/cosmwasm.wasm.v1.SudoContractProposal", + encode(message: SudoContractProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.contract !== "") { + writer.uint32(26).string(message.contract); + } + if (message.msg.length !== 0) { + writer.uint32(34).bytes(message.msg); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SudoContractProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSudoContractProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.contract = reader.string(); + break; + case 4: + message.msg = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SudoContractProposal { + const message = createBaseSudoContractProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.contract = object.contract ?? ""; + message.msg = object.msg ?? new Uint8Array(); + return message; + }, + fromAmino(object: SudoContractProposalAmino): SudoContractProposal { + const message = createBaseSudoContractProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + return message; + }, + toAmino(message: SudoContractProposal): SudoContractProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.contract = message.contract === "" ? undefined : message.contract; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + return obj; + }, + fromAminoMsg(object: SudoContractProposalAminoMsg): SudoContractProposal { + return SudoContractProposal.fromAmino(object.value); + }, + toAminoMsg(message: SudoContractProposal): SudoContractProposalAminoMsg { + return { + type: "wasm/SudoContractProposal", + value: SudoContractProposal.toAmino(message) + }; + }, + fromProtoMsg(message: SudoContractProposalProtoMsg): SudoContractProposal { + return SudoContractProposal.decode(message.value); + }, + toProto(message: SudoContractProposal): Uint8Array { + return SudoContractProposal.encode(message).finish(); + }, + toProtoMsg(message: SudoContractProposal): SudoContractProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.SudoContractProposal", + value: SudoContractProposal.encode(message).finish() + }; + } +}; +function createBaseExecuteContractProposal(): ExecuteContractProposal { + return { + title: "", + description: "", + runAs: "", + contract: "", + msg: new Uint8Array(), + funds: [] + }; +} +export const ExecuteContractProposal = { + typeUrl: "/cosmwasm.wasm.v1.ExecuteContractProposal", + encode(message: ExecuteContractProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.runAs !== "") { + writer.uint32(26).string(message.runAs); + } + if (message.contract !== "") { + writer.uint32(34).string(message.contract); + } + if (message.msg.length !== 0) { + writer.uint32(42).bytes(message.msg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ExecuteContractProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExecuteContractProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.runAs = reader.string(); + break; + case 4: + message.contract = reader.string(); + break; + case 5: + message.msg = reader.bytes(); + break; + case 6: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ExecuteContractProposal { + const message = createBaseExecuteContractProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.runAs = object.runAs ?? ""; + message.contract = object.contract ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ExecuteContractProposalAmino): ExecuteContractProposal { + const message = createBaseExecuteContractProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.run_as !== undefined && object.run_as !== null) { + message.runAs = object.run_as; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: ExecuteContractProposal): ExecuteContractProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.run_as = message.runAs === "" ? undefined : message.runAs; + obj.contract = message.contract === "" ? undefined : message.contract; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.funds = message.funds; + } + return obj; + }, + fromAminoMsg(object: ExecuteContractProposalAminoMsg): ExecuteContractProposal { + return ExecuteContractProposal.fromAmino(object.value); + }, + toAminoMsg(message: ExecuteContractProposal): ExecuteContractProposalAminoMsg { + return { + type: "wasm/ExecuteContractProposal", + value: ExecuteContractProposal.toAmino(message) + }; + }, + fromProtoMsg(message: ExecuteContractProposalProtoMsg): ExecuteContractProposal { + return ExecuteContractProposal.decode(message.value); + }, + toProto(message: ExecuteContractProposal): Uint8Array { + return ExecuteContractProposal.encode(message).finish(); + }, + toProtoMsg(message: ExecuteContractProposal): ExecuteContractProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.ExecuteContractProposal", + value: ExecuteContractProposal.encode(message).finish() + }; + } +}; +function createBaseUpdateAdminProposal(): UpdateAdminProposal { + return { + title: "", + description: "", + newAdmin: "", + contract: "" + }; +} +export const UpdateAdminProposal = { + typeUrl: "/cosmwasm.wasm.v1.UpdateAdminProposal", + encode(message: UpdateAdminProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.newAdmin !== "") { + writer.uint32(26).string(message.newAdmin); + } + if (message.contract !== "") { + writer.uint32(34).string(message.contract); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UpdateAdminProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateAdminProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.newAdmin = reader.string(); + break; + case 4: + message.contract = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UpdateAdminProposal { + const message = createBaseUpdateAdminProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.newAdmin = object.newAdmin ?? ""; + message.contract = object.contract ?? ""; + return message; + }, + fromAmino(object: UpdateAdminProposalAmino): UpdateAdminProposal { + const message = createBaseUpdateAdminProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.new_admin !== undefined && object.new_admin !== null) { + message.newAdmin = object.new_admin; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + return message; + }, + toAmino(message: UpdateAdminProposal): UpdateAdminProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.new_admin = message.newAdmin === "" ? undefined : message.newAdmin; + obj.contract = message.contract === "" ? undefined : message.contract; + return obj; + }, + fromAminoMsg(object: UpdateAdminProposalAminoMsg): UpdateAdminProposal { + return UpdateAdminProposal.fromAmino(object.value); + }, + toAminoMsg(message: UpdateAdminProposal): UpdateAdminProposalAminoMsg { + return { + type: "wasm/UpdateAdminProposal", + value: UpdateAdminProposal.toAmino(message) + }; + }, + fromProtoMsg(message: UpdateAdminProposalProtoMsg): UpdateAdminProposal { + return UpdateAdminProposal.decode(message.value); + }, + toProto(message: UpdateAdminProposal): Uint8Array { + return UpdateAdminProposal.encode(message).finish(); + }, + toProtoMsg(message: UpdateAdminProposal): UpdateAdminProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.UpdateAdminProposal", + value: UpdateAdminProposal.encode(message).finish() + }; + } +}; +function createBaseClearAdminProposal(): ClearAdminProposal { + return { + title: "", + description: "", + contract: "" + }; +} +export const ClearAdminProposal = { + typeUrl: "/cosmwasm.wasm.v1.ClearAdminProposal", + encode(message: ClearAdminProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.contract !== "") { + writer.uint32(26).string(message.contract); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ClearAdminProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClearAdminProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.contract = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ClearAdminProposal { + const message = createBaseClearAdminProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.contract = object.contract ?? ""; + return message; + }, + fromAmino(object: ClearAdminProposalAmino): ClearAdminProposal { + const message = createBaseClearAdminProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + return message; + }, + toAmino(message: ClearAdminProposal): ClearAdminProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.contract = message.contract === "" ? undefined : message.contract; + return obj; + }, + fromAminoMsg(object: ClearAdminProposalAminoMsg): ClearAdminProposal { + return ClearAdminProposal.fromAmino(object.value); + }, + toAminoMsg(message: ClearAdminProposal): ClearAdminProposalAminoMsg { + return { + type: "wasm/ClearAdminProposal", + value: ClearAdminProposal.toAmino(message) + }; + }, + fromProtoMsg(message: ClearAdminProposalProtoMsg): ClearAdminProposal { + return ClearAdminProposal.decode(message.value); + }, + toProto(message: ClearAdminProposal): Uint8Array { + return ClearAdminProposal.encode(message).finish(); + }, + toProtoMsg(message: ClearAdminProposal): ClearAdminProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.ClearAdminProposal", + value: ClearAdminProposal.encode(message).finish() + }; + } +}; +function createBasePinCodesProposal(): PinCodesProposal { + return { + title: "", + description: "", + codeIds: [] + }; +} +export const PinCodesProposal = { + typeUrl: "/cosmwasm.wasm.v1.PinCodesProposal", + encode(message: PinCodesProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.codeIds) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PinCodesProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePinCodesProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.codeIds.push(reader.uint64()); + } + } else { + message.codeIds.push(reader.uint64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PinCodesProposal { + const message = createBasePinCodesProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.codeIds = object.codeIds?.map(e => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: PinCodesProposalAmino): PinCodesProposal { + const message = createBasePinCodesProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.codeIds = object.code_ids?.map(e => BigInt(e)) || []; + return message; + }, + toAmino(message: PinCodesProposal): PinCodesProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.codeIds) { + obj.code_ids = message.codeIds.map(e => e.toString()); + } else { + obj.code_ids = message.codeIds; + } + return obj; + }, + fromAminoMsg(object: PinCodesProposalAminoMsg): PinCodesProposal { + return PinCodesProposal.fromAmino(object.value); + }, + toAminoMsg(message: PinCodesProposal): PinCodesProposalAminoMsg { + return { + type: "wasm/PinCodesProposal", + value: PinCodesProposal.toAmino(message) + }; + }, + fromProtoMsg(message: PinCodesProposalProtoMsg): PinCodesProposal { + return PinCodesProposal.decode(message.value); + }, + toProto(message: PinCodesProposal): Uint8Array { + return PinCodesProposal.encode(message).finish(); + }, + toProtoMsg(message: PinCodesProposal): PinCodesProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.PinCodesProposal", + value: PinCodesProposal.encode(message).finish() + }; + } +}; +function createBaseUnpinCodesProposal(): UnpinCodesProposal { + return { + title: "", + description: "", + codeIds: [] + }; +} +export const UnpinCodesProposal = { + typeUrl: "/cosmwasm.wasm.v1.UnpinCodesProposal", + encode(message: UnpinCodesProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.codeIds) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UnpinCodesProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUnpinCodesProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.codeIds.push(reader.uint64()); + } + } else { + message.codeIds.push(reader.uint64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UnpinCodesProposal { + const message = createBaseUnpinCodesProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.codeIds = object.codeIds?.map(e => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: UnpinCodesProposalAmino): UnpinCodesProposal { + const message = createBaseUnpinCodesProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.codeIds = object.code_ids?.map(e => BigInt(e)) || []; + return message; + }, + toAmino(message: UnpinCodesProposal): UnpinCodesProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.codeIds) { + obj.code_ids = message.codeIds.map(e => e.toString()); + } else { + obj.code_ids = message.codeIds; + } + return obj; + }, + fromAminoMsg(object: UnpinCodesProposalAminoMsg): UnpinCodesProposal { + return UnpinCodesProposal.fromAmino(object.value); + }, + toAminoMsg(message: UnpinCodesProposal): UnpinCodesProposalAminoMsg { + return { + type: "wasm/UnpinCodesProposal", + value: UnpinCodesProposal.toAmino(message) + }; + }, + fromProtoMsg(message: UnpinCodesProposalProtoMsg): UnpinCodesProposal { + return UnpinCodesProposal.decode(message.value); + }, + toProto(message: UnpinCodesProposal): Uint8Array { + return UnpinCodesProposal.encode(message).finish(); + }, + toProtoMsg(message: UnpinCodesProposal): UnpinCodesProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.UnpinCodesProposal", + value: UnpinCodesProposal.encode(message).finish() + }; + } +}; +function createBaseSetGasLessContractsProposal(): SetGasLessContractsProposal { + return { + title: "", + description: "", + contractAddresses: [] + }; +} +export const SetGasLessContractsProposal = { + typeUrl: "/cosmwasm.wasm.v1.SetGasLessContractsProposal", + encode(message: SetGasLessContractsProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + for (const v of message.contractAddresses) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SetGasLessContractsProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetGasLessContractsProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.contractAddresses.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SetGasLessContractsProposal { + const message = createBaseSetGasLessContractsProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.contractAddresses = object.contractAddresses?.map(e => e) || []; + return message; + }, + fromAmino(object: SetGasLessContractsProposalAmino): SetGasLessContractsProposal { + const message = createBaseSetGasLessContractsProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.contractAddresses = object.contract_addresses?.map(e => e) || []; + return message; + }, + toAmino(message: SetGasLessContractsProposal): SetGasLessContractsProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.contractAddresses) { + obj.contract_addresses = message.contractAddresses.map(e => e); + } else { + obj.contract_addresses = message.contractAddresses; + } + return obj; + }, + fromAminoMsg(object: SetGasLessContractsProposalAminoMsg): SetGasLessContractsProposal { + return SetGasLessContractsProposal.fromAmino(object.value); + }, + toAminoMsg(message: SetGasLessContractsProposal): SetGasLessContractsProposalAminoMsg { + return { + type: "wasm/SetGasLessContractsProposal", + value: SetGasLessContractsProposal.toAmino(message) + }; + }, + fromProtoMsg(message: SetGasLessContractsProposalProtoMsg): SetGasLessContractsProposal { + return SetGasLessContractsProposal.decode(message.value); + }, + toProto(message: SetGasLessContractsProposal): Uint8Array { + return SetGasLessContractsProposal.encode(message).finish(); + }, + toProtoMsg(message: SetGasLessContractsProposal): SetGasLessContractsProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.SetGasLessContractsProposal", + value: SetGasLessContractsProposal.encode(message).finish() + }; + } +}; +function createBaseUnsetGasLessContractsProposal(): UnsetGasLessContractsProposal { + return { + title: "", + description: "", + contractAddresses: [] + }; +} +export const UnsetGasLessContractsProposal = { + typeUrl: "/cosmwasm.wasm.v1.UnsetGasLessContractsProposal", + encode(message: UnsetGasLessContractsProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + for (const v of message.contractAddresses) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UnsetGasLessContractsProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUnsetGasLessContractsProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.contractAddresses.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UnsetGasLessContractsProposal { + const message = createBaseUnsetGasLessContractsProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.contractAddresses = object.contractAddresses?.map(e => e) || []; + return message; + }, + fromAmino(object: UnsetGasLessContractsProposalAmino): UnsetGasLessContractsProposal { + const message = createBaseUnsetGasLessContractsProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.contractAddresses = object.contract_addresses?.map(e => e) || []; + return message; + }, + toAmino(message: UnsetGasLessContractsProposal): UnsetGasLessContractsProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.contractAddresses) { + obj.contract_addresses = message.contractAddresses.map(e => e); + } else { + obj.contract_addresses = message.contractAddresses; + } + return obj; + }, + fromAminoMsg(object: UnsetGasLessContractsProposalAminoMsg): UnsetGasLessContractsProposal { + return UnsetGasLessContractsProposal.fromAmino(object.value); + }, + toAminoMsg(message: UnsetGasLessContractsProposal): UnsetGasLessContractsProposalAminoMsg { + return { + type: "wasm/UnsetGasLessContractsProposal", + value: UnsetGasLessContractsProposal.toAmino(message) + }; + }, + fromProtoMsg(message: UnsetGasLessContractsProposalProtoMsg): UnsetGasLessContractsProposal { + return UnsetGasLessContractsProposal.decode(message.value); + }, + toProto(message: UnsetGasLessContractsProposal): Uint8Array { + return UnsetGasLessContractsProposal.encode(message).finish(); + }, + toProtoMsg(message: UnsetGasLessContractsProposal): UnsetGasLessContractsProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.UnsetGasLessContractsProposal", + value: UnsetGasLessContractsProposal.encode(message).finish() + }; + } +}; +function createBaseAccessConfigUpdate(): AccessConfigUpdate { + return { + codeId: BigInt(0), + instantiatePermission: AccessConfig.fromPartial({}) + }; +} +export const AccessConfigUpdate = { + typeUrl: "/cosmwasm.wasm.v1.AccessConfigUpdate", + encode(message: AccessConfigUpdate, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AccessConfigUpdate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccessConfigUpdate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64(); + break; + case 2: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AccessConfigUpdate { + const message = createBaseAccessConfigUpdate(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.instantiatePermission = object.instantiatePermission !== undefined && object.instantiatePermission !== null ? AccessConfig.fromPartial(object.instantiatePermission) : undefined; + return message; + }, + fromAmino(object: AccessConfigUpdateAmino): AccessConfigUpdate { + const message = createBaseAccessConfigUpdate(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); + } + return message; + }, + toAmino(message: AccessConfigUpdate): AccessConfigUpdateAmino { + const obj: any = {}; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : AccessConfig.toAmino(AccessConfig.fromPartial({})); + return obj; + }, + fromAminoMsg(object: AccessConfigUpdateAminoMsg): AccessConfigUpdate { + return AccessConfigUpdate.fromAmino(object.value); + }, + toAminoMsg(message: AccessConfigUpdate): AccessConfigUpdateAminoMsg { + return { + type: "wasm/AccessConfigUpdate", + value: AccessConfigUpdate.toAmino(message) + }; + }, + fromProtoMsg(message: AccessConfigUpdateProtoMsg): AccessConfigUpdate { + return AccessConfigUpdate.decode(message.value); + }, + toProto(message: AccessConfigUpdate): Uint8Array { + return AccessConfigUpdate.encode(message).finish(); + }, + toProtoMsg(message: AccessConfigUpdate): AccessConfigUpdateProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.AccessConfigUpdate", + value: AccessConfigUpdate.encode(message).finish() + }; + } +}; +function createBaseUpdateInstantiateConfigProposal(): UpdateInstantiateConfigProposal { + return { + title: "", + description: "", + accessConfigUpdates: [] + }; +} +export const UpdateInstantiateConfigProposal = { + typeUrl: "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal", + encode(message: UpdateInstantiateConfigProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + for (const v of message.accessConfigUpdates) { + AccessConfigUpdate.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UpdateInstantiateConfigProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateInstantiateConfigProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.accessConfigUpdates.push(AccessConfigUpdate.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UpdateInstantiateConfigProposal { + const message = createBaseUpdateInstantiateConfigProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.accessConfigUpdates = object.accessConfigUpdates?.map(e => AccessConfigUpdate.fromPartial(e)) || []; + return message; + }, + fromAmino(object: UpdateInstantiateConfigProposalAmino): UpdateInstantiateConfigProposal { + const message = createBaseUpdateInstantiateConfigProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.accessConfigUpdates = object.access_config_updates?.map(e => AccessConfigUpdate.fromAmino(e)) || []; + return message; + }, + toAmino(message: UpdateInstantiateConfigProposal): UpdateInstantiateConfigProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.accessConfigUpdates) { + obj.access_config_updates = message.accessConfigUpdates.map(e => e ? AccessConfigUpdate.toAmino(e) : undefined); + } else { + obj.access_config_updates = message.accessConfigUpdates; + } + return obj; + }, + fromAminoMsg(object: UpdateInstantiateConfigProposalAminoMsg): UpdateInstantiateConfigProposal { + return UpdateInstantiateConfigProposal.fromAmino(object.value); + }, + toAminoMsg(message: UpdateInstantiateConfigProposal): UpdateInstantiateConfigProposalAminoMsg { + return { + type: "wasm/UpdateInstantiateConfigProposal", + value: UpdateInstantiateConfigProposal.toAmino(message) + }; + }, + fromProtoMsg(message: UpdateInstantiateConfigProposalProtoMsg): UpdateInstantiateConfigProposal { + return UpdateInstantiateConfigProposal.decode(message.value); + }, + toProto(message: UpdateInstantiateConfigProposal): Uint8Array { + return UpdateInstantiateConfigProposal.encode(message).finish(); + }, + toProtoMsg(message: UpdateInstantiateConfigProposal): UpdateInstantiateConfigProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal", + value: UpdateInstantiateConfigProposal.encode(message).finish() + }; + } +}; +function createBaseStoreAndInstantiateContractProposal(): StoreAndInstantiateContractProposal { + return { + title: "", + description: "", + runAs: "", + wasmByteCode: new Uint8Array(), + instantiatePermission: undefined, + unpinCode: false, + admin: "", + label: "", + msg: new Uint8Array(), + funds: [], + source: "", + builder: "", + codeHash: new Uint8Array() + }; +} +export const StoreAndInstantiateContractProposal = { + typeUrl: "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal", + encode(message: StoreAndInstantiateContractProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.runAs !== "") { + writer.uint32(26).string(message.runAs); + } + if (message.wasmByteCode.length !== 0) { + writer.uint32(34).bytes(message.wasmByteCode); + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(42).fork()).ldelim(); + } + if (message.unpinCode === true) { + writer.uint32(48).bool(message.unpinCode); + } + if (message.admin !== "") { + writer.uint32(58).string(message.admin); + } + if (message.label !== "") { + writer.uint32(66).string(message.label); + } + if (message.msg.length !== 0) { + writer.uint32(74).bytes(message.msg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(82).fork()).ldelim(); + } + if (message.source !== "") { + writer.uint32(90).string(message.source); + } + if (message.builder !== "") { + writer.uint32(98).string(message.builder); + } + if (message.codeHash.length !== 0) { + writer.uint32(106).bytes(message.codeHash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StoreAndInstantiateContractProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStoreAndInstantiateContractProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.runAs = reader.string(); + break; + case 4: + message.wasmByteCode = reader.bytes(); + break; + case 5: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + case 6: + message.unpinCode = reader.bool(); + break; + case 7: + message.admin = reader.string(); + break; + case 8: + message.label = reader.string(); + break; + case 9: + message.msg = reader.bytes(); + break; + case 10: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + case 11: + message.source = reader.string(); + break; + case 12: + message.builder = reader.string(); + break; + case 13: + message.codeHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StoreAndInstantiateContractProposal { + const message = createBaseStoreAndInstantiateContractProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.runAs = object.runAs ?? ""; + message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); + message.instantiatePermission = object.instantiatePermission !== undefined && object.instantiatePermission !== null ? AccessConfig.fromPartial(object.instantiatePermission) : undefined; + message.unpinCode = object.unpinCode ?? false; + message.admin = object.admin ?? ""; + message.label = object.label ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; + message.source = object.source ?? ""; + message.builder = object.builder ?? ""; + message.codeHash = object.codeHash ?? new Uint8Array(); + return message; + }, + fromAmino(object: StoreAndInstantiateContractProposalAmino): StoreAndInstantiateContractProposal { + const message = createBaseStoreAndInstantiateContractProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.run_as !== undefined && object.run_as !== null) { + message.runAs = object.run_as; + } + if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { + message.wasmByteCode = fromBase64(object.wasm_byte_code); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); + } + if (object.unpin_code !== undefined && object.unpin_code !== null) { + message.unpinCode = object.unpin_code; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + if (object.source !== undefined && object.source !== null) { + message.source = object.source; + } + if (object.builder !== undefined && object.builder !== null) { + message.builder = object.builder; + } + if (object.code_hash !== undefined && object.code_hash !== null) { + message.codeHash = bytesFromBase64(object.code_hash); + } + return message; + }, + toAmino(message: StoreAndInstantiateContractProposal): StoreAndInstantiateContractProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.run_as = message.runAs === "" ? undefined : message.runAs; + obj.wasm_byte_code = message.wasmByteCode ? toBase64(message.wasmByteCode) : undefined; + obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : undefined; + obj.unpin_code = message.unpinCode === false ? undefined : message.unpinCode; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.label = message.label === "" ? undefined : message.label; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.funds = message.funds; + } + obj.source = message.source === "" ? undefined : message.source; + obj.builder = message.builder === "" ? undefined : message.builder; + obj.code_hash = message.codeHash ? base64FromBytes(message.codeHash) : undefined; + return obj; + }, + fromAminoMsg(object: StoreAndInstantiateContractProposalAminoMsg): StoreAndInstantiateContractProposal { + return StoreAndInstantiateContractProposal.fromAmino(object.value); + }, + toAminoMsg(message: StoreAndInstantiateContractProposal): StoreAndInstantiateContractProposalAminoMsg { + return { + type: "wasm/StoreAndInstantiateContractProposal", + value: StoreAndInstantiateContractProposal.toAmino(message) + }; + }, + fromProtoMsg(message: StoreAndInstantiateContractProposalProtoMsg): StoreAndInstantiateContractProposal { + return StoreAndInstantiateContractProposal.decode(message.value); + }, + toProto(message: StoreAndInstantiateContractProposal): Uint8Array { + return StoreAndInstantiateContractProposal.encode(message).finish(); + }, + toProtoMsg(message: StoreAndInstantiateContractProposal): StoreAndInstantiateContractProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal", + value: StoreAndInstantiateContractProposal.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/cosmwasm/wasm/v1/query.lcd.ts b/src/codegen/cosmwasm/wasm/v1/query.lcd.ts index a449838..2911690 100644 --- a/src/codegen/cosmwasm/wasm/v1/query.lcd.ts +++ b/src/codegen/cosmwasm/wasm/v1/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../../helpers"; import { LCDClient } from "@cosmology/lcd"; -import { QueryContractInfoRequest, QueryContractInfoResponseSDKType, QueryContractHistoryRequest, QueryContractHistoryResponseSDKType, QueryContractsByCodeRequest, QueryContractsByCodeResponseSDKType, QueryAllContractStateRequest, QueryAllContractStateResponseSDKType, QueryRawContractStateRequest, QueryRawContractStateResponseSDKType, QuerySmartContractStateRequest, QuerySmartContractStateResponseSDKType, QueryCodeRequest, QueryCodeResponseSDKType, QueryCodesRequest, QueryCodesResponseSDKType, QueryPinnedCodesRequest, QueryPinnedCodesResponseSDKType, QueryGaslessContractsRequest, QueryGaslessContractsResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType, QueryContractsByCreatorRequest, QueryContractsByCreatorResponseSDKType } from "./query"; +import { QueryContractInfoRequest, QueryContractInfoResponseSDKType, QueryContractHistoryRequest, QueryContractHistoryResponseSDKType, QueryContractsByCodeRequest, QueryContractsByCodeResponseSDKType, QueryAllContractStateRequest, QueryAllContractStateResponseSDKType, QueryRawContractStateRequest, QueryRawContractStateResponseSDKType, QuerySmartContractStateRequest, QuerySmartContractStateResponseSDKType, QueryCodeRequest, QueryCodeResponseSDKType, QueryCodesRequest, QueryCodesResponseSDKType, QueryPinnedCodesRequest, QueryPinnedCodesResponseSDKType, QueryGaslessContractsRequest, QueryGaslessContractsResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType, QueryContractsByCreatorRequest, QueryContractsByCreatorResponseSDKType, QueryBuildAddressRequest, QueryBuildAddressResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -21,6 +21,7 @@ export class LCDQueryClient { this.gaslessContracts = this.gaslessContracts.bind(this); this.params = this.params.bind(this); this.contractsByCreator = this.contractsByCreator.bind(this); + this.buildAddress = this.buildAddress.bind(this); } /* ContractInfo gets the contract meta data */ async contractInfo(params: QueryContractInfoRequest): Promise { @@ -130,4 +131,24 @@ export class LCDQueryClient { const endpoint = `cosmwasm/wasm/v1/contracts/creator/${params.creatorAddress}`; return await this.req.get(endpoint, options); } + /* BuildAddress builds a contract address */ + async buildAddress(params: QueryBuildAddressRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.codeHash !== "undefined") { + options.params.code_hash = params.codeHash; + } + if (typeof params?.creatorAddress !== "undefined") { + options.params.creator_address = params.creatorAddress; + } + if (typeof params?.salt !== "undefined") { + options.params.salt = params.salt; + } + if (typeof params?.initArgs !== "undefined") { + options.params.init_args = params.initArgs; + } + const endpoint = `cosmwasm/wasm/v1/contract/build_address`; + return await this.req.get(endpoint, options); + } } \ No newline at end of file diff --git a/src/codegen/cosmwasm/wasm/v1/query.rpc.Query.ts b/src/codegen/cosmwasm/wasm/v1/query.rpc.Query.ts index 8d9d551..8e5c670 100644 --- a/src/codegen/cosmwasm/wasm/v1/query.rpc.Query.ts +++ b/src/codegen/cosmwasm/wasm/v1/query.rpc.Query.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryContractInfoRequest, QueryContractInfoResponse, QueryContractHistoryRequest, QueryContractHistoryResponse, QueryContractsByCodeRequest, QueryContractsByCodeResponse, QueryAllContractStateRequest, QueryAllContractStateResponse, QueryRawContractStateRequest, QueryRawContractStateResponse, QuerySmartContractStateRequest, QuerySmartContractStateResponse, QueryCodeRequest, QueryCodeResponse, QueryCodesRequest, QueryCodesResponse, QueryPinnedCodesRequest, QueryPinnedCodesResponse, QueryGaslessContractsRequest, QueryGaslessContractsResponse, QueryParamsRequest, QueryParamsResponse, QueryContractsByCreatorRequest, QueryContractsByCreatorResponse } from "./query"; +import { QueryContractInfoRequest, QueryContractInfoResponse, QueryContractHistoryRequest, QueryContractHistoryResponse, QueryContractsByCodeRequest, QueryContractsByCodeResponse, QueryAllContractStateRequest, QueryAllContractStateResponse, QueryRawContractStateRequest, QueryRawContractStateResponse, QuerySmartContractStateRequest, QuerySmartContractStateResponse, QueryCodeRequest, QueryCodeResponse, QueryCodesRequest, QueryCodesResponse, QueryPinnedCodesRequest, QueryPinnedCodesResponse, QueryGaslessContractsRequest, QueryGaslessContractsResponse, QueryParamsRequest, QueryParamsResponse, QueryContractsByCreatorRequest, QueryContractsByCreatorResponse, QueryBuildAddressRequest, QueryBuildAddressResponse } from "./query"; /** Query provides defines the gRPC querier service */ export interface Query { /** ContractInfo gets the contract meta data */ @@ -28,6 +28,8 @@ export interface Query { params(request?: QueryParamsRequest): Promise; /** ContractsByCreator gets the contracts by creator */ contractsByCreator(request: QueryContractsByCreatorRequest): Promise; + /** BuildAddress builds a contract address */ + buildAddress(request: QueryBuildAddressRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -45,6 +47,7 @@ export class QueryClientImpl implements Query { this.gaslessContracts = this.gaslessContracts.bind(this); this.params = this.params.bind(this); this.contractsByCreator = this.contractsByCreator.bind(this); + this.buildAddress = this.buildAddress.bind(this); } contractInfo(request: QueryContractInfoRequest): Promise { const data = QueryContractInfoRequest.encode(request).finish(); @@ -112,6 +115,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "ContractsByCreator", data); return promise.then(data => QueryContractsByCreatorResponse.decode(new BinaryReader(data))); } + buildAddress(request: QueryBuildAddressRequest): Promise { + const data = QueryBuildAddressRequest.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Query", "BuildAddress", data); + return promise.then(data => QueryBuildAddressResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -152,6 +160,9 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, contractsByCreator(request: QueryContractsByCreatorRequest): Promise { return queryService.contractsByCreator(request); + }, + buildAddress(request: QueryBuildAddressRequest): Promise { + return queryService.buildAddress(request); } }; }; \ No newline at end of file diff --git a/src/codegen/cosmwasm/wasm/v1/query.ts b/src/codegen/cosmwasm/wasm/v1/query.ts index 9a679ed..9a70e73 100644 --- a/src/codegen/cosmwasm/wasm/v1/query.ts +++ b/src/codegen/cosmwasm/wasm/v1/query.ts @@ -54,7 +54,7 @@ export interface QueryContractInfoResponseProtoMsg { export interface QueryContractInfoResponseAmino { /** address is the address of the contract */ address?: string; - contract_info?: ContractInfoAmino; + contract_info: ContractInfoAmino; } export interface QueryContractInfoResponseAminoMsg { type: "wasm/QueryContractInfoResponse"; @@ -122,7 +122,7 @@ export interface QueryContractHistoryResponseProtoMsg { * Query/ContractHistory RPC method */ export interface QueryContractHistoryResponseAmino { - entries?: ContractCodeHistoryEntryAmino[]; + entries: ContractCodeHistoryEntryAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -268,7 +268,7 @@ export interface QueryAllContractStateResponseProtoMsg { * Query/AllContractState RPC method */ export interface QueryAllContractStateResponseAmino { - models?: ModelAmino[]; + models: ModelAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -454,7 +454,7 @@ export interface CodeInfoResponseAmino { code_id: string; creator?: string; data_hash?: string; - instantiate_permission?: AccessConfigAmino; + instantiate_permission: AccessConfigAmino; } export interface CodeInfoResponseAminoMsg { type: "wasm/CodeInfoResponse"; @@ -524,7 +524,7 @@ export interface QueryCodesResponseProtoMsg { } /** QueryCodesResponse is the response type for the Query/Codes RPC method */ export interface QueryCodesResponseAmino { - code_infos?: CodeInfoResponseAmino[]; + code_infos: CodeInfoResponseAmino[]; /** pagination defines the pagination in the response. */ pagination?: PageResponseAmino; } @@ -603,8 +603,8 @@ export interface QueryPinnedCodesResponseSDKType { pagination?: PageResponseSDKType; } /** - * QueryGaslessContractsRequest is the request type for the Query/GaslessContracts - * RPC method + * QueryGaslessContractsRequest is the request type for the + * Query/GaslessContracts RPC method */ export interface QueryGaslessContractsRequest { /** pagination defines an optional pagination for the request. */ @@ -615,8 +615,8 @@ export interface QueryGaslessContractsRequestProtoMsg { value: Uint8Array; } /** - * QueryGaslessContractsRequest is the request type for the Query/GaslessContracts - * RPC method + * QueryGaslessContractsRequest is the request type for the + * Query/GaslessContracts RPC method */ export interface QueryGaslessContractsRequestAmino { /** pagination defines an optional pagination for the request. */ @@ -627,8 +627,8 @@ export interface QueryGaslessContractsRequestAminoMsg { value: QueryGaslessContractsRequestAmino; } /** - * QueryGaslessContractsRequest is the request type for the Query/GaslessContracts - * RPC method + * QueryGaslessContractsRequest is the request type for the + * Query/GaslessContracts RPC method */ export interface QueryGaslessContractsRequestSDKType { pagination?: PageRequestSDKType; @@ -693,7 +693,7 @@ export interface QueryParamsResponseProtoMsg { /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseAmino { /** params defines the parameters of the module. */ - params?: ParamsAmino; + params: ParamsAmino; } export interface QueryParamsResponseAminoMsg { type: "wasm/QueryParamsResponse"; @@ -775,6 +775,89 @@ export interface QueryContractsByCreatorResponseSDKType { contract_addresses: string[]; pagination?: PageResponseSDKType; } +/** + * QueryBuildAddressRequest is the request type for the Query/BuildAddress RPC + * method. + */ +export interface QueryBuildAddressRequest { + /** CodeHash is the hash of the code */ + codeHash: string; + /** CreatorAddress is the address of the contract instantiator */ + creatorAddress: string; + /** Salt is a hex encoded salt */ + salt: string; + /** + * InitArgs are optional json encoded init args to be used in contract address + * building if provided + */ + initArgs: Uint8Array; +} +export interface QueryBuildAddressRequestProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryBuildAddressRequest"; + value: Uint8Array; +} +/** + * QueryBuildAddressRequest is the request type for the Query/BuildAddress RPC + * method. + */ +export interface QueryBuildAddressRequestAmino { + /** CodeHash is the hash of the code */ + code_hash?: string; + /** CreatorAddress is the address of the contract instantiator */ + creator_address?: string; + /** Salt is a hex encoded salt */ + salt?: string; + /** + * InitArgs are optional json encoded init args to be used in contract address + * building if provided + */ + init_args?: string; +} +export interface QueryBuildAddressRequestAminoMsg { + type: "wasm/QueryBuildAddressRequest"; + value: QueryBuildAddressRequestAmino; +} +/** + * QueryBuildAddressRequest is the request type for the Query/BuildAddress RPC + * method. + */ +export interface QueryBuildAddressRequestSDKType { + code_hash: string; + creator_address: string; + salt: string; + init_args: Uint8Array; +} +/** + * QueryBuildAddressResponse is the response type for the Query/BuildAddress RPC + * method. + */ +export interface QueryBuildAddressResponse { + /** Address is the contract address */ + address: string; +} +export interface QueryBuildAddressResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.QueryBuildAddressResponse"; + value: Uint8Array; +} +/** + * QueryBuildAddressResponse is the response type for the Query/BuildAddress RPC + * method. + */ +export interface QueryBuildAddressResponseAmino { + /** Address is the contract address */ + address?: string; +} +export interface QueryBuildAddressResponseAminoMsg { + type: "wasm/QueryBuildAddressResponse"; + value: QueryBuildAddressResponseAmino; +} +/** + * QueryBuildAddressResponse is the response type for the Query/BuildAddress RPC + * method. + */ +export interface QueryBuildAddressResponseSDKType { + address: string; +} function createBaseQueryContractInfoRequest(): QueryContractInfoRequest { return { address: "" @@ -900,7 +983,7 @@ export const QueryContractInfoResponse = { toAmino(message: QueryContractInfoResponse): QueryContractInfoResponseAmino { const obj: any = {}; obj.address = message.address === "" ? undefined : message.address; - obj.contract_info = message.contractInfo ? ContractInfo.toAmino(message.contractInfo) : undefined; + obj.contract_info = message.contractInfo ? ContractInfo.toAmino(message.contractInfo) : ContractInfo.toAmino(ContractInfo.fromPartial({})); return obj; }, fromAminoMsg(object: QueryContractInfoResponseAminoMsg): QueryContractInfoResponse { @@ -1866,7 +1949,7 @@ export const CodeInfoResponse = { obj.code_id = message.codeId ? message.codeId.toString() : "0"; obj.creator = message.creator === "" ? undefined : message.creator; obj.data_hash = message.dataHash ? base64FromBytes(message.dataHash) : undefined; - obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : undefined; + obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : AccessConfig.toAmino(AccessConfig.fromPartial({})); return obj; }, fromAminoMsg(object: CodeInfoResponseAminoMsg): CodeInfoResponse { @@ -2537,7 +2620,7 @@ export const QueryParamsResponse = { }, toAmino(message: QueryParamsResponse): QueryParamsResponseAmino { const obj: any = {}; - obj.params = message.params ? Params.toAmino(message.params) : undefined; + obj.params = message.params ? Params.toAmino(message.params) : Params.toAmino(Params.fromPartial({})); return obj; }, fromAminoMsg(object: QueryParamsResponseAminoMsg): QueryParamsResponse { @@ -2725,4 +2808,178 @@ export const QueryContractsByCreatorResponse = { value: QueryContractsByCreatorResponse.encode(message).finish() }; } +}; +function createBaseQueryBuildAddressRequest(): QueryBuildAddressRequest { + return { + codeHash: "", + creatorAddress: "", + salt: "", + initArgs: new Uint8Array() + }; +} +export const QueryBuildAddressRequest = { + typeUrl: "/cosmwasm.wasm.v1.QueryBuildAddressRequest", + encode(message: QueryBuildAddressRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeHash !== "") { + writer.uint32(10).string(message.codeHash); + } + if (message.creatorAddress !== "") { + writer.uint32(18).string(message.creatorAddress); + } + if (message.salt !== "") { + writer.uint32(26).string(message.salt); + } + if (message.initArgs.length !== 0) { + writer.uint32(34).bytes(message.initArgs); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBuildAddressRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBuildAddressRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeHash = reader.string(); + break; + case 2: + message.creatorAddress = reader.string(); + break; + case 3: + message.salt = reader.string(); + break; + case 4: + message.initArgs = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryBuildAddressRequest { + const message = createBaseQueryBuildAddressRequest(); + message.codeHash = object.codeHash ?? ""; + message.creatorAddress = object.creatorAddress ?? ""; + message.salt = object.salt ?? ""; + message.initArgs = object.initArgs ?? new Uint8Array(); + return message; + }, + fromAmino(object: QueryBuildAddressRequestAmino): QueryBuildAddressRequest { + const message = createBaseQueryBuildAddressRequest(); + if (object.code_hash !== undefined && object.code_hash !== null) { + message.codeHash = object.code_hash; + } + if (object.creator_address !== undefined && object.creator_address !== null) { + message.creatorAddress = object.creator_address; + } + if (object.salt !== undefined && object.salt !== null) { + message.salt = object.salt; + } + if (object.init_args !== undefined && object.init_args !== null) { + message.initArgs = bytesFromBase64(object.init_args); + } + return message; + }, + toAmino(message: QueryBuildAddressRequest): QueryBuildAddressRequestAmino { + const obj: any = {}; + obj.code_hash = message.codeHash === "" ? undefined : message.codeHash; + obj.creator_address = message.creatorAddress === "" ? undefined : message.creatorAddress; + obj.salt = message.salt === "" ? undefined : message.salt; + obj.init_args = message.initArgs ? base64FromBytes(message.initArgs) : undefined; + return obj; + }, + fromAminoMsg(object: QueryBuildAddressRequestAminoMsg): QueryBuildAddressRequest { + return QueryBuildAddressRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryBuildAddressRequest): QueryBuildAddressRequestAminoMsg { + return { + type: "wasm/QueryBuildAddressRequest", + value: QueryBuildAddressRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryBuildAddressRequestProtoMsg): QueryBuildAddressRequest { + return QueryBuildAddressRequest.decode(message.value); + }, + toProto(message: QueryBuildAddressRequest): Uint8Array { + return QueryBuildAddressRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryBuildAddressRequest): QueryBuildAddressRequestProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryBuildAddressRequest", + value: QueryBuildAddressRequest.encode(message).finish() + }; + } +}; +function createBaseQueryBuildAddressResponse(): QueryBuildAddressResponse { + return { + address: "" + }; +} +export const QueryBuildAddressResponse = { + typeUrl: "/cosmwasm.wasm.v1.QueryBuildAddressResponse", + encode(message: QueryBuildAddressResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryBuildAddressResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryBuildAddressResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryBuildAddressResponse { + const message = createBaseQueryBuildAddressResponse(); + message.address = object.address ?? ""; + return message; + }, + fromAmino(object: QueryBuildAddressResponseAmino): QueryBuildAddressResponse { + const message = createBaseQueryBuildAddressResponse(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + return message; + }, + toAmino(message: QueryBuildAddressResponse): QueryBuildAddressResponseAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + return obj; + }, + fromAminoMsg(object: QueryBuildAddressResponseAminoMsg): QueryBuildAddressResponse { + return QueryBuildAddressResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryBuildAddressResponse): QueryBuildAddressResponseAminoMsg { + return { + type: "wasm/QueryBuildAddressResponse", + value: QueryBuildAddressResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryBuildAddressResponseProtoMsg): QueryBuildAddressResponse { + return QueryBuildAddressResponse.decode(message.value); + }, + toProto(message: QueryBuildAddressResponse): Uint8Array { + return QueryBuildAddressResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryBuildAddressResponse): QueryBuildAddressResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.QueryBuildAddressResponse", + value: QueryBuildAddressResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/src/codegen/cosmwasm/wasm/v1/tx.amino.ts b/src/codegen/cosmwasm/wasm/v1/tx.amino.ts index 535ca8a..ce1eb00 100644 --- a/src/codegen/cosmwasm/wasm/v1/tx.amino.ts +++ b/src/codegen/cosmwasm/wasm/v1/tx.amino.ts @@ -1,4 +1,4 @@ -import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin, MsgUpdateInstantiateConfig } from "./tx"; +import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin, MsgUpdateInstantiateConfig, MsgUpdateParams, MsgSudoContract, MsgPinCodes, MsgUnpinCodes, MsgStoreAndInstantiateContract, MsgRemoveCodeUploadParamsAddresses, MsgAddCodeUploadParamsAddresses, MsgStoreAndMigrateContract, MsgUpdateContractLabel, MsgSetGaslessContracts } from "./tx"; export const AminoConverter = { "/cosmwasm.wasm.v1.MsgStoreCode": { aminoType: "wasm/MsgStoreCode", @@ -39,5 +39,55 @@ export const AminoConverter = { aminoType: "wasm/MsgUpdateInstantiateConfig", toAmino: MsgUpdateInstantiateConfig.toAmino, fromAmino: MsgUpdateInstantiateConfig.fromAmino + }, + "/cosmwasm.wasm.v1.MsgUpdateParams": { + aminoType: "wasm/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + }, + "/cosmwasm.wasm.v1.MsgSudoContract": { + aminoType: "wasm/MsgSudoContract", + toAmino: MsgSudoContract.toAmino, + fromAmino: MsgSudoContract.fromAmino + }, + "/cosmwasm.wasm.v1.MsgPinCodes": { + aminoType: "wasm/MsgPinCodes", + toAmino: MsgPinCodes.toAmino, + fromAmino: MsgPinCodes.fromAmino + }, + "/cosmwasm.wasm.v1.MsgUnpinCodes": { + aminoType: "wasm/MsgUnpinCodes", + toAmino: MsgUnpinCodes.toAmino, + fromAmino: MsgUnpinCodes.fromAmino + }, + "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract": { + aminoType: "wasm/MsgStoreAndInstantiateContract", + toAmino: MsgStoreAndInstantiateContract.toAmino, + fromAmino: MsgStoreAndInstantiateContract.fromAmino + }, + "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses": { + aminoType: "wasm/MsgRemoveCodeUploadParamsAddresses", + toAmino: MsgRemoveCodeUploadParamsAddresses.toAmino, + fromAmino: MsgRemoveCodeUploadParamsAddresses.fromAmino + }, + "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses": { + aminoType: "wasm/MsgAddCodeUploadParamsAddresses", + toAmino: MsgAddCodeUploadParamsAddresses.toAmino, + fromAmino: MsgAddCodeUploadParamsAddresses.fromAmino + }, + "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract": { + aminoType: "wasm/MsgStoreAndMigrateContract", + toAmino: MsgStoreAndMigrateContract.toAmino, + fromAmino: MsgStoreAndMigrateContract.fromAmino + }, + "/cosmwasm.wasm.v1.MsgUpdateContractLabel": { + aminoType: "wasm/MsgUpdateContractLabel", + toAmino: MsgUpdateContractLabel.toAmino, + fromAmino: MsgUpdateContractLabel.fromAmino + }, + "/cosmwasm.wasm.v1.MsgSetGaslessContracts": { + aminoType: "wasm/MsgSetGaslessContracts", + toAmino: MsgSetGaslessContracts.toAmino, + fromAmino: MsgSetGaslessContracts.fromAmino } }; \ No newline at end of file diff --git a/src/codegen/cosmwasm/wasm/v1/tx.registry.ts b/src/codegen/cosmwasm/wasm/v1/tx.registry.ts index ae8fe7b..f0ecbf4 100644 --- a/src/codegen/cosmwasm/wasm/v1/tx.registry.ts +++ b/src/codegen/cosmwasm/wasm/v1/tx.registry.ts @@ -1,6 +1,6 @@ import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin, MsgUpdateInstantiateConfig } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmwasm.wasm.v1.MsgStoreCode", MsgStoreCode], ["/cosmwasm.wasm.v1.MsgInstantiateContract", MsgInstantiateContract], ["/cosmwasm.wasm.v1.MsgInstantiateContract2", MsgInstantiateContract2], ["/cosmwasm.wasm.v1.MsgExecuteContract", MsgExecuteContract], ["/cosmwasm.wasm.v1.MsgMigrateContract", MsgMigrateContract], ["/cosmwasm.wasm.v1.MsgUpdateAdmin", MsgUpdateAdmin], ["/cosmwasm.wasm.v1.MsgClearAdmin", MsgClearAdmin], ["/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", MsgUpdateInstantiateConfig]]; +import { MsgStoreCode, MsgInstantiateContract, MsgInstantiateContract2, MsgExecuteContract, MsgMigrateContract, MsgUpdateAdmin, MsgClearAdmin, MsgUpdateInstantiateConfig, MsgUpdateParams, MsgSudoContract, MsgPinCodes, MsgUnpinCodes, MsgStoreAndInstantiateContract, MsgRemoveCodeUploadParamsAddresses, MsgAddCodeUploadParamsAddresses, MsgStoreAndMigrateContract, MsgUpdateContractLabel, MsgSetGaslessContracts } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/cosmwasm.wasm.v1.MsgStoreCode", MsgStoreCode], ["/cosmwasm.wasm.v1.MsgInstantiateContract", MsgInstantiateContract], ["/cosmwasm.wasm.v1.MsgInstantiateContract2", MsgInstantiateContract2], ["/cosmwasm.wasm.v1.MsgExecuteContract", MsgExecuteContract], ["/cosmwasm.wasm.v1.MsgMigrateContract", MsgMigrateContract], ["/cosmwasm.wasm.v1.MsgUpdateAdmin", MsgUpdateAdmin], ["/cosmwasm.wasm.v1.MsgClearAdmin", MsgClearAdmin], ["/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", MsgUpdateInstantiateConfig], ["/cosmwasm.wasm.v1.MsgUpdateParams", MsgUpdateParams], ["/cosmwasm.wasm.v1.MsgSudoContract", MsgSudoContract], ["/cosmwasm.wasm.v1.MsgPinCodes", MsgPinCodes], ["/cosmwasm.wasm.v1.MsgUnpinCodes", MsgUnpinCodes], ["/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", MsgStoreAndInstantiateContract], ["/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses", MsgRemoveCodeUploadParamsAddresses], ["/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses", MsgAddCodeUploadParamsAddresses], ["/cosmwasm.wasm.v1.MsgStoreAndMigrateContract", MsgStoreAndMigrateContract], ["/cosmwasm.wasm.v1.MsgUpdateContractLabel", MsgUpdateContractLabel], ["/cosmwasm.wasm.v1.MsgSetGaslessContracts", MsgSetGaslessContracts]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -55,6 +55,66 @@ export const MessageComposer = { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", value: MsgUpdateInstantiateConfig.encode(value).finish() }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + }, + sudoContract(value: MsgSudoContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract", + value: MsgSudoContract.encode(value).finish() + }; + }, + pinCodes(value: MsgPinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes", + value: MsgPinCodes.encode(value).finish() + }; + }, + unpinCodes(value: MsgUnpinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes", + value: MsgUnpinCodes.encode(value).finish() + }; + }, + storeAndInstantiateContract(value: MsgStoreAndInstantiateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", + value: MsgStoreAndInstantiateContract.encode(value).finish() + }; + }, + removeCodeUploadParamsAddresses(value: MsgRemoveCodeUploadParamsAddresses) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses", + value: MsgRemoveCodeUploadParamsAddresses.encode(value).finish() + }; + }, + addCodeUploadParamsAddresses(value: MsgAddCodeUploadParamsAddresses) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses", + value: MsgAddCodeUploadParamsAddresses.encode(value).finish() + }; + }, + storeAndMigrateContract(value: MsgStoreAndMigrateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract", + value: MsgStoreAndMigrateContract.encode(value).finish() + }; + }, + updateContractLabel(value: MsgUpdateContractLabel) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabel", + value: MsgUpdateContractLabel.encode(value).finish() + }; + }, + setGaslessContracts(value: MsgSetGaslessContracts) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgSetGaslessContracts", + value: MsgSetGaslessContracts.encode(value).finish() + }; } }, withTypeUrl: { @@ -105,6 +165,66 @@ export const MessageComposer = { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", value }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams", + value + }; + }, + sudoContract(value: MsgSudoContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract", + value + }; + }, + pinCodes(value: MsgPinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes", + value + }; + }, + unpinCodes(value: MsgUnpinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes", + value + }; + }, + storeAndInstantiateContract(value: MsgStoreAndInstantiateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", + value + }; + }, + removeCodeUploadParamsAddresses(value: MsgRemoveCodeUploadParamsAddresses) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses", + value + }; + }, + addCodeUploadParamsAddresses(value: MsgAddCodeUploadParamsAddresses) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses", + value + }; + }, + storeAndMigrateContract(value: MsgStoreAndMigrateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract", + value + }; + }, + updateContractLabel(value: MsgUpdateContractLabel) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabel", + value + }; + }, + setGaslessContracts(value: MsgSetGaslessContracts) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgSetGaslessContracts", + value + }; } }, fromPartial: { @@ -155,6 +275,66 @@ export const MessageComposer = { typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", value: MsgUpdateInstantiateConfig.fromPartial(value) }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + }, + sudoContract(value: MsgSudoContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract", + value: MsgSudoContract.fromPartial(value) + }; + }, + pinCodes(value: MsgPinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes", + value: MsgPinCodes.fromPartial(value) + }; + }, + unpinCodes(value: MsgUnpinCodes) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes", + value: MsgUnpinCodes.fromPartial(value) + }; + }, + storeAndInstantiateContract(value: MsgStoreAndInstantiateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", + value: MsgStoreAndInstantiateContract.fromPartial(value) + }; + }, + removeCodeUploadParamsAddresses(value: MsgRemoveCodeUploadParamsAddresses) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses", + value: MsgRemoveCodeUploadParamsAddresses.fromPartial(value) + }; + }, + addCodeUploadParamsAddresses(value: MsgAddCodeUploadParamsAddresses) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses", + value: MsgAddCodeUploadParamsAddresses.fromPartial(value) + }; + }, + storeAndMigrateContract(value: MsgStoreAndMigrateContract) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract", + value: MsgStoreAndMigrateContract.fromPartial(value) + }; + }, + updateContractLabel(value: MsgUpdateContractLabel) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabel", + value: MsgUpdateContractLabel.fromPartial(value) + }; + }, + setGaslessContracts(value: MsgSetGaslessContracts) { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgSetGaslessContracts", + value: MsgSetGaslessContracts.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/src/codegen/cosmwasm/wasm/v1/tx.rpc.msg.ts b/src/codegen/cosmwasm/wasm/v1/tx.rpc.msg.ts index 7fdd8a7..e2737f9 100644 --- a/src/codegen/cosmwasm/wasm/v1/tx.rpc.msg.ts +++ b/src/codegen/cosmwasm/wasm/v1/tx.rpc.msg.ts @@ -1,6 +1,6 @@ import { Rpc } from "../../../helpers"; import { BinaryReader } from "../../../binary"; -import { MsgStoreCode, MsgStoreCodeResponse, MsgInstantiateContract, MsgInstantiateContractResponse, MsgInstantiateContract2, MsgInstantiateContract2Response, MsgExecuteContract, MsgExecuteContractResponse, MsgMigrateContract, MsgMigrateContractResponse, MsgUpdateAdmin, MsgUpdateAdminResponse, MsgClearAdmin, MsgClearAdminResponse, MsgUpdateInstantiateConfig, MsgUpdateInstantiateConfigResponse } from "./tx"; +import { MsgStoreCode, MsgStoreCodeResponse, MsgInstantiateContract, MsgInstantiateContractResponse, MsgInstantiateContract2, MsgInstantiateContract2Response, MsgExecuteContract, MsgExecuteContractResponse, MsgMigrateContract, MsgMigrateContractResponse, MsgUpdateAdmin, MsgUpdateAdminResponse, MsgClearAdmin, MsgClearAdminResponse, MsgUpdateInstantiateConfig, MsgUpdateInstantiateConfigResponse, MsgUpdateParams, MsgUpdateParamsResponse, MsgSudoContract, MsgSudoContractResponse, MsgPinCodes, MsgPinCodesResponse, MsgUnpinCodes, MsgUnpinCodesResponse, MsgStoreAndInstantiateContract, MsgStoreAndInstantiateContractResponse, MsgRemoveCodeUploadParamsAddresses, MsgRemoveCodeUploadParamsAddressesResponse, MsgAddCodeUploadParamsAddresses, MsgAddCodeUploadParamsAddressesResponse, MsgStoreAndMigrateContract, MsgStoreAndMigrateContractResponse, MsgUpdateContractLabel, MsgUpdateContractLabelResponse, MsgSetGaslessContracts, MsgSetGaslessContractsResponse } from "./tx"; /** Msg defines the wasm Msg service. */ export interface Msg { /** StoreCode to submit Wasm code to the system */ @@ -19,12 +19,74 @@ export interface Msg { executeContract(request: MsgExecuteContract): Promise; /** Migrate runs a code upgrade/ downgrade for a smart contract */ migrateContract(request: MsgMigrateContract): Promise; - /** UpdateAdmin sets a new admin for a smart contract */ + /** UpdateAdmin sets a new admin for a smart contract */ updateAdmin(request: MsgUpdateAdmin): Promise; /** ClearAdmin removes any admin stored for a smart contract */ clearAdmin(request: MsgClearAdmin): Promise; /** UpdateInstantiateConfig updates instantiate config for a smart contract */ updateInstantiateConfig(request: MsgUpdateInstantiateConfig): Promise; + /** + * UpdateParams defines a governance operation for updating the x/wasm + * module parameters. The authority is defined in the keeper. + * + * Since: 0.40 + */ + updateParams(request: MsgUpdateParams): Promise; + /** + * SudoContract defines a governance operation for calling sudo + * on a contract. The authority is defined in the keeper. + * + * Since: 0.40 + */ + sudoContract(request: MsgSudoContract): Promise; + /** + * PinCodes defines a governance operation for pinning a set of + * code ids in the wasmvm cache. The authority is defined in the keeper. + * + * Since: 0.40 + */ + pinCodes(request: MsgPinCodes): Promise; + /** + * UnpinCodes defines a governance operation for unpinning a set of + * code ids in the wasmvm cache. The authority is defined in the keeper. + * + * Since: 0.40 + */ + unpinCodes(request: MsgUnpinCodes): Promise; + /** + * StoreAndInstantiateContract defines a governance operation for storing + * and instantiating the contract. The authority is defined in the keeper. + * + * Since: 0.40 + */ + storeAndInstantiateContract(request: MsgStoreAndInstantiateContract): Promise; + /** + * RemoveCodeUploadParamsAddresses defines a governance operation for + * removing addresses from code upload params. + * The authority is defined in the keeper. + */ + removeCodeUploadParamsAddresses(request: MsgRemoveCodeUploadParamsAddresses): Promise; + /** + * AddCodeUploadParamsAddresses defines a governance operation for + * adding addresses to code upload params. + * The authority is defined in the keeper. + */ + addCodeUploadParamsAddresses(request: MsgAddCodeUploadParamsAddresses): Promise; + /** + * StoreAndMigrateContract defines a governance operation for storing + * and migrating the contract. The authority is defined in the keeper. + * + * Since: 0.42 + */ + storeAndMigrateContract(request: MsgStoreAndMigrateContract): Promise; + /** + * UpdateContractLabel sets a new label for a smart contract + * + * Since: 0.43 + */ + updateContractLabel(request: MsgUpdateContractLabel): Promise; + /** SetGaslessContract set contracts are gasless */ + setGaslessContracts(request: MsgSetGaslessContracts): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -38,6 +100,16 @@ export class MsgClientImpl implements Msg { this.updateAdmin = this.updateAdmin.bind(this); this.clearAdmin = this.clearAdmin.bind(this); this.updateInstantiateConfig = this.updateInstantiateConfig.bind(this); + this.updateParams = this.updateParams.bind(this); + this.sudoContract = this.sudoContract.bind(this); + this.pinCodes = this.pinCodes.bind(this); + this.unpinCodes = this.unpinCodes.bind(this); + this.storeAndInstantiateContract = this.storeAndInstantiateContract.bind(this); + this.removeCodeUploadParamsAddresses = this.removeCodeUploadParamsAddresses.bind(this); + this.addCodeUploadParamsAddresses = this.addCodeUploadParamsAddresses.bind(this); + this.storeAndMigrateContract = this.storeAndMigrateContract.bind(this); + this.updateContractLabel = this.updateContractLabel.bind(this); + this.setGaslessContracts = this.setGaslessContracts.bind(this); } storeCode(request: MsgStoreCode): Promise { const data = MsgStoreCode.encode(request).finish(); @@ -79,4 +151,54 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "UpdateInstantiateConfig", data); return promise.then(data => MsgUpdateInstantiateConfigResponse.decode(new BinaryReader(data))); } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } + sudoContract(request: MsgSudoContract): Promise { + const data = MsgSudoContract.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "SudoContract", data); + return promise.then(data => MsgSudoContractResponse.decode(new BinaryReader(data))); + } + pinCodes(request: MsgPinCodes): Promise { + const data = MsgPinCodes.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "PinCodes", data); + return promise.then(data => MsgPinCodesResponse.decode(new BinaryReader(data))); + } + unpinCodes(request: MsgUnpinCodes): Promise { + const data = MsgUnpinCodes.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "UnpinCodes", data); + return promise.then(data => MsgUnpinCodesResponse.decode(new BinaryReader(data))); + } + storeAndInstantiateContract(request: MsgStoreAndInstantiateContract): Promise { + const data = MsgStoreAndInstantiateContract.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "StoreAndInstantiateContract", data); + return promise.then(data => MsgStoreAndInstantiateContractResponse.decode(new BinaryReader(data))); + } + removeCodeUploadParamsAddresses(request: MsgRemoveCodeUploadParamsAddresses): Promise { + const data = MsgRemoveCodeUploadParamsAddresses.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "RemoveCodeUploadParamsAddresses", data); + return promise.then(data => MsgRemoveCodeUploadParamsAddressesResponse.decode(new BinaryReader(data))); + } + addCodeUploadParamsAddresses(request: MsgAddCodeUploadParamsAddresses): Promise { + const data = MsgAddCodeUploadParamsAddresses.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "AddCodeUploadParamsAddresses", data); + return promise.then(data => MsgAddCodeUploadParamsAddressesResponse.decode(new BinaryReader(data))); + } + storeAndMigrateContract(request: MsgStoreAndMigrateContract): Promise { + const data = MsgStoreAndMigrateContract.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "StoreAndMigrateContract", data); + return promise.then(data => MsgStoreAndMigrateContractResponse.decode(new BinaryReader(data))); + } + updateContractLabel(request: MsgUpdateContractLabel): Promise { + const data = MsgUpdateContractLabel.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "UpdateContractLabel", data); + return promise.then(data => MsgUpdateContractLabelResponse.decode(new BinaryReader(data))); + } + setGaslessContracts(request: MsgSetGaslessContracts): Promise { + const data = MsgSetGaslessContracts.encode(request).finish(); + const promise = this.rpc.request("cosmwasm.wasm.v1.Msg", "SetGaslessContracts", data); + return promise.then(data => MsgSetGaslessContractsResponse.decode(new BinaryReader(data))); + } } \ No newline at end of file diff --git a/src/codegen/cosmwasm/wasm/v1/tx.ts b/src/codegen/cosmwasm/wasm/v1/tx.ts index 7f138b6..45387e2 100644 --- a/src/codegen/cosmwasm/wasm/v1/tx.ts +++ b/src/codegen/cosmwasm/wasm/v1/tx.ts @@ -1,4 +1,4 @@ -import { AccessConfig, AccessConfigAmino, AccessConfigSDKType } from "./types"; +import { AccessConfig, AccessConfigAmino, AccessConfigSDKType, Params, ParamsAmino, ParamsSDKType } from "./types"; import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../binary"; import { fromBase64, toBase64, toUtf8, fromUtf8 } from "@cosmjs/encoding"; @@ -106,7 +106,7 @@ export interface MsgInstantiateContractAmino { /** Msg json encoded message to be passed to the contract on instantiation */ msg?: any; /** Funds coins that are transferred to the contract on instantiation */ - funds?: CoinAmino[]; + funds: CoinAmino[]; } export interface MsgInstantiateContractAminoMsg { type: "wasm/MsgInstantiateContract"; @@ -124,9 +124,36 @@ export interface MsgInstantiateContractSDKType { msg: Uint8Array; funds: CoinSDKType[]; } +/** MsgInstantiateContractResponse return instantiation result data */ +export interface MsgInstantiateContractResponse { + /** Address is the bech32 address of the new contract instance. */ + address: string; + /** Data contains bytes to returned from the contract */ + data: Uint8Array; +} +export interface MsgInstantiateContractResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContractResponse"; + value: Uint8Array; +} +/** MsgInstantiateContractResponse return instantiation result data */ +export interface MsgInstantiateContractResponseAmino { + /** Address is the bech32 address of the new contract instance. */ + address?: string; + /** Data contains bytes to returned from the contract */ + data?: string; +} +export interface MsgInstantiateContractResponseAminoMsg { + type: "wasm/MsgInstantiateContractResponse"; + value: MsgInstantiateContractResponseAmino; +} +/** MsgInstantiateContractResponse return instantiation result data */ +export interface MsgInstantiateContractResponseSDKType { + address: string; + data: Uint8Array; +} /** * MsgInstantiateContract2 create a new smart contract instance for the given - * code id with a predicable address. + * code id with a predictable address. */ export interface MsgInstantiateContract2 { /** Sender is the that actor that signed the messages */ @@ -155,7 +182,7 @@ export interface MsgInstantiateContract2ProtoMsg { } /** * MsgInstantiateContract2 create a new smart contract instance for the given - * code id with a predicable address. + * code id with a predictable address. */ export interface MsgInstantiateContract2Amino { /** Sender is the that actor that signed the messages */ @@ -169,7 +196,7 @@ export interface MsgInstantiateContract2Amino { /** Msg json encoded message to be passed to the contract on instantiation */ msg?: any; /** Funds coins that are transferred to the contract on instantiation */ - funds?: CoinAmino[]; + funds: CoinAmino[]; /** Salt is an arbitrary value provided by the sender. Size can be 1 to 64. */ salt?: string; /** @@ -184,7 +211,7 @@ export interface MsgInstantiateContract2AminoMsg { } /** * MsgInstantiateContract2 create a new smart contract instance for the given - * code id with a predicable address. + * code id with a predictable address. */ export interface MsgInstantiateContract2SDKType { sender: string; @@ -196,33 +223,6 @@ export interface MsgInstantiateContract2SDKType { salt: Uint8Array; fix_msg: boolean; } -/** MsgInstantiateContractResponse return instantiation result data */ -export interface MsgInstantiateContractResponse { - /** Address is the bech32 address of the new contract instance. */ - address: string; - /** Data contains bytes to returned from the contract */ - data: Uint8Array; -} -export interface MsgInstantiateContractResponseProtoMsg { - typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContractResponse"; - value: Uint8Array; -} -/** MsgInstantiateContractResponse return instantiation result data */ -export interface MsgInstantiateContractResponseAmino { - /** Address is the bech32 address of the new contract instance. */ - address?: string; - /** Data contains bytes to returned from the contract */ - data?: string; -} -export interface MsgInstantiateContractResponseAminoMsg { - type: "wasm/MsgInstantiateContractResponse"; - value: MsgInstantiateContractResponseAmino; -} -/** MsgInstantiateContractResponse return instantiation result data */ -export interface MsgInstantiateContractResponseSDKType { - address: string; - data: Uint8Array; -} /** MsgInstantiateContract2Response return instantiation result data */ export interface MsgInstantiateContract2Response { /** Address is the bech32 address of the new contract instance. */ @@ -274,7 +274,7 @@ export interface MsgExecuteContractAmino { /** Msg json encoded message to be passed to the contract */ msg?: any; /** Funds coins that are transferred to the contract on execution */ - funds?: CoinAmino[]; + funds: CoinAmino[]; } export interface MsgExecuteContractAminoMsg { type: "wasm/MsgExecuteContract"; @@ -507,237 +507,2649 @@ export interface MsgUpdateInstantiateConfigResponseAminoMsg { } /** MsgUpdateInstantiateConfigResponse returns empty data */ export interface MsgUpdateInstantiateConfigResponseSDKType {} -function createBaseMsgStoreCode(): MsgStoreCode { - return { - sender: "", - wasmByteCode: new Uint8Array(), - instantiatePermission: undefined - }; +/** + * MsgUpdateParams is the MsgUpdateParams request type. + * + * Since: 0.40 + */ +export interface MsgUpdateParams { + /** Authority is the address of the governance account. */ + authority: string; + /** + * params defines the x/wasm parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; } -export const MsgStoreCode = { - typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode", - encode(message: MsgStoreCode, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); - } - if (message.wasmByteCode.length !== 0) { - writer.uint32(18).bytes(message.wasmByteCode); - } - if (message.instantiatePermission !== undefined) { - AccessConfig.encode(message.instantiatePermission, writer.uint32(42).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreCode { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgStoreCode(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sender = reader.string(); - break; - case 2: - message.wasmByteCode = reader.bytes(); - break; - case 5: - message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): MsgStoreCode { - const message = createBaseMsgStoreCode(); - message.sender = object.sender ?? ""; - message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); - message.instantiatePermission = object.instantiatePermission !== undefined && object.instantiatePermission !== null ? AccessConfig.fromPartial(object.instantiatePermission) : undefined; - return message; - }, - fromAmino(object: MsgStoreCodeAmino): MsgStoreCode { - const message = createBaseMsgStoreCode(); - if (object.sender !== undefined && object.sender !== null) { - message.sender = object.sender; - } - if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { - message.wasmByteCode = fromBase64(object.wasm_byte_code); - } - if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { - message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); - } - return message; - }, - toAmino(message: MsgStoreCode): MsgStoreCodeAmino { - const obj: any = {}; - obj.sender = message.sender === "" ? undefined : message.sender; - obj.wasm_byte_code = message.wasmByteCode ? toBase64(message.wasmByteCode) : undefined; - obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : undefined; - return obj; - }, - fromAminoMsg(object: MsgStoreCodeAminoMsg): MsgStoreCode { - return MsgStoreCode.fromAmino(object.value); - }, - toAminoMsg(message: MsgStoreCode): MsgStoreCodeAminoMsg { - return { - type: "wasm/MsgStoreCode", - value: MsgStoreCode.toAmino(message) - }; - }, - fromProtoMsg(message: MsgStoreCodeProtoMsg): MsgStoreCode { - return MsgStoreCode.decode(message.value); - }, - toProto(message: MsgStoreCode): Uint8Array { - return MsgStoreCode.encode(message).finish(); - }, - toProtoMsg(message: MsgStoreCode): MsgStoreCodeProtoMsg { - return { - typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode", - value: MsgStoreCode.encode(message).finish() - }; - } -}; -function createBaseMsgStoreCodeResponse(): MsgStoreCodeResponse { - return { - codeId: BigInt(0), - checksum: new Uint8Array() - }; +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams"; + value: Uint8Array; } -export const MsgStoreCodeResponse = { - typeUrl: "/cosmwasm.wasm.v1.MsgStoreCodeResponse", - encode(message: MsgStoreCodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.codeId !== BigInt(0)) { - writer.uint32(8).uint64(message.codeId); - } - if (message.checksum.length !== 0) { - writer.uint32(18).bytes(message.checksum); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreCodeResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgStoreCodeResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.codeId = reader.uint64(); - break; - case 2: - message.checksum = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): MsgStoreCodeResponse { - const message = createBaseMsgStoreCodeResponse(); - message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); - message.checksum = object.checksum ?? new Uint8Array(); - return message; - }, - fromAmino(object: MsgStoreCodeResponseAmino): MsgStoreCodeResponse { - const message = createBaseMsgStoreCodeResponse(); - if (object.code_id !== undefined && object.code_id !== null) { - message.codeId = BigInt(object.code_id); - } - if (object.checksum !== undefined && object.checksum !== null) { - message.checksum = bytesFromBase64(object.checksum); - } - return message; - }, - toAmino(message: MsgStoreCodeResponse): MsgStoreCodeResponseAmino { - const obj: any = {}; - obj.code_id = message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; - obj.checksum = message.checksum ? base64FromBytes(message.checksum) : undefined; - return obj; - }, - fromAminoMsg(object: MsgStoreCodeResponseAminoMsg): MsgStoreCodeResponse { - return MsgStoreCodeResponse.fromAmino(object.value); - }, - toAminoMsg(message: MsgStoreCodeResponse): MsgStoreCodeResponseAminoMsg { - return { - type: "wasm/MsgStoreCodeResponse", - value: MsgStoreCodeResponse.toAmino(message) - }; - }, - fromProtoMsg(message: MsgStoreCodeResponseProtoMsg): MsgStoreCodeResponse { - return MsgStoreCodeResponse.decode(message.value); - }, - toProto(message: MsgStoreCodeResponse): Uint8Array { - return MsgStoreCodeResponse.encode(message).finish(); - }, - toProtoMsg(message: MsgStoreCodeResponse): MsgStoreCodeResponseProtoMsg { - return { - typeUrl: "/cosmwasm.wasm.v1.MsgStoreCodeResponse", - value: MsgStoreCodeResponse.encode(message).finish() - }; - } -}; -function createBaseMsgInstantiateContract(): MsgInstantiateContract { - return { - sender: "", - admin: "", - codeId: BigInt(0), - label: "", - msg: new Uint8Array(), - funds: [] - }; +/** + * MsgUpdateParams is the MsgUpdateParams request type. + * + * Since: 0.40 + */ +export interface MsgUpdateParamsAmino { + /** Authority is the address of the governance account. */ + authority?: string; + /** + * params defines the x/wasm parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: ParamsAmino; } -export const MsgInstantiateContract = { - typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract", - encode(message: MsgInstantiateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); - } - if (message.admin !== "") { - writer.uint32(18).string(message.admin); - } - if (message.codeId !== BigInt(0)) { - writer.uint32(24).uint64(message.codeId); - } +export interface MsgUpdateParamsAminoMsg { + type: "wasm/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** + * MsgUpdateParams is the MsgUpdateParams request type. + * + * Since: 0.40 + */ +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsSDKType; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: 0.40 + */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: 0.40 + */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "wasm/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + * + * Since: 0.40 + */ +export interface MsgUpdateParamsResponseSDKType {} +/** + * MsgSudoContract is the MsgSudoContract request type. + * + * Since: 0.40 + */ +export interface MsgSudoContract { + /** Authority is the address of the governance account. */ + authority: string; + /** Contract is the address of the smart contract */ + contract: string; + /** Msg json encoded message to be passed to the contract as sudo */ + msg: Uint8Array; +} +export interface MsgSudoContractProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract"; + value: Uint8Array; +} +/** + * MsgSudoContract is the MsgSudoContract request type. + * + * Since: 0.40 + */ +export interface MsgSudoContractAmino { + /** Authority is the address of the governance account. */ + authority?: string; + /** Contract is the address of the smart contract */ + contract?: string; + /** Msg json encoded message to be passed to the contract as sudo */ + msg?: any; +} +export interface MsgSudoContractAminoMsg { + type: "wasm/MsgSudoContract"; + value: MsgSudoContractAmino; +} +/** + * MsgSudoContract is the MsgSudoContract request type. + * + * Since: 0.40 + */ +export interface MsgSudoContractSDKType { + authority: string; + contract: string; + msg: Uint8Array; +} +/** + * MsgSudoContractResponse defines the response structure for executing a + * MsgSudoContract message. + * + * Since: 0.40 + */ +export interface MsgSudoContractResponse { + /** Data contains bytes to returned from the contract */ + data: Uint8Array; +} +export interface MsgSudoContractResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContractResponse"; + value: Uint8Array; +} +/** + * MsgSudoContractResponse defines the response structure for executing a + * MsgSudoContract message. + * + * Since: 0.40 + */ +export interface MsgSudoContractResponseAmino { + /** Data contains bytes to returned from the contract */ + data?: string; +} +export interface MsgSudoContractResponseAminoMsg { + type: "wasm/MsgSudoContractResponse"; + value: MsgSudoContractResponseAmino; +} +/** + * MsgSudoContractResponse defines the response structure for executing a + * MsgSudoContract message. + * + * Since: 0.40 + */ +export interface MsgSudoContractResponseSDKType { + data: Uint8Array; +} +/** + * MsgPinCodes is the MsgPinCodes request type. + * + * Since: 0.40 + */ +export interface MsgPinCodes { + /** Authority is the address of the governance account. */ + authority: string; + /** CodeIDs references the new WASM codes */ + codeIds: bigint[]; +} +export interface MsgPinCodesProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes"; + value: Uint8Array; +} +/** + * MsgPinCodes is the MsgPinCodes request type. + * + * Since: 0.40 + */ +export interface MsgPinCodesAmino { + /** Authority is the address of the governance account. */ + authority?: string; + /** CodeIDs references the new WASM codes */ + code_ids?: string[]; +} +export interface MsgPinCodesAminoMsg { + type: "wasm/MsgPinCodes"; + value: MsgPinCodesAmino; +} +/** + * MsgPinCodes is the MsgPinCodes request type. + * + * Since: 0.40 + */ +export interface MsgPinCodesSDKType { + authority: string; + code_ids: bigint[]; +} +/** + * MsgPinCodesResponse defines the response structure for executing a + * MsgPinCodes message. + * + * Since: 0.40 + */ +export interface MsgPinCodesResponse {} +export interface MsgPinCodesResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodesResponse"; + value: Uint8Array; +} +/** + * MsgPinCodesResponse defines the response structure for executing a + * MsgPinCodes message. + * + * Since: 0.40 + */ +export interface MsgPinCodesResponseAmino {} +export interface MsgPinCodesResponseAminoMsg { + type: "wasm/MsgPinCodesResponse"; + value: MsgPinCodesResponseAmino; +} +/** + * MsgPinCodesResponse defines the response structure for executing a + * MsgPinCodes message. + * + * Since: 0.40 + */ +export interface MsgPinCodesResponseSDKType {} +/** + * MsgUnpinCodes is the MsgUnpinCodes request type. + * + * Since: 0.40 + */ +export interface MsgUnpinCodes { + /** Authority is the address of the governance account. */ + authority: string; + /** CodeIDs references the WASM codes */ + codeIds: bigint[]; +} +export interface MsgUnpinCodesProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes"; + value: Uint8Array; +} +/** + * MsgUnpinCodes is the MsgUnpinCodes request type. + * + * Since: 0.40 + */ +export interface MsgUnpinCodesAmino { + /** Authority is the address of the governance account. */ + authority?: string; + /** CodeIDs references the WASM codes */ + code_ids?: string[]; +} +export interface MsgUnpinCodesAminoMsg { + type: "wasm/MsgUnpinCodes"; + value: MsgUnpinCodesAmino; +} +/** + * MsgUnpinCodes is the MsgUnpinCodes request type. + * + * Since: 0.40 + */ +export interface MsgUnpinCodesSDKType { + authority: string; + code_ids: bigint[]; +} +/** + * MsgUnpinCodesResponse defines the response structure for executing a + * MsgUnpinCodes message. + * + * Since: 0.40 + */ +export interface MsgUnpinCodesResponse {} +export interface MsgUnpinCodesResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodesResponse"; + value: Uint8Array; +} +/** + * MsgUnpinCodesResponse defines the response structure for executing a + * MsgUnpinCodes message. + * + * Since: 0.40 + */ +export interface MsgUnpinCodesResponseAmino {} +export interface MsgUnpinCodesResponseAminoMsg { + type: "wasm/MsgUnpinCodesResponse"; + value: MsgUnpinCodesResponseAmino; +} +/** + * MsgUnpinCodesResponse defines the response structure for executing a + * MsgUnpinCodes message. + * + * Since: 0.40 + */ +export interface MsgUnpinCodesResponseSDKType {} +/** + * MsgStoreAndInstantiateContract is the MsgStoreAndInstantiateContract + * request type. + * + * Since: 0.40 + */ +export interface MsgStoreAndInstantiateContract { + /** Authority is the address of the governance account. */ + authority: string; + /** WASMByteCode can be raw or gzip compressed */ + wasmByteCode: Uint8Array; + /** InstantiatePermission to apply on contract creation, optional */ + instantiatePermission?: AccessConfig; + /** + * UnpinCode code on upload, optional. As default the uploaded contract is + * pinned to cache. + */ + unpinCode: boolean; + /** Admin is an optional address that can execute migrations */ + admin: string; + /** Label is optional metadata to be stored with a constract instance. */ + label: string; + /** Msg json encoded message to be passed to the contract on instantiation */ + msg: Uint8Array; + /** + * Funds coins that are transferred from the authority account to the contract + * on instantiation + */ + funds: Coin[]; + /** Source is the URL where the code is hosted */ + source: string; + /** + * Builder is the docker image used to build the code deterministically, used + * for smart contract verification + */ + builder: string; + /** + * CodeHash is the SHA256 sum of the code outputted by builder, used for smart + * contract verification + */ + codeHash: Uint8Array; +} +export interface MsgStoreAndInstantiateContractProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract"; + value: Uint8Array; +} +/** + * MsgStoreAndInstantiateContract is the MsgStoreAndInstantiateContract + * request type. + * + * Since: 0.40 + */ +export interface MsgStoreAndInstantiateContractAmino { + /** Authority is the address of the governance account. */ + authority?: string; + /** WASMByteCode can be raw or gzip compressed */ + wasm_byte_code?: string; + /** InstantiatePermission to apply on contract creation, optional */ + instantiate_permission?: AccessConfigAmino; + /** + * UnpinCode code on upload, optional. As default the uploaded contract is + * pinned to cache. + */ + unpin_code?: boolean; + /** Admin is an optional address that can execute migrations */ + admin?: string; + /** Label is optional metadata to be stored with a constract instance. */ + label?: string; + /** Msg json encoded message to be passed to the contract on instantiation */ + msg?: any; + /** + * Funds coins that are transferred from the authority account to the contract + * on instantiation + */ + funds: CoinAmino[]; + /** Source is the URL where the code is hosted */ + source?: string; + /** + * Builder is the docker image used to build the code deterministically, used + * for smart contract verification + */ + builder?: string; + /** + * CodeHash is the SHA256 sum of the code outputted by builder, used for smart + * contract verification + */ + code_hash?: string; +} +export interface MsgStoreAndInstantiateContractAminoMsg { + type: "wasm/MsgStoreAndInstantiateContract"; + value: MsgStoreAndInstantiateContractAmino; +} +/** + * MsgStoreAndInstantiateContract is the MsgStoreAndInstantiateContract + * request type. + * + * Since: 0.40 + */ +export interface MsgStoreAndInstantiateContractSDKType { + authority: string; + wasm_byte_code: Uint8Array; + instantiate_permission?: AccessConfigSDKType; + unpin_code: boolean; + admin: string; + label: string; + msg: Uint8Array; + funds: CoinSDKType[]; + source: string; + builder: string; + code_hash: Uint8Array; +} +/** + * MsgStoreAndInstantiateContractResponse defines the response structure + * for executing a MsgStoreAndInstantiateContract message. + * + * Since: 0.40 + */ +export interface MsgStoreAndInstantiateContractResponse { + /** Address is the bech32 address of the new contract instance. */ + address: string; + /** Data contains bytes to returned from the contract */ + data: Uint8Array; +} +export interface MsgStoreAndInstantiateContractResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContractResponse"; + value: Uint8Array; +} +/** + * MsgStoreAndInstantiateContractResponse defines the response structure + * for executing a MsgStoreAndInstantiateContract message. + * + * Since: 0.40 + */ +export interface MsgStoreAndInstantiateContractResponseAmino { + /** Address is the bech32 address of the new contract instance. */ + address?: string; + /** Data contains bytes to returned from the contract */ + data?: string; +} +export interface MsgStoreAndInstantiateContractResponseAminoMsg { + type: "wasm/MsgStoreAndInstantiateContractResponse"; + value: MsgStoreAndInstantiateContractResponseAmino; +} +/** + * MsgStoreAndInstantiateContractResponse defines the response structure + * for executing a MsgStoreAndInstantiateContract message. + * + * Since: 0.40 + */ +export interface MsgStoreAndInstantiateContractResponseSDKType { + address: string; + data: Uint8Array; +} +/** + * MsgAddCodeUploadParamsAddresses is the + * MsgAddCodeUploadParamsAddresses request type. + */ +export interface MsgAddCodeUploadParamsAddresses { + /** Authority is the address of the governance account. */ + authority: string; + addresses: string[]; +} +export interface MsgAddCodeUploadParamsAddressesProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses"; + value: Uint8Array; +} +/** + * MsgAddCodeUploadParamsAddresses is the + * MsgAddCodeUploadParamsAddresses request type. + */ +export interface MsgAddCodeUploadParamsAddressesAmino { + /** Authority is the address of the governance account. */ + authority?: string; + addresses?: string[]; +} +export interface MsgAddCodeUploadParamsAddressesAminoMsg { + type: "wasm/MsgAddCodeUploadParamsAddresses"; + value: MsgAddCodeUploadParamsAddressesAmino; +} +/** + * MsgAddCodeUploadParamsAddresses is the + * MsgAddCodeUploadParamsAddresses request type. + */ +export interface MsgAddCodeUploadParamsAddressesSDKType { + authority: string; + addresses: string[]; +} +/** + * MsgAddCodeUploadParamsAddressesResponse defines the response + * structure for executing a MsgAddCodeUploadParamsAddresses message. + */ +export interface MsgAddCodeUploadParamsAddressesResponse {} +export interface MsgAddCodeUploadParamsAddressesResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddressesResponse"; + value: Uint8Array; +} +/** + * MsgAddCodeUploadParamsAddressesResponse defines the response + * structure for executing a MsgAddCodeUploadParamsAddresses message. + */ +export interface MsgAddCodeUploadParamsAddressesResponseAmino {} +export interface MsgAddCodeUploadParamsAddressesResponseAminoMsg { + type: "wasm/MsgAddCodeUploadParamsAddressesResponse"; + value: MsgAddCodeUploadParamsAddressesResponseAmino; +} +/** + * MsgAddCodeUploadParamsAddressesResponse defines the response + * structure for executing a MsgAddCodeUploadParamsAddresses message. + */ +export interface MsgAddCodeUploadParamsAddressesResponseSDKType {} +/** + * MsgRemoveCodeUploadParamsAddresses is the + * MsgRemoveCodeUploadParamsAddresses request type. + */ +export interface MsgRemoveCodeUploadParamsAddresses { + /** Authority is the address of the governance account. */ + authority: string; + addresses: string[]; +} +export interface MsgRemoveCodeUploadParamsAddressesProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses"; + value: Uint8Array; +} +/** + * MsgRemoveCodeUploadParamsAddresses is the + * MsgRemoveCodeUploadParamsAddresses request type. + */ +export interface MsgRemoveCodeUploadParamsAddressesAmino { + /** Authority is the address of the governance account. */ + authority?: string; + addresses?: string[]; +} +export interface MsgRemoveCodeUploadParamsAddressesAminoMsg { + type: "wasm/MsgRemoveCodeUploadParamsAddresses"; + value: MsgRemoveCodeUploadParamsAddressesAmino; +} +/** + * MsgRemoveCodeUploadParamsAddresses is the + * MsgRemoveCodeUploadParamsAddresses request type. + */ +export interface MsgRemoveCodeUploadParamsAddressesSDKType { + authority: string; + addresses: string[]; +} +/** + * MsgRemoveCodeUploadParamsAddressesResponse defines the response + * structure for executing a MsgRemoveCodeUploadParamsAddresses message. + */ +export interface MsgRemoveCodeUploadParamsAddressesResponse {} +export interface MsgRemoveCodeUploadParamsAddressesResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddressesResponse"; + value: Uint8Array; +} +/** + * MsgRemoveCodeUploadParamsAddressesResponse defines the response + * structure for executing a MsgRemoveCodeUploadParamsAddresses message. + */ +export interface MsgRemoveCodeUploadParamsAddressesResponseAmino {} +export interface MsgRemoveCodeUploadParamsAddressesResponseAminoMsg { + type: "wasm/MsgRemoveCodeUploadParamsAddressesResponse"; + value: MsgRemoveCodeUploadParamsAddressesResponseAmino; +} +/** + * MsgRemoveCodeUploadParamsAddressesResponse defines the response + * structure for executing a MsgRemoveCodeUploadParamsAddresses message. + */ +export interface MsgRemoveCodeUploadParamsAddressesResponseSDKType {} +/** + * MsgStoreAndMigrateContract is the MsgStoreAndMigrateContract + * request type. + * + * Since: 0.42 + */ +export interface MsgStoreAndMigrateContract { + /** Authority is the address of the governance account. */ + authority: string; + /** WASMByteCode can be raw or gzip compressed */ + wasmByteCode: Uint8Array; + /** InstantiatePermission to apply on contract creation, optional */ + instantiatePermission?: AccessConfig; + /** Contract is the address of the smart contract */ + contract: string; + /** Msg json encoded message to be passed to the contract on migration */ + msg: Uint8Array; +} +export interface MsgStoreAndMigrateContractProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract"; + value: Uint8Array; +} +/** + * MsgStoreAndMigrateContract is the MsgStoreAndMigrateContract + * request type. + * + * Since: 0.42 + */ +export interface MsgStoreAndMigrateContractAmino { + /** Authority is the address of the governance account. */ + authority?: string; + /** WASMByteCode can be raw or gzip compressed */ + wasm_byte_code?: string; + /** InstantiatePermission to apply on contract creation, optional */ + instantiate_permission?: AccessConfigAmino; + /** Contract is the address of the smart contract */ + contract?: string; + /** Msg json encoded message to be passed to the contract on migration */ + msg?: any; +} +export interface MsgStoreAndMigrateContractAminoMsg { + type: "wasm/MsgStoreAndMigrateContract"; + value: MsgStoreAndMigrateContractAmino; +} +/** + * MsgStoreAndMigrateContract is the MsgStoreAndMigrateContract + * request type. + * + * Since: 0.42 + */ +export interface MsgStoreAndMigrateContractSDKType { + authority: string; + wasm_byte_code: Uint8Array; + instantiate_permission?: AccessConfigSDKType; + contract: string; + msg: Uint8Array; +} +/** + * MsgStoreAndMigrateContractResponse defines the response structure + * for executing a MsgStoreAndMigrateContract message. + * + * Since: 0.42 + */ +export interface MsgStoreAndMigrateContractResponse { + /** CodeID is the reference to the stored WASM code */ + codeId: bigint; + /** Checksum is the sha256 hash of the stored code */ + checksum: Uint8Array; + /** Data contains bytes to returned from the contract */ + data: Uint8Array; +} +export interface MsgStoreAndMigrateContractResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContractResponse"; + value: Uint8Array; +} +/** + * MsgStoreAndMigrateContractResponse defines the response structure + * for executing a MsgStoreAndMigrateContract message. + * + * Since: 0.42 + */ +export interface MsgStoreAndMigrateContractResponseAmino { + /** CodeID is the reference to the stored WASM code */ + code_id?: string; + /** Checksum is the sha256 hash of the stored code */ + checksum?: string; + /** Data contains bytes to returned from the contract */ + data?: string; +} +export interface MsgStoreAndMigrateContractResponseAminoMsg { + type: "wasm/MsgStoreAndMigrateContractResponse"; + value: MsgStoreAndMigrateContractResponseAmino; +} +/** + * MsgStoreAndMigrateContractResponse defines the response structure + * for executing a MsgStoreAndMigrateContract message. + * + * Since: 0.42 + */ +export interface MsgStoreAndMigrateContractResponseSDKType { + code_id: bigint; + checksum: Uint8Array; + data: Uint8Array; +} +/** MsgUpdateContractLabel sets a new label for a smart contract */ +export interface MsgUpdateContractLabel { + /** Sender is the that actor that signed the messages */ + sender: string; + /** NewLabel string to be set */ + newLabel: string; + /** Contract is the address of the smart contract */ + contract: string; +} +export interface MsgUpdateContractLabelProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabel"; + value: Uint8Array; +} +/** MsgUpdateContractLabel sets a new label for a smart contract */ +export interface MsgUpdateContractLabelAmino { + /** Sender is the that actor that signed the messages */ + sender?: string; + /** NewLabel string to be set */ + new_label?: string; + /** Contract is the address of the smart contract */ + contract?: string; +} +export interface MsgUpdateContractLabelAminoMsg { + type: "wasm/MsgUpdateContractLabel"; + value: MsgUpdateContractLabelAmino; +} +/** MsgUpdateContractLabel sets a new label for a smart contract */ +export interface MsgUpdateContractLabelSDKType { + sender: string; + new_label: string; + contract: string; +} +/** MsgUpdateContractLabelResponse returns empty data */ +export interface MsgUpdateContractLabelResponse {} +export interface MsgUpdateContractLabelResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabelResponse"; + value: Uint8Array; +} +/** MsgUpdateContractLabelResponse returns empty data */ +export interface MsgUpdateContractLabelResponseAmino {} +export interface MsgUpdateContractLabelResponseAminoMsg { + type: "wasm/MsgUpdateContractLabelResponse"; + value: MsgUpdateContractLabelResponseAmino; +} +/** MsgUpdateContractLabelResponse returns empty data */ +export interface MsgUpdateContractLabelResponseSDKType {} +/** MsgSetGasLessContracts set smart contracts are gasless */ +export interface MsgSetGaslessContracts { + /** Authority is the address of the governance account. */ + authority: string; + /** Contracts are the addresses of the smart contracts */ + contracts: string[]; +} +export interface MsgSetGaslessContractsProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgSetGaslessContracts"; + value: Uint8Array; +} +/** MsgSetGasLessContracts set smart contracts are gasless */ +export interface MsgSetGaslessContractsAmino { + /** Authority is the address of the governance account. */ + authority?: string; + /** Contracts are the addresses of the smart contracts */ + contracts?: string[]; +} +export interface MsgSetGaslessContractsAminoMsg { + type: "wasm/MsgSetGaslessContracts"; + value: MsgSetGaslessContractsAmino; +} +/** MsgSetGasLessContracts set smart contracts are gasless */ +export interface MsgSetGaslessContractsSDKType { + authority: string; + contracts: string[]; +} +/** MsgSetGaslessContractsResponse returns empty data */ +export interface MsgSetGaslessContractsResponse {} +export interface MsgSetGaslessContractsResponseProtoMsg { + typeUrl: "/cosmwasm.wasm.v1.MsgSetGaslessContractsResponse"; + value: Uint8Array; +} +/** MsgSetGaslessContractsResponse returns empty data */ +export interface MsgSetGaslessContractsResponseAmino {} +export interface MsgSetGaslessContractsResponseAminoMsg { + type: "wasm/MsgSetGaslessContractsResponse"; + value: MsgSetGaslessContractsResponseAmino; +} +/** MsgSetGaslessContractsResponse returns empty data */ +export interface MsgSetGaslessContractsResponseSDKType {} +function createBaseMsgStoreCode(): MsgStoreCode { + return { + sender: "", + wasmByteCode: new Uint8Array(), + instantiatePermission: undefined + }; +} +export const MsgStoreCode = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode", + encode(message: MsgStoreCode, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.wasmByteCode.length !== 0) { + writer.uint32(18).bytes(message.wasmByteCode); + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreCode { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStoreCode(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.wasmByteCode = reader.bytes(); + break; + case 5: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgStoreCode { + const message = createBaseMsgStoreCode(); + message.sender = object.sender ?? ""; + message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); + message.instantiatePermission = object.instantiatePermission !== undefined && object.instantiatePermission !== null ? AccessConfig.fromPartial(object.instantiatePermission) : undefined; + return message; + }, + fromAmino(object: MsgStoreCodeAmino): MsgStoreCode { + const message = createBaseMsgStoreCode(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { + message.wasmByteCode = fromBase64(object.wasm_byte_code); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); + } + return message; + }, + toAmino(message: MsgStoreCode): MsgStoreCodeAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.wasm_byte_code = message.wasmByteCode ? toBase64(message.wasmByteCode) : undefined; + obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : undefined; + return obj; + }, + fromAminoMsg(object: MsgStoreCodeAminoMsg): MsgStoreCode { + return MsgStoreCode.fromAmino(object.value); + }, + toAminoMsg(message: MsgStoreCode): MsgStoreCodeAminoMsg { + return { + type: "wasm/MsgStoreCode", + value: MsgStoreCode.toAmino(message) + }; + }, + fromProtoMsg(message: MsgStoreCodeProtoMsg): MsgStoreCode { + return MsgStoreCode.decode(message.value); + }, + toProto(message: MsgStoreCode): Uint8Array { + return MsgStoreCode.encode(message).finish(); + }, + toProtoMsg(message: MsgStoreCode): MsgStoreCodeProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode", + value: MsgStoreCode.encode(message).finish() + }; + } +}; +function createBaseMsgStoreCodeResponse(): MsgStoreCodeResponse { + return { + codeId: BigInt(0), + checksum: new Uint8Array() + }; +} +export const MsgStoreCodeResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCodeResponse", + encode(message: MsgStoreCodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + if (message.checksum.length !== 0) { + writer.uint32(18).bytes(message.checksum); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreCodeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStoreCodeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64(); + break; + case 2: + message.checksum = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgStoreCodeResponse { + const message = createBaseMsgStoreCodeResponse(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.checksum = object.checksum ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgStoreCodeResponseAmino): MsgStoreCodeResponse { + const message = createBaseMsgStoreCodeResponse(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.checksum !== undefined && object.checksum !== null) { + message.checksum = bytesFromBase64(object.checksum); + } + return message; + }, + toAmino(message: MsgStoreCodeResponse): MsgStoreCodeResponseAmino { + const obj: any = {}; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + obj.checksum = message.checksum ? base64FromBytes(message.checksum) : undefined; + return obj; + }, + fromAminoMsg(object: MsgStoreCodeResponseAminoMsg): MsgStoreCodeResponse { + return MsgStoreCodeResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgStoreCodeResponse): MsgStoreCodeResponseAminoMsg { + return { + type: "wasm/MsgStoreCodeResponse", + value: MsgStoreCodeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgStoreCodeResponseProtoMsg): MsgStoreCodeResponse { + return MsgStoreCodeResponse.decode(message.value); + }, + toProto(message: MsgStoreCodeResponse): Uint8Array { + return MsgStoreCodeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgStoreCodeResponse): MsgStoreCodeResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreCodeResponse", + value: MsgStoreCodeResponse.encode(message).finish() + }; + } +}; +function createBaseMsgInstantiateContract(): MsgInstantiateContract { + return { + sender: "", + admin: "", + codeId: BigInt(0), + label: "", + msg: new Uint8Array(), + funds: [] + }; +} +export const MsgInstantiateContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract", + encode(message: MsgInstantiateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.admin !== "") { + writer.uint32(18).string(message.admin); + } + if (message.codeId !== BigInt(0)) { + writer.uint32(24).uint64(message.codeId); + } + if (message.label !== "") { + writer.uint32(34).string(message.label); + } + if (message.msg.length !== 0) { + writer.uint32(42).bytes(message.msg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantiateContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantiateContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.admin = reader.string(); + break; + case 3: + message.codeId = reader.uint64(); + break; + case 4: + message.label = reader.string(); + break; + case 5: + message.msg = reader.bytes(); + break; + case 6: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgInstantiateContract { + const message = createBaseMsgInstantiateContract(); + message.sender = object.sender ?? ""; + message.admin = object.admin ?? ""; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.label = object.label ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgInstantiateContractAmino): MsgInstantiateContract { + const message = createBaseMsgInstantiateContract(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgInstantiateContract): MsgInstantiateContractAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + obj.label = message.label === "" ? undefined : message.label; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.funds = message.funds; + } + return obj; + }, + fromAminoMsg(object: MsgInstantiateContractAminoMsg): MsgInstantiateContract { + return MsgInstantiateContract.fromAmino(object.value); + }, + toAminoMsg(message: MsgInstantiateContract): MsgInstantiateContractAminoMsg { + return { + type: "wasm/MsgInstantiateContract", + value: MsgInstantiateContract.toAmino(message) + }; + }, + fromProtoMsg(message: MsgInstantiateContractProtoMsg): MsgInstantiateContract { + return MsgInstantiateContract.decode(message.value); + }, + toProto(message: MsgInstantiateContract): Uint8Array { + return MsgInstantiateContract.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantiateContract): MsgInstantiateContractProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract", + value: MsgInstantiateContract.encode(message).finish() + }; + } +}; +function createBaseMsgInstantiateContractResponse(): MsgInstantiateContractResponse { + return { + address: "", + data: new Uint8Array() + }; +} +export const MsgInstantiateContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContractResponse", + encode(message: MsgInstantiateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantiateContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantiateContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgInstantiateContractResponse { + const message = createBaseMsgInstantiateContractResponse(); + message.address = object.address ?? ""; + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgInstantiateContractResponseAmino): MsgInstantiateContractResponse { + const message = createBaseMsgInstantiateContractResponse(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: MsgInstantiateContractResponse): MsgInstantiateContractResponseAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: MsgInstantiateContractResponseAminoMsg): MsgInstantiateContractResponse { + return MsgInstantiateContractResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgInstantiateContractResponse): MsgInstantiateContractResponseAminoMsg { + return { + type: "wasm/MsgInstantiateContractResponse", + value: MsgInstantiateContractResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgInstantiateContractResponseProtoMsg): MsgInstantiateContractResponse { + return MsgInstantiateContractResponse.decode(message.value); + }, + toProto(message: MsgInstantiateContractResponse): Uint8Array { + return MsgInstantiateContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantiateContractResponse): MsgInstantiateContractResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContractResponse", + value: MsgInstantiateContractResponse.encode(message).finish() + }; + } +}; +function createBaseMsgInstantiateContract2(): MsgInstantiateContract2 { + return { + sender: "", + admin: "", + codeId: BigInt(0), + label: "", + msg: new Uint8Array(), + funds: [], + salt: new Uint8Array(), + fixMsg: false + }; +} +export const MsgInstantiateContract2 = { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2", + encode(message: MsgInstantiateContract2, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.admin !== "") { + writer.uint32(18).string(message.admin); + } + if (message.codeId !== BigInt(0)) { + writer.uint32(24).uint64(message.codeId); + } if (message.label !== "") { writer.uint32(34).string(message.label); } if (message.msg.length !== 0) { - writer.uint32(42).bytes(message.msg); + writer.uint32(42).bytes(message.msg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(50).fork()).ldelim(); + } + if (message.salt.length !== 0) { + writer.uint32(58).bytes(message.salt); + } + if (message.fixMsg === true) { + writer.uint32(64).bool(message.fixMsg); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantiateContract2 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantiateContract2(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.admin = reader.string(); + break; + case 3: + message.codeId = reader.uint64(); + break; + case 4: + message.label = reader.string(); + break; + case 5: + message.msg = reader.bytes(); + break; + case 6: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + case 7: + message.salt = reader.bytes(); + break; + case 8: + message.fixMsg = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgInstantiateContract2 { + const message = createBaseMsgInstantiateContract2(); + message.sender = object.sender ?? ""; + message.admin = object.admin ?? ""; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.label = object.label ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; + message.salt = object.salt ?? new Uint8Array(); + message.fixMsg = object.fixMsg ?? false; + return message; + }, + fromAmino(object: MsgInstantiateContract2Amino): MsgInstantiateContract2 { + const message = createBaseMsgInstantiateContract2(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + if (object.salt !== undefined && object.salt !== null) { + message.salt = bytesFromBase64(object.salt); + } + if (object.fix_msg !== undefined && object.fix_msg !== null) { + message.fixMsg = object.fix_msg; + } + return message; + }, + toAmino(message: MsgInstantiateContract2): MsgInstantiateContract2Amino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + obj.label = message.label === "" ? undefined : message.label; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.funds = message.funds; + } + obj.salt = message.salt ? base64FromBytes(message.salt) : undefined; + obj.fix_msg = message.fixMsg === false ? undefined : message.fixMsg; + return obj; + }, + fromAminoMsg(object: MsgInstantiateContract2AminoMsg): MsgInstantiateContract2 { + return MsgInstantiateContract2.fromAmino(object.value); + }, + toAminoMsg(message: MsgInstantiateContract2): MsgInstantiateContract2AminoMsg { + return { + type: "wasm/MsgInstantiateContract2", + value: MsgInstantiateContract2.toAmino(message) + }; + }, + fromProtoMsg(message: MsgInstantiateContract2ProtoMsg): MsgInstantiateContract2 { + return MsgInstantiateContract2.decode(message.value); + }, + toProto(message: MsgInstantiateContract2): Uint8Array { + return MsgInstantiateContract2.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantiateContract2): MsgInstantiateContract2ProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2", + value: MsgInstantiateContract2.encode(message).finish() + }; + } +}; +function createBaseMsgInstantiateContract2Response(): MsgInstantiateContract2Response { + return { + address: "", + data: new Uint8Array() + }; +} +export const MsgInstantiateContract2Response = { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2Response", + encode(message: MsgInstantiateContract2Response, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantiateContract2Response { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgInstantiateContract2Response(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgInstantiateContract2Response { + const message = createBaseMsgInstantiateContract2Response(); + message.address = object.address ?? ""; + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgInstantiateContract2ResponseAmino): MsgInstantiateContract2Response { + const message = createBaseMsgInstantiateContract2Response(); + if (object.address !== undefined && object.address !== null) { + message.address = object.address; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: MsgInstantiateContract2Response): MsgInstantiateContract2ResponseAmino { + const obj: any = {}; + obj.address = message.address === "" ? undefined : message.address; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: MsgInstantiateContract2ResponseAminoMsg): MsgInstantiateContract2Response { + return MsgInstantiateContract2Response.fromAmino(object.value); + }, + toAminoMsg(message: MsgInstantiateContract2Response): MsgInstantiateContract2ResponseAminoMsg { + return { + type: "wasm/MsgInstantiateContract2Response", + value: MsgInstantiateContract2Response.toAmino(message) + }; + }, + fromProtoMsg(message: MsgInstantiateContract2ResponseProtoMsg): MsgInstantiateContract2Response { + return MsgInstantiateContract2Response.decode(message.value); + }, + toProto(message: MsgInstantiateContract2Response): Uint8Array { + return MsgInstantiateContract2Response.encode(message).finish(); + }, + toProtoMsg(message: MsgInstantiateContract2Response): MsgInstantiateContract2ResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2Response", + value: MsgInstantiateContract2Response.encode(message).finish() + }; + } +}; +function createBaseMsgExecuteContract(): MsgExecuteContract { + return { + sender: "", + contract: "", + msg: new Uint8Array(), + funds: [] + }; +} +export const MsgExecuteContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + encode(message: MsgExecuteContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contract !== "") { + writer.uint32(18).string(message.contract); + } + if (message.msg.length !== 0) { + writer.uint32(26).bytes(message.msg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(42).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgExecuteContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExecuteContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.contract = reader.string(); + break; + case 3: + message.msg = reader.bytes(); + break; + case 5: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgExecuteContract { + const message = createBaseMsgExecuteContract(); + message.sender = object.sender ?? ""; + message.contract = object.contract ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgExecuteContractAmino): MsgExecuteContract { + const message = createBaseMsgExecuteContract(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgExecuteContract): MsgExecuteContractAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.contract = message.contract === "" ? undefined : message.contract; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.funds = message.funds; + } + return obj; + }, + fromAminoMsg(object: MsgExecuteContractAminoMsg): MsgExecuteContract { + return MsgExecuteContract.fromAmino(object.value); + }, + toAminoMsg(message: MsgExecuteContract): MsgExecuteContractAminoMsg { + return { + type: "wasm/MsgExecuteContract", + value: MsgExecuteContract.toAmino(message) + }; + }, + fromProtoMsg(message: MsgExecuteContractProtoMsg): MsgExecuteContract { + return MsgExecuteContract.decode(message.value); + }, + toProto(message: MsgExecuteContract): Uint8Array { + return MsgExecuteContract.encode(message).finish(); + }, + toProtoMsg(message: MsgExecuteContract): MsgExecuteContractProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", + value: MsgExecuteContract.encode(message).finish() + }; + } +}; +function createBaseMsgExecuteContractResponse(): MsgExecuteContractResponse { + return { + data: new Uint8Array() + }; +} +export const MsgExecuteContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContractResponse", + encode(message: MsgExecuteContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgExecuteContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExecuteContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgExecuteContractResponse { + const message = createBaseMsgExecuteContractResponse(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgExecuteContractResponseAmino): MsgExecuteContractResponse { + const message = createBaseMsgExecuteContractResponse(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: MsgExecuteContractResponse): MsgExecuteContractResponseAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: MsgExecuteContractResponseAminoMsg): MsgExecuteContractResponse { + return MsgExecuteContractResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgExecuteContractResponse): MsgExecuteContractResponseAminoMsg { + return { + type: "wasm/MsgExecuteContractResponse", + value: MsgExecuteContractResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgExecuteContractResponseProtoMsg): MsgExecuteContractResponse { + return MsgExecuteContractResponse.decode(message.value); + }, + toProto(message: MsgExecuteContractResponse): Uint8Array { + return MsgExecuteContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgExecuteContractResponse): MsgExecuteContractResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContractResponse", + value: MsgExecuteContractResponse.encode(message).finish() + }; + } +}; +function createBaseMsgMigrateContract(): MsgMigrateContract { + return { + sender: "", + contract: "", + codeId: BigInt(0), + msg: new Uint8Array() + }; +} +export const MsgMigrateContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract", + encode(message: MsgMigrateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contract !== "") { + writer.uint32(18).string(message.contract); + } + if (message.codeId !== BigInt(0)) { + writer.uint32(24).uint64(message.codeId); + } + if (message.msg.length !== 0) { + writer.uint32(34).bytes(message.msg); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgMigrateContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMigrateContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.contract = reader.string(); + break; + case 3: + message.codeId = reader.uint64(); + break; + case 4: + message.msg = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgMigrateContract { + const message = createBaseMsgMigrateContract(); + message.sender = object.sender ?? ""; + message.contract = object.contract ?? ""; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.msg = object.msg ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgMigrateContractAmino): MsgMigrateContract { + const message = createBaseMsgMigrateContract(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + return message; + }, + toAmino(message: MsgMigrateContract): MsgMigrateContractAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.contract = message.contract === "" ? undefined : message.contract; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + return obj; + }, + fromAminoMsg(object: MsgMigrateContractAminoMsg): MsgMigrateContract { + return MsgMigrateContract.fromAmino(object.value); + }, + toAminoMsg(message: MsgMigrateContract): MsgMigrateContractAminoMsg { + return { + type: "wasm/MsgMigrateContract", + value: MsgMigrateContract.toAmino(message) + }; + }, + fromProtoMsg(message: MsgMigrateContractProtoMsg): MsgMigrateContract { + return MsgMigrateContract.decode(message.value); + }, + toProto(message: MsgMigrateContract): Uint8Array { + return MsgMigrateContract.encode(message).finish(); + }, + toProtoMsg(message: MsgMigrateContract): MsgMigrateContractProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract", + value: MsgMigrateContract.encode(message).finish() + }; + } +}; +function createBaseMsgMigrateContractResponse(): MsgMigrateContractResponse { + return { + data: new Uint8Array() + }; +} +export const MsgMigrateContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContractResponse", + encode(message: MsgMigrateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgMigrateContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMigrateContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgMigrateContractResponse { + const message = createBaseMsgMigrateContractResponse(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgMigrateContractResponseAmino): MsgMigrateContractResponse { + const message = createBaseMsgMigrateContractResponse(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: MsgMigrateContractResponse): MsgMigrateContractResponseAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: MsgMigrateContractResponseAminoMsg): MsgMigrateContractResponse { + return MsgMigrateContractResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgMigrateContractResponse): MsgMigrateContractResponseAminoMsg { + return { + type: "wasm/MsgMigrateContractResponse", + value: MsgMigrateContractResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgMigrateContractResponseProtoMsg): MsgMigrateContractResponse { + return MsgMigrateContractResponse.decode(message.value); + }, + toProto(message: MsgMigrateContractResponse): Uint8Array { + return MsgMigrateContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgMigrateContractResponse): MsgMigrateContractResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContractResponse", + value: MsgMigrateContractResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateAdmin(): MsgUpdateAdmin { + return { + sender: "", + newAdmin: "", + contract: "" + }; +} +export const MsgUpdateAdmin = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin", + encode(message: MsgUpdateAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.newAdmin !== "") { + writer.uint32(18).string(message.newAdmin); + } + if (message.contract !== "") { + writer.uint32(26).string(message.contract); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateAdmin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateAdmin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.newAdmin = reader.string(); + break; + case 3: + message.contract = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateAdmin { + const message = createBaseMsgUpdateAdmin(); + message.sender = object.sender ?? ""; + message.newAdmin = object.newAdmin ?? ""; + message.contract = object.contract ?? ""; + return message; + }, + fromAmino(object: MsgUpdateAdminAmino): MsgUpdateAdmin { + const message = createBaseMsgUpdateAdmin(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.new_admin !== undefined && object.new_admin !== null) { + message.newAdmin = object.new_admin; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + return message; + }, + toAmino(message: MsgUpdateAdmin): MsgUpdateAdminAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.new_admin = message.newAdmin === "" ? undefined : message.newAdmin; + obj.contract = message.contract === "" ? undefined : message.contract; + return obj; + }, + fromAminoMsg(object: MsgUpdateAdminAminoMsg): MsgUpdateAdmin { + return MsgUpdateAdmin.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateAdmin): MsgUpdateAdminAminoMsg { + return { + type: "wasm/MsgUpdateAdmin", + value: MsgUpdateAdmin.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateAdminProtoMsg): MsgUpdateAdmin { + return MsgUpdateAdmin.decode(message.value); + }, + toProto(message: MsgUpdateAdmin): Uint8Array { + return MsgUpdateAdmin.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateAdmin): MsgUpdateAdminProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin", + value: MsgUpdateAdmin.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateAdminResponse(): MsgUpdateAdminResponse { + return {}; +} +export const MsgUpdateAdminResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdminResponse", + encode(_: MsgUpdateAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateAdminResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateAdminResponse { + const message = createBaseMsgUpdateAdminResponse(); + return message; + }, + fromAmino(_: MsgUpdateAdminResponseAmino): MsgUpdateAdminResponse { + const message = createBaseMsgUpdateAdminResponse(); + return message; + }, + toAmino(_: MsgUpdateAdminResponse): MsgUpdateAdminResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateAdminResponseAminoMsg): MsgUpdateAdminResponse { + return MsgUpdateAdminResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateAdminResponse): MsgUpdateAdminResponseAminoMsg { + return { + type: "wasm/MsgUpdateAdminResponse", + value: MsgUpdateAdminResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateAdminResponseProtoMsg): MsgUpdateAdminResponse { + return MsgUpdateAdminResponse.decode(message.value); + }, + toProto(message: MsgUpdateAdminResponse): Uint8Array { + return MsgUpdateAdminResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateAdminResponse): MsgUpdateAdminResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdminResponse", + value: MsgUpdateAdminResponse.encode(message).finish() + }; + } +}; +function createBaseMsgClearAdmin(): MsgClearAdmin { + return { + sender: "", + contract: "" + }; +} +export const MsgClearAdmin = { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin", + encode(message: MsgClearAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.contract !== "") { + writer.uint32(26).string(message.contract); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgClearAdmin { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgClearAdmin(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 3: + message.contract = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgClearAdmin { + const message = createBaseMsgClearAdmin(); + message.sender = object.sender ?? ""; + message.contract = object.contract ?? ""; + return message; + }, + fromAmino(object: MsgClearAdminAmino): MsgClearAdmin { + const message = createBaseMsgClearAdmin(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + return message; + }, + toAmino(message: MsgClearAdmin): MsgClearAdminAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.contract = message.contract === "" ? undefined : message.contract; + return obj; + }, + fromAminoMsg(object: MsgClearAdminAminoMsg): MsgClearAdmin { + return MsgClearAdmin.fromAmino(object.value); + }, + toAminoMsg(message: MsgClearAdmin): MsgClearAdminAminoMsg { + return { + type: "wasm/MsgClearAdmin", + value: MsgClearAdmin.toAmino(message) + }; + }, + fromProtoMsg(message: MsgClearAdminProtoMsg): MsgClearAdmin { + return MsgClearAdmin.decode(message.value); + }, + toProto(message: MsgClearAdmin): Uint8Array { + return MsgClearAdmin.encode(message).finish(); + }, + toProtoMsg(message: MsgClearAdmin): MsgClearAdminProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin", + value: MsgClearAdmin.encode(message).finish() + }; + } +}; +function createBaseMsgClearAdminResponse(): MsgClearAdminResponse { + return {}; +} +export const MsgClearAdminResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdminResponse", + encode(_: MsgClearAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgClearAdminResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgClearAdminResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgClearAdminResponse { + const message = createBaseMsgClearAdminResponse(); + return message; + }, + fromAmino(_: MsgClearAdminResponseAmino): MsgClearAdminResponse { + const message = createBaseMsgClearAdminResponse(); + return message; + }, + toAmino(_: MsgClearAdminResponse): MsgClearAdminResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgClearAdminResponseAminoMsg): MsgClearAdminResponse { + return MsgClearAdminResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgClearAdminResponse): MsgClearAdminResponseAminoMsg { + return { + type: "wasm/MsgClearAdminResponse", + value: MsgClearAdminResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgClearAdminResponseProtoMsg): MsgClearAdminResponse { + return MsgClearAdminResponse.decode(message.value); + }, + toProto(message: MsgClearAdminResponse): Uint8Array { + return MsgClearAdminResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgClearAdminResponse): MsgClearAdminResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgClearAdminResponse", + value: MsgClearAdminResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateInstantiateConfig(): MsgUpdateInstantiateConfig { + return { + sender: "", + codeId: BigInt(0), + newInstantiatePermission: undefined + }; +} +export const MsgUpdateInstantiateConfig = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", + encode(message: MsgUpdateInstantiateConfig, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + if (message.codeId !== BigInt(0)) { + writer.uint32(16).uint64(message.codeId); + } + if (message.newInstantiatePermission !== undefined) { + AccessConfig.encode(message.newInstantiatePermission, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateInstantiateConfig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateInstantiateConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + case 2: + message.codeId = reader.uint64(); + break; + case 3: + message.newInstantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateInstantiateConfig { + const message = createBaseMsgUpdateInstantiateConfig(); + message.sender = object.sender ?? ""; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.newInstantiatePermission = object.newInstantiatePermission !== undefined && object.newInstantiatePermission !== null ? AccessConfig.fromPartial(object.newInstantiatePermission) : undefined; + return message; + }, + fromAmino(object: MsgUpdateInstantiateConfigAmino): MsgUpdateInstantiateConfig { + const message = createBaseMsgUpdateInstantiateConfig(); + if (object.sender !== undefined && object.sender !== null) { + message.sender = object.sender; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.new_instantiate_permission !== undefined && object.new_instantiate_permission !== null) { + message.newInstantiatePermission = AccessConfig.fromAmino(object.new_instantiate_permission); + } + return message; + }, + toAmino(message: MsgUpdateInstantiateConfig): MsgUpdateInstantiateConfigAmino { + const obj: any = {}; + obj.sender = message.sender === "" ? undefined : message.sender; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + obj.new_instantiate_permission = message.newInstantiatePermission ? AccessConfig.toAmino(message.newInstantiatePermission) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateInstantiateConfigAminoMsg): MsgUpdateInstantiateConfig { + return MsgUpdateInstantiateConfig.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateInstantiateConfig): MsgUpdateInstantiateConfigAminoMsg { + return { + type: "wasm/MsgUpdateInstantiateConfig", + value: MsgUpdateInstantiateConfig.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateInstantiateConfigProtoMsg): MsgUpdateInstantiateConfig { + return MsgUpdateInstantiateConfig.decode(message.value); + }, + toProto(message: MsgUpdateInstantiateConfig): Uint8Array { + return MsgUpdateInstantiateConfig.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateInstantiateConfig): MsgUpdateInstantiateConfigProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", + value: MsgUpdateInstantiateConfig.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateInstantiateConfigResponse(): MsgUpdateInstantiateConfigResponse { + return {}; +} +export const MsgUpdateInstantiateConfigResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfigResponse", + encode(_: MsgUpdateInstantiateConfigResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateInstantiateConfigResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateInstantiateConfigResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateInstantiateConfigResponse { + const message = createBaseMsgUpdateInstantiateConfigResponse(); + return message; + }, + fromAmino(_: MsgUpdateInstantiateConfigResponseAmino): MsgUpdateInstantiateConfigResponse { + const message = createBaseMsgUpdateInstantiateConfigResponse(); + return message; + }, + toAmino(_: MsgUpdateInstantiateConfigResponse): MsgUpdateInstantiateConfigResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateInstantiateConfigResponseAminoMsg): MsgUpdateInstantiateConfigResponse { + return MsgUpdateInstantiateConfigResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateInstantiateConfigResponse): MsgUpdateInstantiateConfigResponseAminoMsg { + return { + type: "wasm/MsgUpdateInstantiateConfigResponse", + value: MsgUpdateInstantiateConfigResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateInstantiateConfigResponseProtoMsg): MsgUpdateInstantiateConfigResponse { + return MsgUpdateInstantiateConfigResponse.decode(message.value); + }, + toProto(message: MsgUpdateInstantiateConfigResponse): Uint8Array { + return MsgUpdateInstantiateConfigResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateInstantiateConfigResponse): MsgUpdateInstantiateConfigResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfigResponse", + value: MsgUpdateInstantiateConfigResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.params = message.params ? Params.toAmino(message.params) : Params.toAmino(Params.fromPartial({})); + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "wasm/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "wasm/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSudoContract(): MsgSudoContract { + return { + authority: "", + contract: "", + msg: new Uint8Array() + }; +} +export const MsgSudoContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract", + encode(message: MsgSudoContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.contract !== "") { + writer.uint32(18).string(message.contract); + } + if (message.msg.length !== 0) { + writer.uint32(26).bytes(message.msg); } - for (const v of message.funds) { - Coin.encode(v!, writer.uint32(50).fork()).ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSudoContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSudoContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.contract = reader.string(); + break; + case 3: + message.msg = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSudoContract { + const message = createBaseMsgSudoContract(); + message.authority = object.authority ?? ""; + message.contract = object.contract ?? ""; + message.msg = object.msg ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgSudoContractAmino): MsgSudoContract { + const message = createBaseMsgSudoContract(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + return message; + }, + toAmino(message: MsgSudoContract): MsgSudoContractAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.contract = message.contract === "" ? undefined : message.contract; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + return obj; + }, + fromAminoMsg(object: MsgSudoContractAminoMsg): MsgSudoContract { + return MsgSudoContract.fromAmino(object.value); + }, + toAminoMsg(message: MsgSudoContract): MsgSudoContractAminoMsg { + return { + type: "wasm/MsgSudoContract", + value: MsgSudoContract.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSudoContractProtoMsg): MsgSudoContract { + return MsgSudoContract.decode(message.value); + }, + toProto(message: MsgSudoContract): Uint8Array { + return MsgSudoContract.encode(message).finish(); + }, + toProtoMsg(message: MsgSudoContract): MsgSudoContractProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContract", + value: MsgSudoContract.encode(message).finish() + }; + } +}; +function createBaseMsgSudoContractResponse(): MsgSudoContractResponse { + return { + data: new Uint8Array() + }; +} +export const MsgSudoContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContractResponse", + encode(message: MsgSudoContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantiateContract { + decode(input: BinaryReader | Uint8Array, length?: number): MsgSudoContractResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgInstantiateContract(); + const message = createBaseMsgSudoContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSudoContractResponse { + const message = createBaseMsgSudoContractResponse(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgSudoContractResponseAmino): MsgSudoContractResponse { + const message = createBaseMsgSudoContractResponse(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: MsgSudoContractResponse): MsgSudoContractResponseAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: MsgSudoContractResponseAminoMsg): MsgSudoContractResponse { + return MsgSudoContractResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSudoContractResponse): MsgSudoContractResponseAminoMsg { + return { + type: "wasm/MsgSudoContractResponse", + value: MsgSudoContractResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSudoContractResponseProtoMsg): MsgSudoContractResponse { + return MsgSudoContractResponse.decode(message.value); + }, + toProto(message: MsgSudoContractResponse): Uint8Array { + return MsgSudoContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSudoContractResponse): MsgSudoContractResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgSudoContractResponse", + value: MsgSudoContractResponse.encode(message).finish() + }; + } +}; +function createBaseMsgPinCodes(): MsgPinCodes { + return { + authority: "", + codeIds: [] + }; +} +export const MsgPinCodes = { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes", + encode(message: MsgPinCodes, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + writer.uint32(18).fork(); + for (const v of message.codeIds) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgPinCodes { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPinCodes(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.codeIds.push(reader.uint64()); + } + } else { + message.codeIds.push(reader.uint64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgPinCodes { + const message = createBaseMsgPinCodes(); + message.authority = object.authority ?? ""; + message.codeIds = object.codeIds?.map(e => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: MsgPinCodesAmino): MsgPinCodes { + const message = createBaseMsgPinCodes(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + message.codeIds = object.code_ids?.map(e => BigInt(e)) || []; + return message; + }, + toAmino(message: MsgPinCodes): MsgPinCodesAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + if (message.codeIds) { + obj.code_ids = message.codeIds.map(e => e.toString()); + } else { + obj.code_ids = message.codeIds; + } + return obj; + }, + fromAminoMsg(object: MsgPinCodesAminoMsg): MsgPinCodes { + return MsgPinCodes.fromAmino(object.value); + }, + toAminoMsg(message: MsgPinCodes): MsgPinCodesAminoMsg { + return { + type: "wasm/MsgPinCodes", + value: MsgPinCodes.toAmino(message) + }; + }, + fromProtoMsg(message: MsgPinCodesProtoMsg): MsgPinCodes { + return MsgPinCodes.decode(message.value); + }, + toProto(message: MsgPinCodes): Uint8Array { + return MsgPinCodes.encode(message).finish(); + }, + toProtoMsg(message: MsgPinCodes): MsgPinCodesProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodes", + value: MsgPinCodes.encode(message).finish() + }; + } +}; +function createBaseMsgPinCodesResponse(): MsgPinCodesResponse { + return {}; +} +export const MsgPinCodesResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodesResponse", + encode(_: MsgPinCodesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgPinCodesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPinCodesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgPinCodesResponse { + const message = createBaseMsgPinCodesResponse(); + return message; + }, + fromAmino(_: MsgPinCodesResponseAmino): MsgPinCodesResponse { + const message = createBaseMsgPinCodesResponse(); + return message; + }, + toAmino(_: MsgPinCodesResponse): MsgPinCodesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgPinCodesResponseAminoMsg): MsgPinCodesResponse { + return MsgPinCodesResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgPinCodesResponse): MsgPinCodesResponseAminoMsg { + return { + type: "wasm/MsgPinCodesResponse", + value: MsgPinCodesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgPinCodesResponseProtoMsg): MsgPinCodesResponse { + return MsgPinCodesResponse.decode(message.value); + }, + toProto(message: MsgPinCodesResponse): Uint8Array { + return MsgPinCodesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgPinCodesResponse): MsgPinCodesResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgPinCodesResponse", + value: MsgPinCodesResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUnpinCodes(): MsgUnpinCodes { + return { + authority: "", + codeIds: [] + }; +} +export const MsgUnpinCodes = { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes", + encode(message: MsgUnpinCodes, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + writer.uint32(18).fork(); + for (const v of message.codeIds) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUnpinCodes { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUnpinCodes(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sender = reader.string(); + message.authority = reader.string(); break; case 2: - message.admin = reader.string(); - break; - case 3: - message.codeId = reader.uint64(); - break; - case 4: - message.label = reader.string(); - break; - case 5: - message.msg = reader.bytes(); - break; - case 6: - message.funds.push(Coin.decode(reader, reader.uint32())); + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.codeIds.push(reader.uint64()); + } + } else { + message.codeIds.push(reader.uint64()); + } break; default: reader.skipType(tag & 7); @@ -746,143 +3158,200 @@ export const MsgInstantiateContract = { } return message; }, - fromPartial(object: Partial): MsgInstantiateContract { - const message = createBaseMsgInstantiateContract(); - message.sender = object.sender ?? ""; - message.admin = object.admin ?? ""; - message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); - message.label = object.label ?? ""; - message.msg = object.msg ?? new Uint8Array(); - message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; + fromPartial(object: Partial): MsgUnpinCodes { + const message = createBaseMsgUnpinCodes(); + message.authority = object.authority ?? ""; + message.codeIds = object.codeIds?.map(e => BigInt(e.toString())) || []; return message; }, - fromAmino(object: MsgInstantiateContractAmino): MsgInstantiateContract { - const message = createBaseMsgInstantiateContract(); - if (object.sender !== undefined && object.sender !== null) { - message.sender = object.sender; - } - if (object.admin !== undefined && object.admin !== null) { - message.admin = object.admin; - } - if (object.code_id !== undefined && object.code_id !== null) { - message.codeId = BigInt(object.code_id); + fromAmino(object: MsgUnpinCodesAmino): MsgUnpinCodes { + const message = createBaseMsgUnpinCodes(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; } - if (object.label !== undefined && object.label !== null) { - message.label = object.label; - } - if (object.msg !== undefined && object.msg !== null) { - message.msg = toUtf8(JSON.stringify(object.msg)); - } - message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + message.codeIds = object.code_ids?.map(e => BigInt(e)) || []; return message; }, - toAmino(message: MsgInstantiateContract): MsgInstantiateContractAmino { + toAmino(message: MsgUnpinCodes): MsgUnpinCodesAmino { const obj: any = {}; - obj.sender = message.sender === "" ? undefined : message.sender; - obj.admin = message.admin === "" ? undefined : message.admin; - obj.code_id = message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; - obj.label = message.label === "" ? undefined : message.label; - obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; - if (message.funds) { - obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); + obj.authority = message.authority === "" ? undefined : message.authority; + if (message.codeIds) { + obj.code_ids = message.codeIds.map(e => e.toString()); } else { - obj.funds = message.funds; + obj.code_ids = message.codeIds; } return obj; }, - fromAminoMsg(object: MsgInstantiateContractAminoMsg): MsgInstantiateContract { - return MsgInstantiateContract.fromAmino(object.value); + fromAminoMsg(object: MsgUnpinCodesAminoMsg): MsgUnpinCodes { + return MsgUnpinCodes.fromAmino(object.value); }, - toAminoMsg(message: MsgInstantiateContract): MsgInstantiateContractAminoMsg { + toAminoMsg(message: MsgUnpinCodes): MsgUnpinCodesAminoMsg { return { - type: "wasm/MsgInstantiateContract", - value: MsgInstantiateContract.toAmino(message) + type: "wasm/MsgUnpinCodes", + value: MsgUnpinCodes.toAmino(message) }; }, - fromProtoMsg(message: MsgInstantiateContractProtoMsg): MsgInstantiateContract { - return MsgInstantiateContract.decode(message.value); + fromProtoMsg(message: MsgUnpinCodesProtoMsg): MsgUnpinCodes { + return MsgUnpinCodes.decode(message.value); }, - toProto(message: MsgInstantiateContract): Uint8Array { - return MsgInstantiateContract.encode(message).finish(); + toProto(message: MsgUnpinCodes): Uint8Array { + return MsgUnpinCodes.encode(message).finish(); }, - toProtoMsg(message: MsgInstantiateContract): MsgInstantiateContractProtoMsg { + toProtoMsg(message: MsgUnpinCodes): MsgUnpinCodesProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract", - value: MsgInstantiateContract.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodes", + value: MsgUnpinCodes.encode(message).finish() }; } }; -function createBaseMsgInstantiateContract2(): MsgInstantiateContract2 { +function createBaseMsgUnpinCodesResponse(): MsgUnpinCodesResponse { + return {}; +} +export const MsgUnpinCodesResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodesResponse", + encode(_: MsgUnpinCodesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUnpinCodesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUnpinCodesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUnpinCodesResponse { + const message = createBaseMsgUnpinCodesResponse(); + return message; + }, + fromAmino(_: MsgUnpinCodesResponseAmino): MsgUnpinCodesResponse { + const message = createBaseMsgUnpinCodesResponse(); + return message; + }, + toAmino(_: MsgUnpinCodesResponse): MsgUnpinCodesResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUnpinCodesResponseAminoMsg): MsgUnpinCodesResponse { + return MsgUnpinCodesResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUnpinCodesResponse): MsgUnpinCodesResponseAminoMsg { + return { + type: "wasm/MsgUnpinCodesResponse", + value: MsgUnpinCodesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUnpinCodesResponseProtoMsg): MsgUnpinCodesResponse { + return MsgUnpinCodesResponse.decode(message.value); + }, + toProto(message: MsgUnpinCodesResponse): Uint8Array { + return MsgUnpinCodesResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUnpinCodesResponse): MsgUnpinCodesResponseProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1.MsgUnpinCodesResponse", + value: MsgUnpinCodesResponse.encode(message).finish() + }; + } +}; +function createBaseMsgStoreAndInstantiateContract(): MsgStoreAndInstantiateContract { return { - sender: "", + authority: "", + wasmByteCode: new Uint8Array(), + instantiatePermission: undefined, + unpinCode: false, admin: "", - codeId: BigInt(0), label: "", msg: new Uint8Array(), funds: [], - salt: new Uint8Array(), - fixMsg: false + source: "", + builder: "", + codeHash: new Uint8Array() }; } -export const MsgInstantiateContract2 = { - typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2", - encode(message: MsgInstantiateContract2, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); +export const MsgStoreAndInstantiateContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", + encode(message: MsgStoreAndInstantiateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); } - if (message.admin !== "") { - writer.uint32(18).string(message.admin); + if (message.wasmByteCode.length !== 0) { + writer.uint32(26).bytes(message.wasmByteCode); } - if (message.codeId !== BigInt(0)) { - writer.uint32(24).uint64(message.codeId); + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(34).fork()).ldelim(); + } + if (message.unpinCode === true) { + writer.uint32(40).bool(message.unpinCode); + } + if (message.admin !== "") { + writer.uint32(50).string(message.admin); } if (message.label !== "") { - writer.uint32(34).string(message.label); + writer.uint32(58).string(message.label); } if (message.msg.length !== 0) { - writer.uint32(42).bytes(message.msg); + writer.uint32(66).bytes(message.msg); } for (const v of message.funds) { - Coin.encode(v!, writer.uint32(50).fork()).ldelim(); + Coin.encode(v!, writer.uint32(74).fork()).ldelim(); } - if (message.salt.length !== 0) { - writer.uint32(58).bytes(message.salt); + if (message.source !== "") { + writer.uint32(82).string(message.source); } - if (message.fixMsg === true) { - writer.uint32(64).bool(message.fixMsg); + if (message.builder !== "") { + writer.uint32(90).string(message.builder); + } + if (message.codeHash.length !== 0) { + writer.uint32(98).bytes(message.codeHash); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantiateContract2 { + decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreAndInstantiateContract { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgInstantiateContract2(); + const message = createBaseMsgStoreAndInstantiateContract(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sender = reader.string(); - break; - case 2: - message.admin = reader.string(); + message.authority = reader.string(); break; case 3: - message.codeId = reader.uint64(); + message.wasmByteCode = reader.bytes(); break; case 4: - message.label = reader.string(); + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); break; case 5: - message.msg = reader.bytes(); + message.unpinCode = reader.bool(); break; case 6: - message.funds.push(Coin.decode(reader, reader.uint32())); + message.admin = reader.string(); break; case 7: - message.salt = reader.bytes(); + message.label = reader.string(); break; case 8: - message.fixMsg = reader.bool(); + message.msg = reader.bytes(); + break; + case 9: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + case 10: + message.source = reader.string(); + break; + case 11: + message.builder = reader.string(); + break; + case 12: + message.codeHash = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -891,29 +3360,38 @@ export const MsgInstantiateContract2 = { } return message; }, - fromPartial(object: Partial): MsgInstantiateContract2 { - const message = createBaseMsgInstantiateContract2(); - message.sender = object.sender ?? ""; + fromPartial(object: Partial): MsgStoreAndInstantiateContract { + const message = createBaseMsgStoreAndInstantiateContract(); + message.authority = object.authority ?? ""; + message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); + message.instantiatePermission = object.instantiatePermission !== undefined && object.instantiatePermission !== null ? AccessConfig.fromPartial(object.instantiatePermission) : undefined; + message.unpinCode = object.unpinCode ?? false; message.admin = object.admin ?? ""; - message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); message.label = object.label ?? ""; message.msg = object.msg ?? new Uint8Array(); message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; - message.salt = object.salt ?? new Uint8Array(); - message.fixMsg = object.fixMsg ?? false; + message.source = object.source ?? ""; + message.builder = object.builder ?? ""; + message.codeHash = object.codeHash ?? new Uint8Array(); return message; }, - fromAmino(object: MsgInstantiateContract2Amino): MsgInstantiateContract2 { - const message = createBaseMsgInstantiateContract2(); - if (object.sender !== undefined && object.sender !== null) { - message.sender = object.sender; + fromAmino(object: MsgStoreAndInstantiateContractAmino): MsgStoreAndInstantiateContract { + const message = createBaseMsgStoreAndInstantiateContract(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { + message.wasmByteCode = fromBase64(object.wasm_byte_code); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); + } + if (object.unpin_code !== undefined && object.unpin_code !== null) { + message.unpinCode = object.unpin_code; } if (object.admin !== undefined && object.admin !== null) { message.admin = object.admin; } - if (object.code_id !== undefined && object.code_id !== null) { - message.codeId = BigInt(object.code_id); - } if (object.label !== undefined && object.label !== null) { message.label = object.label; } @@ -921,142 +3399,67 @@ export const MsgInstantiateContract2 = { message.msg = toUtf8(JSON.stringify(object.msg)); } message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; - if (object.salt !== undefined && object.salt !== null) { - message.salt = bytesFromBase64(object.salt); + if (object.source !== undefined && object.source !== null) { + message.source = object.source; } - if (object.fix_msg !== undefined && object.fix_msg !== null) { - message.fixMsg = object.fix_msg; + if (object.builder !== undefined && object.builder !== null) { + message.builder = object.builder; + } + if (object.code_hash !== undefined && object.code_hash !== null) { + message.codeHash = bytesFromBase64(object.code_hash); } return message; }, - toAmino(message: MsgInstantiateContract2): MsgInstantiateContract2Amino { + toAmino(message: MsgStoreAndInstantiateContract): MsgStoreAndInstantiateContractAmino { const obj: any = {}; - obj.sender = message.sender === "" ? undefined : message.sender; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.wasm_byte_code = message.wasmByteCode ? toBase64(message.wasmByteCode) : undefined; + obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : undefined; + obj.unpin_code = message.unpinCode === false ? undefined : message.unpinCode; obj.admin = message.admin === "" ? undefined : message.admin; - obj.code_id = message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; obj.label = message.label === "" ? undefined : message.label; obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; - if (message.funds) { - obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); - } else { - obj.funds = message.funds; - } - obj.salt = message.salt ? base64FromBytes(message.salt) : undefined; - obj.fix_msg = message.fixMsg === false ? undefined : message.fixMsg; - return obj; - }, - fromAminoMsg(object: MsgInstantiateContract2AminoMsg): MsgInstantiateContract2 { - return MsgInstantiateContract2.fromAmino(object.value); - }, - toAminoMsg(message: MsgInstantiateContract2): MsgInstantiateContract2AminoMsg { - return { - type: "wasm/MsgInstantiateContract2", - value: MsgInstantiateContract2.toAmino(message) - }; - }, - fromProtoMsg(message: MsgInstantiateContract2ProtoMsg): MsgInstantiateContract2 { - return MsgInstantiateContract2.decode(message.value); - }, - toProto(message: MsgInstantiateContract2): Uint8Array { - return MsgInstantiateContract2.encode(message).finish(); - }, - toProtoMsg(message: MsgInstantiateContract2): MsgInstantiateContract2ProtoMsg { - return { - typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2", - value: MsgInstantiateContract2.encode(message).finish() - }; - } -}; -function createBaseMsgInstantiateContractResponse(): MsgInstantiateContractResponse { - return { - address: "", - data: new Uint8Array() - }; -} -export const MsgInstantiateContractResponse = { - typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContractResponse", - encode(message: MsgInstantiateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.address !== "") { - writer.uint32(10).string(message.address); - } - if (message.data.length !== 0) { - writer.uint32(18).bytes(message.data); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantiateContractResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgInstantiateContractResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.address = reader.string(); - break; - case 2: - message.data = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): MsgInstantiateContractResponse { - const message = createBaseMsgInstantiateContractResponse(); - message.address = object.address ?? ""; - message.data = object.data ?? new Uint8Array(); - return message; - }, - fromAmino(object: MsgInstantiateContractResponseAmino): MsgInstantiateContractResponse { - const message = createBaseMsgInstantiateContractResponse(); - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.funds = message.funds; } - return message; - }, - toAmino(message: MsgInstantiateContractResponse): MsgInstantiateContractResponseAmino { - const obj: any = {}; - obj.address = message.address === "" ? undefined : message.address; - obj.data = message.data ? base64FromBytes(message.data) : undefined; + obj.source = message.source === "" ? undefined : message.source; + obj.builder = message.builder === "" ? undefined : message.builder; + obj.code_hash = message.codeHash ? base64FromBytes(message.codeHash) : undefined; return obj; }, - fromAminoMsg(object: MsgInstantiateContractResponseAminoMsg): MsgInstantiateContractResponse { - return MsgInstantiateContractResponse.fromAmino(object.value); + fromAminoMsg(object: MsgStoreAndInstantiateContractAminoMsg): MsgStoreAndInstantiateContract { + return MsgStoreAndInstantiateContract.fromAmino(object.value); }, - toAminoMsg(message: MsgInstantiateContractResponse): MsgInstantiateContractResponseAminoMsg { + toAminoMsg(message: MsgStoreAndInstantiateContract): MsgStoreAndInstantiateContractAminoMsg { return { - type: "wasm/MsgInstantiateContractResponse", - value: MsgInstantiateContractResponse.toAmino(message) + type: "wasm/MsgStoreAndInstantiateContract", + value: MsgStoreAndInstantiateContract.toAmino(message) }; }, - fromProtoMsg(message: MsgInstantiateContractResponseProtoMsg): MsgInstantiateContractResponse { - return MsgInstantiateContractResponse.decode(message.value); + fromProtoMsg(message: MsgStoreAndInstantiateContractProtoMsg): MsgStoreAndInstantiateContract { + return MsgStoreAndInstantiateContract.decode(message.value); }, - toProto(message: MsgInstantiateContractResponse): Uint8Array { - return MsgInstantiateContractResponse.encode(message).finish(); + toProto(message: MsgStoreAndInstantiateContract): Uint8Array { + return MsgStoreAndInstantiateContract.encode(message).finish(); }, - toProtoMsg(message: MsgInstantiateContractResponse): MsgInstantiateContractResponseProtoMsg { + toProtoMsg(message: MsgStoreAndInstantiateContract): MsgStoreAndInstantiateContractProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContractResponse", - value: MsgInstantiateContractResponse.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract", + value: MsgStoreAndInstantiateContract.encode(message).finish() }; } }; -function createBaseMsgInstantiateContract2Response(): MsgInstantiateContract2Response { +function createBaseMsgStoreAndInstantiateContractResponse(): MsgStoreAndInstantiateContractResponse { return { address: "", data: new Uint8Array() }; } -export const MsgInstantiateContract2Response = { - typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2Response", - encode(message: MsgInstantiateContract2Response, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const MsgStoreAndInstantiateContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContractResponse", + encode(message: MsgStoreAndInstantiateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.address !== "") { writer.uint32(10).string(message.address); } @@ -1065,10 +3468,10 @@ export const MsgInstantiateContract2Response = { } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgInstantiateContract2Response { + decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreAndInstantiateContractResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgInstantiateContract2Response(); + const message = createBaseMsgStoreAndInstantiateContractResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1085,14 +3488,14 @@ export const MsgInstantiateContract2Response = { } return message; }, - fromPartial(object: Partial): MsgInstantiateContract2Response { - const message = createBaseMsgInstantiateContract2Response(); + fromPartial(object: Partial): MsgStoreAndInstantiateContractResponse { + const message = createBaseMsgStoreAndInstantiateContractResponse(); message.address = object.address ?? ""; message.data = object.data ?? new Uint8Array(); return message; }, - fromAmino(object: MsgInstantiateContract2ResponseAmino): MsgInstantiateContract2Response { - const message = createBaseMsgInstantiateContract2Response(); + fromAmino(object: MsgStoreAndInstantiateContractResponseAmino): MsgStoreAndInstantiateContractResponse { + const message = createBaseMsgStoreAndInstantiateContractResponse(); if (object.address !== undefined && object.address !== null) { message.address = object.address; } @@ -1101,77 +3504,63 @@ export const MsgInstantiateContract2Response = { } return message; }, - toAmino(message: MsgInstantiateContract2Response): MsgInstantiateContract2ResponseAmino { + toAmino(message: MsgStoreAndInstantiateContractResponse): MsgStoreAndInstantiateContractResponseAmino { const obj: any = {}; obj.address = message.address === "" ? undefined : message.address; obj.data = message.data ? base64FromBytes(message.data) : undefined; return obj; }, - fromAminoMsg(object: MsgInstantiateContract2ResponseAminoMsg): MsgInstantiateContract2Response { - return MsgInstantiateContract2Response.fromAmino(object.value); + fromAminoMsg(object: MsgStoreAndInstantiateContractResponseAminoMsg): MsgStoreAndInstantiateContractResponse { + return MsgStoreAndInstantiateContractResponse.fromAmino(object.value); }, - toAminoMsg(message: MsgInstantiateContract2Response): MsgInstantiateContract2ResponseAminoMsg { + toAminoMsg(message: MsgStoreAndInstantiateContractResponse): MsgStoreAndInstantiateContractResponseAminoMsg { return { - type: "wasm/MsgInstantiateContract2Response", - value: MsgInstantiateContract2Response.toAmino(message) + type: "wasm/MsgStoreAndInstantiateContractResponse", + value: MsgStoreAndInstantiateContractResponse.toAmino(message) }; }, - fromProtoMsg(message: MsgInstantiateContract2ResponseProtoMsg): MsgInstantiateContract2Response { - return MsgInstantiateContract2Response.decode(message.value); + fromProtoMsg(message: MsgStoreAndInstantiateContractResponseProtoMsg): MsgStoreAndInstantiateContractResponse { + return MsgStoreAndInstantiateContractResponse.decode(message.value); }, - toProto(message: MsgInstantiateContract2Response): Uint8Array { - return MsgInstantiateContract2Response.encode(message).finish(); + toProto(message: MsgStoreAndInstantiateContractResponse): Uint8Array { + return MsgStoreAndInstantiateContractResponse.encode(message).finish(); }, - toProtoMsg(message: MsgInstantiateContract2Response): MsgInstantiateContract2ResponseProtoMsg { + toProtoMsg(message: MsgStoreAndInstantiateContractResponse): MsgStoreAndInstantiateContractResponseProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract2Response", - value: MsgInstantiateContract2Response.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContractResponse", + value: MsgStoreAndInstantiateContractResponse.encode(message).finish() }; } }; -function createBaseMsgExecuteContract(): MsgExecuteContract { +function createBaseMsgAddCodeUploadParamsAddresses(): MsgAddCodeUploadParamsAddresses { return { - sender: "", - contract: "", - msg: new Uint8Array(), - funds: [] + authority: "", + addresses: [] }; } -export const MsgExecuteContract = { - typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", - encode(message: MsgExecuteContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); - } - if (message.contract !== "") { - writer.uint32(18).string(message.contract); - } - if (message.msg.length !== 0) { - writer.uint32(26).bytes(message.msg); +export const MsgAddCodeUploadParamsAddresses = { + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses", + encode(message: MsgAddCodeUploadParamsAddresses, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); } - for (const v of message.funds) { - Coin.encode(v!, writer.uint32(42).fork()).ldelim(); + for (const v of message.addresses) { + writer.uint32(18).string(v!); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgExecuteContract { + decode(input: BinaryReader | Uint8Array, length?: number): MsgAddCodeUploadParamsAddresses { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgExecuteContract(); + const message = createBaseMsgAddCodeUploadParamsAddresses(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sender = reader.string(); + message.authority = reader.string(); break; case 2: - message.contract = reader.string(); - break; - case 3: - message.msg = reader.bytes(); - break; - case 5: - message.funds.push(Coin.decode(reader, reader.uint32())); + message.addresses.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -1180,85 +3569,67 @@ export const MsgExecuteContract = { } return message; }, - fromPartial(object: Partial): MsgExecuteContract { - const message = createBaseMsgExecuteContract(); - message.sender = object.sender ?? ""; - message.contract = object.contract ?? ""; - message.msg = object.msg ?? new Uint8Array(); - message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; + fromPartial(object: Partial): MsgAddCodeUploadParamsAddresses { + const message = createBaseMsgAddCodeUploadParamsAddresses(); + message.authority = object.authority ?? ""; + message.addresses = object.addresses?.map(e => e) || []; return message; }, - fromAmino(object: MsgExecuteContractAmino): MsgExecuteContract { - const message = createBaseMsgExecuteContract(); - if (object.sender !== undefined && object.sender !== null) { - message.sender = object.sender; - } - if (object.contract !== undefined && object.contract !== null) { - message.contract = object.contract; - } - if (object.msg !== undefined && object.msg !== null) { - message.msg = toUtf8(JSON.stringify(object.msg)); + fromAmino(object: MsgAddCodeUploadParamsAddressesAmino): MsgAddCodeUploadParamsAddresses { + const message = createBaseMsgAddCodeUploadParamsAddresses(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; } - message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + message.addresses = object.addresses?.map(e => e) || []; return message; }, - toAmino(message: MsgExecuteContract): MsgExecuteContractAmino { + toAmino(message: MsgAddCodeUploadParamsAddresses): MsgAddCodeUploadParamsAddressesAmino { const obj: any = {}; - obj.sender = message.sender === "" ? undefined : message.sender; - obj.contract = message.contract === "" ? undefined : message.contract; - obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; - if (message.funds) { - obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); + obj.authority = message.authority === "" ? undefined : message.authority; + if (message.addresses) { + obj.addresses = message.addresses.map(e => e); } else { - obj.funds = message.funds; + obj.addresses = message.addresses; } return obj; }, - fromAminoMsg(object: MsgExecuteContractAminoMsg): MsgExecuteContract { - return MsgExecuteContract.fromAmino(object.value); + fromAminoMsg(object: MsgAddCodeUploadParamsAddressesAminoMsg): MsgAddCodeUploadParamsAddresses { + return MsgAddCodeUploadParamsAddresses.fromAmino(object.value); }, - toAminoMsg(message: MsgExecuteContract): MsgExecuteContractAminoMsg { + toAminoMsg(message: MsgAddCodeUploadParamsAddresses): MsgAddCodeUploadParamsAddressesAminoMsg { return { - type: "wasm/MsgExecuteContract", - value: MsgExecuteContract.toAmino(message) + type: "wasm/MsgAddCodeUploadParamsAddresses", + value: MsgAddCodeUploadParamsAddresses.toAmino(message) }; }, - fromProtoMsg(message: MsgExecuteContractProtoMsg): MsgExecuteContract { - return MsgExecuteContract.decode(message.value); + fromProtoMsg(message: MsgAddCodeUploadParamsAddressesProtoMsg): MsgAddCodeUploadParamsAddresses { + return MsgAddCodeUploadParamsAddresses.decode(message.value); }, - toProto(message: MsgExecuteContract): Uint8Array { - return MsgExecuteContract.encode(message).finish(); + toProto(message: MsgAddCodeUploadParamsAddresses): Uint8Array { + return MsgAddCodeUploadParamsAddresses.encode(message).finish(); }, - toProtoMsg(message: MsgExecuteContract): MsgExecuteContractProtoMsg { + toProtoMsg(message: MsgAddCodeUploadParamsAddresses): MsgAddCodeUploadParamsAddressesProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", - value: MsgExecuteContract.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses", + value: MsgAddCodeUploadParamsAddresses.encode(message).finish() }; } }; -function createBaseMsgExecuteContractResponse(): MsgExecuteContractResponse { - return { - data: new Uint8Array() - }; +function createBaseMsgAddCodeUploadParamsAddressesResponse(): MsgAddCodeUploadParamsAddressesResponse { + return {}; } -export const MsgExecuteContractResponse = { - typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContractResponse", - encode(message: MsgExecuteContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.data.length !== 0) { - writer.uint32(10).bytes(message.data); - } +export const MsgAddCodeUploadParamsAddressesResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddressesResponse", + encode(_: MsgAddCodeUploadParamsAddressesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgExecuteContractResponse { + decode(input: BinaryReader | Uint8Array, length?: number): MsgAddCodeUploadParamsAddressesResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgExecuteContractResponse(); + const message = createBaseMsgAddCodeUploadParamsAddressesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.data = reader.bytes(); - break; default: reader.skipType(tag & 7); break; @@ -1266,88 +3637,69 @@ export const MsgExecuteContractResponse = { } return message; }, - fromPartial(object: Partial): MsgExecuteContractResponse { - const message = createBaseMsgExecuteContractResponse(); - message.data = object.data ?? new Uint8Array(); + fromPartial(_: Partial): MsgAddCodeUploadParamsAddressesResponse { + const message = createBaseMsgAddCodeUploadParamsAddressesResponse(); return message; }, - fromAmino(object: MsgExecuteContractResponseAmino): MsgExecuteContractResponse { - const message = createBaseMsgExecuteContractResponse(); - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } + fromAmino(_: MsgAddCodeUploadParamsAddressesResponseAmino): MsgAddCodeUploadParamsAddressesResponse { + const message = createBaseMsgAddCodeUploadParamsAddressesResponse(); return message; }, - toAmino(message: MsgExecuteContractResponse): MsgExecuteContractResponseAmino { + toAmino(_: MsgAddCodeUploadParamsAddressesResponse): MsgAddCodeUploadParamsAddressesResponseAmino { const obj: any = {}; - obj.data = message.data ? base64FromBytes(message.data) : undefined; return obj; }, - fromAminoMsg(object: MsgExecuteContractResponseAminoMsg): MsgExecuteContractResponse { - return MsgExecuteContractResponse.fromAmino(object.value); + fromAminoMsg(object: MsgAddCodeUploadParamsAddressesResponseAminoMsg): MsgAddCodeUploadParamsAddressesResponse { + return MsgAddCodeUploadParamsAddressesResponse.fromAmino(object.value); }, - toAminoMsg(message: MsgExecuteContractResponse): MsgExecuteContractResponseAminoMsg { + toAminoMsg(message: MsgAddCodeUploadParamsAddressesResponse): MsgAddCodeUploadParamsAddressesResponseAminoMsg { return { - type: "wasm/MsgExecuteContractResponse", - value: MsgExecuteContractResponse.toAmino(message) + type: "wasm/MsgAddCodeUploadParamsAddressesResponse", + value: MsgAddCodeUploadParamsAddressesResponse.toAmino(message) }; }, - fromProtoMsg(message: MsgExecuteContractResponseProtoMsg): MsgExecuteContractResponse { - return MsgExecuteContractResponse.decode(message.value); + fromProtoMsg(message: MsgAddCodeUploadParamsAddressesResponseProtoMsg): MsgAddCodeUploadParamsAddressesResponse { + return MsgAddCodeUploadParamsAddressesResponse.decode(message.value); }, - toProto(message: MsgExecuteContractResponse): Uint8Array { - return MsgExecuteContractResponse.encode(message).finish(); + toProto(message: MsgAddCodeUploadParamsAddressesResponse): Uint8Array { + return MsgAddCodeUploadParamsAddressesResponse.encode(message).finish(); }, - toProtoMsg(message: MsgExecuteContractResponse): MsgExecuteContractResponseProtoMsg { + toProtoMsg(message: MsgAddCodeUploadParamsAddressesResponse): MsgAddCodeUploadParamsAddressesResponseProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContractResponse", - value: MsgExecuteContractResponse.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddressesResponse", + value: MsgAddCodeUploadParamsAddressesResponse.encode(message).finish() }; } }; -function createBaseMsgMigrateContract(): MsgMigrateContract { +function createBaseMsgRemoveCodeUploadParamsAddresses(): MsgRemoveCodeUploadParamsAddresses { return { - sender: "", - contract: "", - codeId: BigInt(0), - msg: new Uint8Array() + authority: "", + addresses: [] }; } -export const MsgMigrateContract = { - typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract", - encode(message: MsgMigrateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); - } - if (message.contract !== "") { - writer.uint32(18).string(message.contract); +export const MsgRemoveCodeUploadParamsAddresses = { + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses", + encode(message: MsgRemoveCodeUploadParamsAddresses, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); } - if (message.codeId !== BigInt(0)) { - writer.uint32(24).uint64(message.codeId); - } - if (message.msg.length !== 0) { - writer.uint32(34).bytes(message.msg); + for (const v of message.addresses) { + writer.uint32(18).string(v!); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgMigrateContract { + decode(input: BinaryReader | Uint8Array, length?: number): MsgRemoveCodeUploadParamsAddresses { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgMigrateContract(); + const message = createBaseMsgRemoveCodeUploadParamsAddresses(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sender = reader.string(); + message.authority = reader.string(); break; case 2: - message.contract = reader.string(); - break; - case 3: - message.codeId = reader.uint64(); - break; - case 4: - message.msg = reader.bytes(); + message.addresses.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -1356,83 +3708,67 @@ export const MsgMigrateContract = { } return message; }, - fromPartial(object: Partial): MsgMigrateContract { - const message = createBaseMsgMigrateContract(); - message.sender = object.sender ?? ""; - message.contract = object.contract ?? ""; - message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); - message.msg = object.msg ?? new Uint8Array(); + fromPartial(object: Partial): MsgRemoveCodeUploadParamsAddresses { + const message = createBaseMsgRemoveCodeUploadParamsAddresses(); + message.authority = object.authority ?? ""; + message.addresses = object.addresses?.map(e => e) || []; return message; }, - fromAmino(object: MsgMigrateContractAmino): MsgMigrateContract { - const message = createBaseMsgMigrateContract(); - if (object.sender !== undefined && object.sender !== null) { - message.sender = object.sender; - } - if (object.contract !== undefined && object.contract !== null) { - message.contract = object.contract; - } - if (object.code_id !== undefined && object.code_id !== null) { - message.codeId = BigInt(object.code_id); - } - if (object.msg !== undefined && object.msg !== null) { - message.msg = toUtf8(JSON.stringify(object.msg)); + fromAmino(object: MsgRemoveCodeUploadParamsAddressesAmino): MsgRemoveCodeUploadParamsAddresses { + const message = createBaseMsgRemoveCodeUploadParamsAddresses(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; } + message.addresses = object.addresses?.map(e => e) || []; return message; }, - toAmino(message: MsgMigrateContract): MsgMigrateContractAmino { + toAmino(message: MsgRemoveCodeUploadParamsAddresses): MsgRemoveCodeUploadParamsAddressesAmino { const obj: any = {}; - obj.sender = message.sender === "" ? undefined : message.sender; - obj.contract = message.contract === "" ? undefined : message.contract; - obj.code_id = message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; - obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + obj.authority = message.authority === "" ? undefined : message.authority; + if (message.addresses) { + obj.addresses = message.addresses.map(e => e); + } else { + obj.addresses = message.addresses; + } return obj; }, - fromAminoMsg(object: MsgMigrateContractAminoMsg): MsgMigrateContract { - return MsgMigrateContract.fromAmino(object.value); + fromAminoMsg(object: MsgRemoveCodeUploadParamsAddressesAminoMsg): MsgRemoveCodeUploadParamsAddresses { + return MsgRemoveCodeUploadParamsAddresses.fromAmino(object.value); }, - toAminoMsg(message: MsgMigrateContract): MsgMigrateContractAminoMsg { + toAminoMsg(message: MsgRemoveCodeUploadParamsAddresses): MsgRemoveCodeUploadParamsAddressesAminoMsg { return { - type: "wasm/MsgMigrateContract", - value: MsgMigrateContract.toAmino(message) + type: "wasm/MsgRemoveCodeUploadParamsAddresses", + value: MsgRemoveCodeUploadParamsAddresses.toAmino(message) }; }, - fromProtoMsg(message: MsgMigrateContractProtoMsg): MsgMigrateContract { - return MsgMigrateContract.decode(message.value); + fromProtoMsg(message: MsgRemoveCodeUploadParamsAddressesProtoMsg): MsgRemoveCodeUploadParamsAddresses { + return MsgRemoveCodeUploadParamsAddresses.decode(message.value); }, - toProto(message: MsgMigrateContract): Uint8Array { - return MsgMigrateContract.encode(message).finish(); + toProto(message: MsgRemoveCodeUploadParamsAddresses): Uint8Array { + return MsgRemoveCodeUploadParamsAddresses.encode(message).finish(); }, - toProtoMsg(message: MsgMigrateContract): MsgMigrateContractProtoMsg { + toProtoMsg(message: MsgRemoveCodeUploadParamsAddresses): MsgRemoveCodeUploadParamsAddressesProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract", - value: MsgMigrateContract.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses", + value: MsgRemoveCodeUploadParamsAddresses.encode(message).finish() }; } }; -function createBaseMsgMigrateContractResponse(): MsgMigrateContractResponse { - return { - data: new Uint8Array() - }; +function createBaseMsgRemoveCodeUploadParamsAddressesResponse(): MsgRemoveCodeUploadParamsAddressesResponse { + return {}; } -export const MsgMigrateContractResponse = { - typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContractResponse", - encode(message: MsgMigrateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.data.length !== 0) { - writer.uint32(10).bytes(message.data); - } +export const MsgRemoveCodeUploadParamsAddressesResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddressesResponse", + encode(_: MsgRemoveCodeUploadParamsAddressesResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgMigrateContractResponse { + decode(input: BinaryReader | Uint8Array, length?: number): MsgRemoveCodeUploadParamsAddressesResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgMigrateContractResponse(); + const message = createBaseMsgRemoveCodeUploadParamsAddressesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.data = reader.bytes(); - break; default: reader.skipType(tag & 7); break; @@ -1440,82 +3776,91 @@ export const MsgMigrateContractResponse = { } return message; }, - fromPartial(object: Partial): MsgMigrateContractResponse { - const message = createBaseMsgMigrateContractResponse(); - message.data = object.data ?? new Uint8Array(); + fromPartial(_: Partial): MsgRemoveCodeUploadParamsAddressesResponse { + const message = createBaseMsgRemoveCodeUploadParamsAddressesResponse(); return message; }, - fromAmino(object: MsgMigrateContractResponseAmino): MsgMigrateContractResponse { - const message = createBaseMsgMigrateContractResponse(); - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } + fromAmino(_: MsgRemoveCodeUploadParamsAddressesResponseAmino): MsgRemoveCodeUploadParamsAddressesResponse { + const message = createBaseMsgRemoveCodeUploadParamsAddressesResponse(); return message; }, - toAmino(message: MsgMigrateContractResponse): MsgMigrateContractResponseAmino { + toAmino(_: MsgRemoveCodeUploadParamsAddressesResponse): MsgRemoveCodeUploadParamsAddressesResponseAmino { const obj: any = {}; - obj.data = message.data ? base64FromBytes(message.data) : undefined; return obj; }, - fromAminoMsg(object: MsgMigrateContractResponseAminoMsg): MsgMigrateContractResponse { - return MsgMigrateContractResponse.fromAmino(object.value); + fromAminoMsg(object: MsgRemoveCodeUploadParamsAddressesResponseAminoMsg): MsgRemoveCodeUploadParamsAddressesResponse { + return MsgRemoveCodeUploadParamsAddressesResponse.fromAmino(object.value); }, - toAminoMsg(message: MsgMigrateContractResponse): MsgMigrateContractResponseAminoMsg { + toAminoMsg(message: MsgRemoveCodeUploadParamsAddressesResponse): MsgRemoveCodeUploadParamsAddressesResponseAminoMsg { return { - type: "wasm/MsgMigrateContractResponse", - value: MsgMigrateContractResponse.toAmino(message) + type: "wasm/MsgRemoveCodeUploadParamsAddressesResponse", + value: MsgRemoveCodeUploadParamsAddressesResponse.toAmino(message) }; }, - fromProtoMsg(message: MsgMigrateContractResponseProtoMsg): MsgMigrateContractResponse { - return MsgMigrateContractResponse.decode(message.value); + fromProtoMsg(message: MsgRemoveCodeUploadParamsAddressesResponseProtoMsg): MsgRemoveCodeUploadParamsAddressesResponse { + return MsgRemoveCodeUploadParamsAddressesResponse.decode(message.value); }, - toProto(message: MsgMigrateContractResponse): Uint8Array { - return MsgMigrateContractResponse.encode(message).finish(); + toProto(message: MsgRemoveCodeUploadParamsAddressesResponse): Uint8Array { + return MsgRemoveCodeUploadParamsAddressesResponse.encode(message).finish(); }, - toProtoMsg(message: MsgMigrateContractResponse): MsgMigrateContractResponseProtoMsg { + toProtoMsg(message: MsgRemoveCodeUploadParamsAddressesResponse): MsgRemoveCodeUploadParamsAddressesResponseProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContractResponse", - value: MsgMigrateContractResponse.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddressesResponse", + value: MsgRemoveCodeUploadParamsAddressesResponse.encode(message).finish() }; } }; -function createBaseMsgUpdateAdmin(): MsgUpdateAdmin { - return { - sender: "", - newAdmin: "", - contract: "" +function createBaseMsgStoreAndMigrateContract(): MsgStoreAndMigrateContract { + return { + authority: "", + wasmByteCode: new Uint8Array(), + instantiatePermission: undefined, + contract: "", + msg: new Uint8Array() }; } -export const MsgUpdateAdmin = { - typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin", - encode(message: MsgUpdateAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); +export const MsgStoreAndMigrateContract = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract", + encode(message: MsgStoreAndMigrateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); } - if (message.newAdmin !== "") { - writer.uint32(18).string(message.newAdmin); + if (message.wasmByteCode.length !== 0) { + writer.uint32(18).bytes(message.wasmByteCode); + } + if (message.instantiatePermission !== undefined) { + AccessConfig.encode(message.instantiatePermission, writer.uint32(26).fork()).ldelim(); } if (message.contract !== "") { - writer.uint32(26).string(message.contract); + writer.uint32(34).string(message.contract); + } + if (message.msg.length !== 0) { + writer.uint32(42).bytes(message.msg); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateAdmin { + decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreAndMigrateContract { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateAdmin(); + const message = createBaseMsgStoreAndMigrateContract(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sender = reader.string(); + message.authority = reader.string(); break; case 2: - message.newAdmin = reader.string(); + message.wasmByteCode = reader.bytes(); break; case 3: + message.instantiatePermission = AccessConfig.decode(reader, reader.uint32()); + break; + case 4: message.contract = reader.string(); break; + case 5: + message.msg = reader.bytes(); + break; default: reader.skipType(tag & 7); break; @@ -1523,70 +3868,102 @@ export const MsgUpdateAdmin = { } return message; }, - fromPartial(object: Partial): MsgUpdateAdmin { - const message = createBaseMsgUpdateAdmin(); - message.sender = object.sender ?? ""; - message.newAdmin = object.newAdmin ?? ""; + fromPartial(object: Partial): MsgStoreAndMigrateContract { + const message = createBaseMsgStoreAndMigrateContract(); + message.authority = object.authority ?? ""; + message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); + message.instantiatePermission = object.instantiatePermission !== undefined && object.instantiatePermission !== null ? AccessConfig.fromPartial(object.instantiatePermission) : undefined; message.contract = object.contract ?? ""; + message.msg = object.msg ?? new Uint8Array(); return message; }, - fromAmino(object: MsgUpdateAdminAmino): MsgUpdateAdmin { - const message = createBaseMsgUpdateAdmin(); - if (object.sender !== undefined && object.sender !== null) { - message.sender = object.sender; + fromAmino(object: MsgStoreAndMigrateContractAmino): MsgStoreAndMigrateContract { + const message = createBaseMsgStoreAndMigrateContract(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; } - if (object.new_admin !== undefined && object.new_admin !== null) { - message.newAdmin = object.new_admin; + if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { + message.wasmByteCode = fromBase64(object.wasm_byte_code); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfig.fromAmino(object.instantiate_permission); } if (object.contract !== undefined && object.contract !== null) { message.contract = object.contract; } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } return message; }, - toAmino(message: MsgUpdateAdmin): MsgUpdateAdminAmino { + toAmino(message: MsgStoreAndMigrateContract): MsgStoreAndMigrateContractAmino { const obj: any = {}; - obj.sender = message.sender === "" ? undefined : message.sender; - obj.new_admin = message.newAdmin === "" ? undefined : message.newAdmin; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.wasm_byte_code = message.wasmByteCode ? toBase64(message.wasmByteCode) : undefined; + obj.instantiate_permission = message.instantiatePermission ? AccessConfig.toAmino(message.instantiatePermission) : undefined; obj.contract = message.contract === "" ? undefined : message.contract; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; return obj; }, - fromAminoMsg(object: MsgUpdateAdminAminoMsg): MsgUpdateAdmin { - return MsgUpdateAdmin.fromAmino(object.value); + fromAminoMsg(object: MsgStoreAndMigrateContractAminoMsg): MsgStoreAndMigrateContract { + return MsgStoreAndMigrateContract.fromAmino(object.value); }, - toAminoMsg(message: MsgUpdateAdmin): MsgUpdateAdminAminoMsg { + toAminoMsg(message: MsgStoreAndMigrateContract): MsgStoreAndMigrateContractAminoMsg { return { - type: "wasm/MsgUpdateAdmin", - value: MsgUpdateAdmin.toAmino(message) + type: "wasm/MsgStoreAndMigrateContract", + value: MsgStoreAndMigrateContract.toAmino(message) }; }, - fromProtoMsg(message: MsgUpdateAdminProtoMsg): MsgUpdateAdmin { - return MsgUpdateAdmin.decode(message.value); + fromProtoMsg(message: MsgStoreAndMigrateContractProtoMsg): MsgStoreAndMigrateContract { + return MsgStoreAndMigrateContract.decode(message.value); }, - toProto(message: MsgUpdateAdmin): Uint8Array { - return MsgUpdateAdmin.encode(message).finish(); + toProto(message: MsgStoreAndMigrateContract): Uint8Array { + return MsgStoreAndMigrateContract.encode(message).finish(); }, - toProtoMsg(message: MsgUpdateAdmin): MsgUpdateAdminProtoMsg { + toProtoMsg(message: MsgStoreAndMigrateContract): MsgStoreAndMigrateContractProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin", - value: MsgUpdateAdmin.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract", + value: MsgStoreAndMigrateContract.encode(message).finish() }; } }; -function createBaseMsgUpdateAdminResponse(): MsgUpdateAdminResponse { - return {}; +function createBaseMsgStoreAndMigrateContractResponse(): MsgStoreAndMigrateContractResponse { + return { + codeId: BigInt(0), + checksum: new Uint8Array(), + data: new Uint8Array() + }; } -export const MsgUpdateAdminResponse = { - typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdminResponse", - encode(_: MsgUpdateAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const MsgStoreAndMigrateContractResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContractResponse", + encode(message: MsgStoreAndMigrateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + if (message.checksum.length !== 0) { + writer.uint32(18).bytes(message.checksum); + } + if (message.data.length !== 0) { + writer.uint32(26).bytes(message.data); + } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateAdminResponse { + decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreAndMigrateContractResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateAdminResponse(); + const message = createBaseMsgStoreAndMigrateContractResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64(); + break; + case 2: + message.checksum = reader.bytes(); + break; + case 3: + message.data = reader.bytes(); + break; default: reader.skipType(tag & 7); break; @@ -1594,67 +3971,89 @@ export const MsgUpdateAdminResponse = { } return message; }, - fromPartial(_: Partial): MsgUpdateAdminResponse { - const message = createBaseMsgUpdateAdminResponse(); + fromPartial(object: Partial): MsgStoreAndMigrateContractResponse { + const message = createBaseMsgStoreAndMigrateContractResponse(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.checksum = object.checksum ?? new Uint8Array(); + message.data = object.data ?? new Uint8Array(); return message; }, - fromAmino(_: MsgUpdateAdminResponseAmino): MsgUpdateAdminResponse { - const message = createBaseMsgUpdateAdminResponse(); + fromAmino(object: MsgStoreAndMigrateContractResponseAmino): MsgStoreAndMigrateContractResponse { + const message = createBaseMsgStoreAndMigrateContractResponse(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.checksum !== undefined && object.checksum !== null) { + message.checksum = bytesFromBase64(object.checksum); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } return message; }, - toAmino(_: MsgUpdateAdminResponse): MsgUpdateAdminResponseAmino { + toAmino(message: MsgStoreAndMigrateContractResponse): MsgStoreAndMigrateContractResponseAmino { const obj: any = {}; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + obj.checksum = message.checksum ? base64FromBytes(message.checksum) : undefined; + obj.data = message.data ? base64FromBytes(message.data) : undefined; return obj; }, - fromAminoMsg(object: MsgUpdateAdminResponseAminoMsg): MsgUpdateAdminResponse { - return MsgUpdateAdminResponse.fromAmino(object.value); + fromAminoMsg(object: MsgStoreAndMigrateContractResponseAminoMsg): MsgStoreAndMigrateContractResponse { + return MsgStoreAndMigrateContractResponse.fromAmino(object.value); }, - toAminoMsg(message: MsgUpdateAdminResponse): MsgUpdateAdminResponseAminoMsg { + toAminoMsg(message: MsgStoreAndMigrateContractResponse): MsgStoreAndMigrateContractResponseAminoMsg { return { - type: "wasm/MsgUpdateAdminResponse", - value: MsgUpdateAdminResponse.toAmino(message) + type: "wasm/MsgStoreAndMigrateContractResponse", + value: MsgStoreAndMigrateContractResponse.toAmino(message) }; }, - fromProtoMsg(message: MsgUpdateAdminResponseProtoMsg): MsgUpdateAdminResponse { - return MsgUpdateAdminResponse.decode(message.value); + fromProtoMsg(message: MsgStoreAndMigrateContractResponseProtoMsg): MsgStoreAndMigrateContractResponse { + return MsgStoreAndMigrateContractResponse.decode(message.value); }, - toProto(message: MsgUpdateAdminResponse): Uint8Array { - return MsgUpdateAdminResponse.encode(message).finish(); + toProto(message: MsgStoreAndMigrateContractResponse): Uint8Array { + return MsgStoreAndMigrateContractResponse.encode(message).finish(); }, - toProtoMsg(message: MsgUpdateAdminResponse): MsgUpdateAdminResponseProtoMsg { + toProtoMsg(message: MsgStoreAndMigrateContractResponse): MsgStoreAndMigrateContractResponseProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdminResponse", - value: MsgUpdateAdminResponse.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgStoreAndMigrateContractResponse", + value: MsgStoreAndMigrateContractResponse.encode(message).finish() }; } }; -function createBaseMsgClearAdmin(): MsgClearAdmin { +function createBaseMsgUpdateContractLabel(): MsgUpdateContractLabel { return { sender: "", + newLabel: "", contract: "" }; } -export const MsgClearAdmin = { - typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin", - encode(message: MsgClearAdmin, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const MsgUpdateContractLabel = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabel", + encode(message: MsgUpdateContractLabel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.sender !== "") { writer.uint32(10).string(message.sender); } + if (message.newLabel !== "") { + writer.uint32(18).string(message.newLabel); + } if (message.contract !== "") { writer.uint32(26).string(message.contract); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgClearAdmin { + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateContractLabel { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgClearAdmin(); + const message = createBaseMsgUpdateContractLabel(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.sender = reader.string(); break; + case 2: + message.newLabel = reader.string(); + break; case 3: message.contract = reader.string(); break; @@ -1665,62 +4064,67 @@ export const MsgClearAdmin = { } return message; }, - fromPartial(object: Partial): MsgClearAdmin { - const message = createBaseMsgClearAdmin(); + fromPartial(object: Partial): MsgUpdateContractLabel { + const message = createBaseMsgUpdateContractLabel(); message.sender = object.sender ?? ""; + message.newLabel = object.newLabel ?? ""; message.contract = object.contract ?? ""; return message; }, - fromAmino(object: MsgClearAdminAmino): MsgClearAdmin { - const message = createBaseMsgClearAdmin(); + fromAmino(object: MsgUpdateContractLabelAmino): MsgUpdateContractLabel { + const message = createBaseMsgUpdateContractLabel(); if (object.sender !== undefined && object.sender !== null) { message.sender = object.sender; } + if (object.new_label !== undefined && object.new_label !== null) { + message.newLabel = object.new_label; + } if (object.contract !== undefined && object.contract !== null) { message.contract = object.contract; } return message; }, - toAmino(message: MsgClearAdmin): MsgClearAdminAmino { + toAmino(message: MsgUpdateContractLabel): MsgUpdateContractLabelAmino { const obj: any = {}; obj.sender = message.sender === "" ? undefined : message.sender; + obj.new_label = message.newLabel === "" ? undefined : message.newLabel; obj.contract = message.contract === "" ? undefined : message.contract; return obj; }, - fromAminoMsg(object: MsgClearAdminAminoMsg): MsgClearAdmin { - return MsgClearAdmin.fromAmino(object.value); + fromAminoMsg(object: MsgUpdateContractLabelAminoMsg): MsgUpdateContractLabel { + return MsgUpdateContractLabel.fromAmino(object.value); }, - toAminoMsg(message: MsgClearAdmin): MsgClearAdminAminoMsg { + toAminoMsg(message: MsgUpdateContractLabel): MsgUpdateContractLabelAminoMsg { return { - type: "wasm/MsgClearAdmin", - value: MsgClearAdmin.toAmino(message) + type: "wasm/MsgUpdateContractLabel", + value: MsgUpdateContractLabel.toAmino(message) }; }, - fromProtoMsg(message: MsgClearAdminProtoMsg): MsgClearAdmin { - return MsgClearAdmin.decode(message.value); + fromProtoMsg(message: MsgUpdateContractLabelProtoMsg): MsgUpdateContractLabel { + return MsgUpdateContractLabel.decode(message.value); }, - toProto(message: MsgClearAdmin): Uint8Array { - return MsgClearAdmin.encode(message).finish(); + toProto(message: MsgUpdateContractLabel): Uint8Array { + return MsgUpdateContractLabel.encode(message).finish(); }, - toProtoMsg(message: MsgClearAdmin): MsgClearAdminProtoMsg { + toProtoMsg(message: MsgUpdateContractLabel): MsgUpdateContractLabelProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin", - value: MsgClearAdmin.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabel", + value: MsgUpdateContractLabel.encode(message).finish() }; } }; -function createBaseMsgClearAdminResponse(): MsgClearAdminResponse { +function createBaseMsgUpdateContractLabelResponse(): MsgUpdateContractLabelResponse { return {}; } -export const MsgClearAdminResponse = { - typeUrl: "/cosmwasm.wasm.v1.MsgClearAdminResponse", - encode(_: MsgClearAdminResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const MsgUpdateContractLabelResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabelResponse", + encode(_: MsgUpdateContractLabelResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgClearAdminResponse { + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateContractLabelResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgClearAdminResponse(); + const message = createBaseMsgUpdateContractLabelResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1731,76 +4135,69 @@ export const MsgClearAdminResponse = { } return message; }, - fromPartial(_: Partial): MsgClearAdminResponse { - const message = createBaseMsgClearAdminResponse(); + fromPartial(_: Partial): MsgUpdateContractLabelResponse { + const message = createBaseMsgUpdateContractLabelResponse(); return message; }, - fromAmino(_: MsgClearAdminResponseAmino): MsgClearAdminResponse { - const message = createBaseMsgClearAdminResponse(); + fromAmino(_: MsgUpdateContractLabelResponseAmino): MsgUpdateContractLabelResponse { + const message = createBaseMsgUpdateContractLabelResponse(); return message; }, - toAmino(_: MsgClearAdminResponse): MsgClearAdminResponseAmino { + toAmino(_: MsgUpdateContractLabelResponse): MsgUpdateContractLabelResponseAmino { const obj: any = {}; return obj; }, - fromAminoMsg(object: MsgClearAdminResponseAminoMsg): MsgClearAdminResponse { - return MsgClearAdminResponse.fromAmino(object.value); + fromAminoMsg(object: MsgUpdateContractLabelResponseAminoMsg): MsgUpdateContractLabelResponse { + return MsgUpdateContractLabelResponse.fromAmino(object.value); }, - toAminoMsg(message: MsgClearAdminResponse): MsgClearAdminResponseAminoMsg { + toAminoMsg(message: MsgUpdateContractLabelResponse): MsgUpdateContractLabelResponseAminoMsg { return { - type: "wasm/MsgClearAdminResponse", - value: MsgClearAdminResponse.toAmino(message) + type: "wasm/MsgUpdateContractLabelResponse", + value: MsgUpdateContractLabelResponse.toAmino(message) }; }, - fromProtoMsg(message: MsgClearAdminResponseProtoMsg): MsgClearAdminResponse { - return MsgClearAdminResponse.decode(message.value); + fromProtoMsg(message: MsgUpdateContractLabelResponseProtoMsg): MsgUpdateContractLabelResponse { + return MsgUpdateContractLabelResponse.decode(message.value); }, - toProto(message: MsgClearAdminResponse): Uint8Array { - return MsgClearAdminResponse.encode(message).finish(); + toProto(message: MsgUpdateContractLabelResponse): Uint8Array { + return MsgUpdateContractLabelResponse.encode(message).finish(); }, - toProtoMsg(message: MsgClearAdminResponse): MsgClearAdminResponseProtoMsg { + toProtoMsg(message: MsgUpdateContractLabelResponse): MsgUpdateContractLabelResponseProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgClearAdminResponse", - value: MsgClearAdminResponse.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgUpdateContractLabelResponse", + value: MsgUpdateContractLabelResponse.encode(message).finish() }; } }; -function createBaseMsgUpdateInstantiateConfig(): MsgUpdateInstantiateConfig { +function createBaseMsgSetGaslessContracts(): MsgSetGaslessContracts { return { - sender: "", - codeId: BigInt(0), - newInstantiatePermission: undefined + authority: "", + contracts: [] }; } -export const MsgUpdateInstantiateConfig = { - typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", - encode(message: MsgUpdateInstantiateConfig, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); +export const MsgSetGaslessContracts = { + typeUrl: "/cosmwasm.wasm.v1.MsgSetGaslessContracts", + encode(message: MsgSetGaslessContracts, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); } - if (message.codeId !== BigInt(0)) { - writer.uint32(16).uint64(message.codeId); - } - if (message.newInstantiatePermission !== undefined) { - AccessConfig.encode(message.newInstantiatePermission, writer.uint32(26).fork()).ldelim(); + for (const v of message.contracts) { + writer.uint32(18).string(v!); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateInstantiateConfig { + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetGaslessContracts { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateInstantiateConfig(); + const message = createBaseMsgSetGaslessContracts(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sender = reader.string(); + message.authority = reader.string(); break; case 2: - message.codeId = reader.uint64(); - break; - case 3: - message.newInstantiatePermission = AccessConfig.decode(reader, reader.uint32()); + message.contracts.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -1809,67 +4206,64 @@ export const MsgUpdateInstantiateConfig = { } return message; }, - fromPartial(object: Partial): MsgUpdateInstantiateConfig { - const message = createBaseMsgUpdateInstantiateConfig(); - message.sender = object.sender ?? ""; - message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); - message.newInstantiatePermission = object.newInstantiatePermission !== undefined && object.newInstantiatePermission !== null ? AccessConfig.fromPartial(object.newInstantiatePermission) : undefined; + fromPartial(object: Partial): MsgSetGaslessContracts { + const message = createBaseMsgSetGaslessContracts(); + message.authority = object.authority ?? ""; + message.contracts = object.contracts?.map(e => e) || []; return message; }, - fromAmino(object: MsgUpdateInstantiateConfigAmino): MsgUpdateInstantiateConfig { - const message = createBaseMsgUpdateInstantiateConfig(); - if (object.sender !== undefined && object.sender !== null) { - message.sender = object.sender; - } - if (object.code_id !== undefined && object.code_id !== null) { - message.codeId = BigInt(object.code_id); - } - if (object.new_instantiate_permission !== undefined && object.new_instantiate_permission !== null) { - message.newInstantiatePermission = AccessConfig.fromAmino(object.new_instantiate_permission); + fromAmino(object: MsgSetGaslessContractsAmino): MsgSetGaslessContracts { + const message = createBaseMsgSetGaslessContracts(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; } + message.contracts = object.contracts?.map(e => e) || []; return message; }, - toAmino(message: MsgUpdateInstantiateConfig): MsgUpdateInstantiateConfigAmino { + toAmino(message: MsgSetGaslessContracts): MsgSetGaslessContractsAmino { const obj: any = {}; - obj.sender = message.sender === "" ? undefined : message.sender; - obj.code_id = message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; - obj.new_instantiate_permission = message.newInstantiatePermission ? AccessConfig.toAmino(message.newInstantiatePermission) : undefined; + obj.authority = message.authority === "" ? undefined : message.authority; + if (message.contracts) { + obj.contracts = message.contracts.map(e => e); + } else { + obj.contracts = message.contracts; + } return obj; }, - fromAminoMsg(object: MsgUpdateInstantiateConfigAminoMsg): MsgUpdateInstantiateConfig { - return MsgUpdateInstantiateConfig.fromAmino(object.value); + fromAminoMsg(object: MsgSetGaslessContractsAminoMsg): MsgSetGaslessContracts { + return MsgSetGaslessContracts.fromAmino(object.value); }, - toAminoMsg(message: MsgUpdateInstantiateConfig): MsgUpdateInstantiateConfigAminoMsg { + toAminoMsg(message: MsgSetGaslessContracts): MsgSetGaslessContractsAminoMsg { return { - type: "wasm/MsgUpdateInstantiateConfig", - value: MsgUpdateInstantiateConfig.toAmino(message) + type: "wasm/MsgSetGaslessContracts", + value: MsgSetGaslessContracts.toAmino(message) }; }, - fromProtoMsg(message: MsgUpdateInstantiateConfigProtoMsg): MsgUpdateInstantiateConfig { - return MsgUpdateInstantiateConfig.decode(message.value); + fromProtoMsg(message: MsgSetGaslessContractsProtoMsg): MsgSetGaslessContracts { + return MsgSetGaslessContracts.decode(message.value); }, - toProto(message: MsgUpdateInstantiateConfig): Uint8Array { - return MsgUpdateInstantiateConfig.encode(message).finish(); + toProto(message: MsgSetGaslessContracts): Uint8Array { + return MsgSetGaslessContracts.encode(message).finish(); }, - toProtoMsg(message: MsgUpdateInstantiateConfig): MsgUpdateInstantiateConfigProtoMsg { + toProtoMsg(message: MsgSetGaslessContracts): MsgSetGaslessContractsProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig", - value: MsgUpdateInstantiateConfig.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgSetGaslessContracts", + value: MsgSetGaslessContracts.encode(message).finish() }; } }; -function createBaseMsgUpdateInstantiateConfigResponse(): MsgUpdateInstantiateConfigResponse { +function createBaseMsgSetGaslessContractsResponse(): MsgSetGaslessContractsResponse { return {}; } -export const MsgUpdateInstantiateConfigResponse = { - typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfigResponse", - encode(_: MsgUpdateInstantiateConfigResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const MsgSetGaslessContractsResponse = { + typeUrl: "/cosmwasm.wasm.v1.MsgSetGaslessContractsResponse", + encode(_: MsgSetGaslessContractsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateInstantiateConfigResponse { + decode(input: BinaryReader | Uint8Array, length?: number): MsgSetGaslessContractsResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgUpdateInstantiateConfigResponse(); + const message = createBaseMsgSetGaslessContractsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -1880,37 +4274,37 @@ export const MsgUpdateInstantiateConfigResponse = { } return message; }, - fromPartial(_: Partial): MsgUpdateInstantiateConfigResponse { - const message = createBaseMsgUpdateInstantiateConfigResponse(); + fromPartial(_: Partial): MsgSetGaslessContractsResponse { + const message = createBaseMsgSetGaslessContractsResponse(); return message; }, - fromAmino(_: MsgUpdateInstantiateConfigResponseAmino): MsgUpdateInstantiateConfigResponse { - const message = createBaseMsgUpdateInstantiateConfigResponse(); + fromAmino(_: MsgSetGaslessContractsResponseAmino): MsgSetGaslessContractsResponse { + const message = createBaseMsgSetGaslessContractsResponse(); return message; }, - toAmino(_: MsgUpdateInstantiateConfigResponse): MsgUpdateInstantiateConfigResponseAmino { + toAmino(_: MsgSetGaslessContractsResponse): MsgSetGaslessContractsResponseAmino { const obj: any = {}; return obj; }, - fromAminoMsg(object: MsgUpdateInstantiateConfigResponseAminoMsg): MsgUpdateInstantiateConfigResponse { - return MsgUpdateInstantiateConfigResponse.fromAmino(object.value); + fromAminoMsg(object: MsgSetGaslessContractsResponseAminoMsg): MsgSetGaslessContractsResponse { + return MsgSetGaslessContractsResponse.fromAmino(object.value); }, - toAminoMsg(message: MsgUpdateInstantiateConfigResponse): MsgUpdateInstantiateConfigResponseAminoMsg { + toAminoMsg(message: MsgSetGaslessContractsResponse): MsgSetGaslessContractsResponseAminoMsg { return { - type: "wasm/MsgUpdateInstantiateConfigResponse", - value: MsgUpdateInstantiateConfigResponse.toAmino(message) + type: "wasm/MsgSetGaslessContractsResponse", + value: MsgSetGaslessContractsResponse.toAmino(message) }; }, - fromProtoMsg(message: MsgUpdateInstantiateConfigResponseProtoMsg): MsgUpdateInstantiateConfigResponse { - return MsgUpdateInstantiateConfigResponse.decode(message.value); + fromProtoMsg(message: MsgSetGaslessContractsResponseProtoMsg): MsgSetGaslessContractsResponse { + return MsgSetGaslessContractsResponse.decode(message.value); }, - toProto(message: MsgUpdateInstantiateConfigResponse): Uint8Array { - return MsgUpdateInstantiateConfigResponse.encode(message).finish(); + toProto(message: MsgSetGaslessContractsResponse): Uint8Array { + return MsgSetGaslessContractsResponse.encode(message).finish(); }, - toProtoMsg(message: MsgUpdateInstantiateConfigResponse): MsgUpdateInstantiateConfigResponseProtoMsg { + toProtoMsg(message: MsgSetGaslessContractsResponse): MsgSetGaslessContractsResponseProtoMsg { return { - typeUrl: "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfigResponse", - value: MsgUpdateInstantiateConfigResponse.encode(message).finish() + typeUrl: "/cosmwasm.wasm.v1.MsgSetGaslessContractsResponse", + value: MsgSetGaslessContractsResponse.encode(message).finish() }; } }; \ No newline at end of file diff --git a/src/codegen/cosmwasm/wasm/v1/types.ts b/src/codegen/cosmwasm/wasm/v1/types.ts index 1c3888c..a02f382 100644 --- a/src/codegen/cosmwasm/wasm/v1/types.ts +++ b/src/codegen/cosmwasm/wasm/v1/types.ts @@ -8,11 +8,6 @@ export enum AccessType { ACCESS_TYPE_UNSPECIFIED = 0, /** ACCESS_TYPE_NOBODY - AccessTypeNobody forbidden */ ACCESS_TYPE_NOBODY = 1, - /** - * ACCESS_TYPE_ONLY_ADDRESS - AccessTypeOnlyAddress restricted to a single address - * Deprecated: use AccessTypeAnyOfAddresses instead - */ - ACCESS_TYPE_ONLY_ADDRESS = 2, /** ACCESS_TYPE_EVERYBODY - AccessTypeEverybody unrestricted */ ACCESS_TYPE_EVERYBODY = 3, /** ACCESS_TYPE_ANY_OF_ADDRESSES - AccessTypeAnyOfAddresses allow any of the addresses */ @@ -29,9 +24,6 @@ export function accessTypeFromJSON(object: any): AccessType { case 1: case "ACCESS_TYPE_NOBODY": return AccessType.ACCESS_TYPE_NOBODY; - case 2: - case "ACCESS_TYPE_ONLY_ADDRESS": - return AccessType.ACCESS_TYPE_ONLY_ADDRESS; case 3: case "ACCESS_TYPE_EVERYBODY": return AccessType.ACCESS_TYPE_EVERYBODY; @@ -50,8 +42,6 @@ export function accessTypeToJSON(object: AccessType): string { return "ACCESS_TYPE_UNSPECIFIED"; case AccessType.ACCESS_TYPE_NOBODY: return "ACCESS_TYPE_NOBODY"; - case AccessType.ACCESS_TYPE_ONLY_ADDRESS: - return "ACCESS_TYPE_ONLY_ADDRESS"; case AccessType.ACCESS_TYPE_EVERYBODY: return "ACCESS_TYPE_EVERYBODY"; case AccessType.ACCESS_TYPE_ANY_OF_ADDRESSES: @@ -133,11 +123,6 @@ export interface AccessTypeParamSDKType { /** AccessConfig access control type. */ export interface AccessConfig { permission: AccessType; - /** - * Address - * Deprecated: replaced by addresses - */ - address: string; addresses: string[]; } export interface AccessConfigProtoMsg { @@ -147,11 +132,6 @@ export interface AccessConfigProtoMsg { /** AccessConfig access control type. */ export interface AccessConfigAmino { permission?: AccessType; - /** - * Address - * Deprecated: replaced by addresses - */ - address?: string; addresses?: string[]; } export interface AccessConfigAminoMsg { @@ -161,7 +141,6 @@ export interface AccessConfigAminoMsg { /** AccessConfig access control type. */ export interface AccessConfigSDKType { permission: AccessType; - address: string; addresses: string[]; } /** Params defines the set of wasm parameters. */ @@ -175,7 +154,7 @@ export interface ParamsProtoMsg { } /** Params defines the set of wasm parameters. */ export interface ParamsAmino { - code_upload_access?: AccessConfigAmino; + code_upload_access: AccessConfigAmino; instantiate_default_permission?: AccessType; } export interface ParamsAminoMsg { @@ -207,7 +186,7 @@ export interface CodeInfoAmino { /** Creator address who initially stored the code */ creator?: string; /** InstantiateConfig access control to apply on contract creation, optional */ - instantiate_config?: AccessConfigAmino; + instantiate_config: AccessConfigAmino; } export interface CodeInfoAminoMsg { type: "wasm/CodeInfo"; @@ -449,7 +428,6 @@ export const AccessTypeParam = { function createBaseAccessConfig(): AccessConfig { return { permission: 0, - address: "", addresses: [] }; } @@ -459,9 +437,6 @@ export const AccessConfig = { if (message.permission !== 0) { writer.uint32(8).int32(message.permission); } - if (message.address !== "") { - writer.uint32(18).string(message.address); - } for (const v of message.addresses) { writer.uint32(26).string(v!); } @@ -477,9 +452,6 @@ export const AccessConfig = { case 1: message.permission = (reader.int32() as any); break; - case 2: - message.address = reader.string(); - break; case 3: message.addresses.push(reader.string()); break; @@ -493,7 +465,6 @@ export const AccessConfig = { fromPartial(object: Partial): AccessConfig { const message = createBaseAccessConfig(); message.permission = object.permission ?? 0; - message.address = object.address ?? ""; message.addresses = object.addresses?.map(e => e) || []; return message; }, @@ -502,16 +473,12 @@ export const AccessConfig = { if (object.permission !== undefined && object.permission !== null) { message.permission = object.permission; } - if (object.address !== undefined && object.address !== null) { - message.address = object.address; - } message.addresses = object.addresses?.map(e => e) || []; return message; }, toAmino(message: AccessConfig): AccessConfigAmino { const obj: any = {}; obj.permission = message.permission === 0 ? undefined : message.permission; - obj.address = message.address === "" ? undefined : message.address; if (message.addresses) { obj.addresses = message.addresses.map(e => e); } else { @@ -596,7 +563,7 @@ export const Params = { }, toAmino(message: Params): ParamsAmino { const obj: any = {}; - obj.code_upload_access = message.codeUploadAccess ? AccessConfig.toAmino(message.codeUploadAccess) : undefined; + obj.code_upload_access = message.codeUploadAccess ? AccessConfig.toAmino(message.codeUploadAccess) : AccessConfig.toAmino(AccessConfig.fromPartial({})); obj.instantiate_default_permission = message.instantiateDefaultPermission === 0 ? undefined : message.instantiateDefaultPermission; return obj; }, @@ -690,7 +657,7 @@ export const CodeInfo = { const obj: any = {}; obj.code_hash = message.codeHash ? base64FromBytes(message.codeHash) : undefined; obj.creator = message.creator === "" ? undefined : message.creator; - obj.instantiate_config = message.instantiateConfig ? AccessConfig.toAmino(message.instantiateConfig) : undefined; + obj.instantiate_config = message.instantiateConfig ? AccessConfig.toAmino(message.instantiateConfig) : AccessConfig.toAmino(AccessConfig.fromPartial({})); return obj; }, fromAminoMsg(object: CodeInfoAminoMsg): CodeInfo { diff --git a/src/codegen/cosmwasm/wasm/v1beta1/proposal_legacy_v1beta1.ts b/src/codegen/cosmwasm/wasm/v1beta1/proposal_legacy_v1beta1.ts new file mode 100644 index 0000000..8520c47 --- /dev/null +++ b/src/codegen/cosmwasm/wasm/v1beta1/proposal_legacy_v1beta1.ts @@ -0,0 +1,2655 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../binary"; +import { fromBase64, toBase64, toUtf8, fromUtf8 } from "@cosmjs/encoding"; +import { bytesFromBase64, base64FromBytes } from "../../../helpers"; +/** AccessTypeV1Beta1 permission types */ +export enum AccessTypeV1Beta1 { + /** ACCESS_TYPE_UNSPECIFIED - AccessTypeUnspecified placeholder for empty value */ + ACCESS_TYPE_UNSPECIFIED = 0, + /** ACCESS_TYPE_NOBODY - AccessTypeNobody forbidden */ + ACCESS_TYPE_NOBODY = 1, + /** ACCESS_TYPE_EVERYBODY - AccessTypeEverybody unrestricted */ + ACCESS_TYPE_EVERYBODY = 3, + /** ACCESS_TYPE_ANY_OF_ADDRESSES - AccessTypeAnyOfAddresses allow any of the addresses */ + ACCESS_TYPE_ANY_OF_ADDRESSES = 4, + UNRECOGNIZED = -1, +} +export const AccessTypeV1Beta1SDKType = AccessTypeV1Beta1; +export const AccessTypeV1Beta1Amino = AccessTypeV1Beta1; +export function accessTypeV1Beta1FromJSON(object: any): AccessTypeV1Beta1 { + switch (object) { + case 0: + case "ACCESS_TYPE_UNSPECIFIED": + return AccessTypeV1Beta1.ACCESS_TYPE_UNSPECIFIED; + case 1: + case "ACCESS_TYPE_NOBODY": + return AccessTypeV1Beta1.ACCESS_TYPE_NOBODY; + case 3: + case "ACCESS_TYPE_EVERYBODY": + return AccessTypeV1Beta1.ACCESS_TYPE_EVERYBODY; + case 4: + case "ACCESS_TYPE_ANY_OF_ADDRESSES": + return AccessTypeV1Beta1.ACCESS_TYPE_ANY_OF_ADDRESSES; + case -1: + case "UNRECOGNIZED": + default: + return AccessTypeV1Beta1.UNRECOGNIZED; + } +} +export function accessTypeV1Beta1ToJSON(object: AccessTypeV1Beta1): string { + switch (object) { + case AccessTypeV1Beta1.ACCESS_TYPE_UNSPECIFIED: + return "ACCESS_TYPE_UNSPECIFIED"; + case AccessTypeV1Beta1.ACCESS_TYPE_NOBODY: + return "ACCESS_TYPE_NOBODY"; + case AccessTypeV1Beta1.ACCESS_TYPE_EVERYBODY: + return "ACCESS_TYPE_EVERYBODY"; + case AccessTypeV1Beta1.ACCESS_TYPE_ANY_OF_ADDRESSES: + return "ACCESS_TYPE_ANY_OF_ADDRESSES"; + case AccessTypeV1Beta1.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit StoreCodeProposal. To submit WASM code to the system, + * a simple MsgStoreCode can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface StoreCodeProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + runAs: string; + /** WASMByteCode can be raw or gzip compressed */ + wasmByteCode: Uint8Array; + /** InstantiatePermission to apply on contract creation, optional */ + instantiatePermission?: AccessConfigV1Beta1; + /** UnpinCode code on upload, optional */ + unpinCode: boolean; + /** Source is the URL where the code is hosted */ + source: string; + /** + * Builder is the docker image used to build the code deterministically, used + * for smart contract verification + */ + builder: string; + /** + * CodeHash is the SHA256 sum of the code outputted by builder, used for smart + * contract verification + */ + codeHash: Uint8Array; +} +export interface StoreCodeProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1beta1.StoreCodeProposal"; + value: Uint8Array; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit StoreCodeProposal. To submit WASM code to the system, + * a simple MsgStoreCode can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface StoreCodeProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + run_as?: string; + /** WASMByteCode can be raw or gzip compressed */ + wasm_byte_code?: string; + /** InstantiatePermission to apply on contract creation, optional */ + instantiate_permission?: AccessConfigV1Beta1Amino; + /** UnpinCode code on upload, optional */ + unpin_code?: boolean; + /** Source is the URL where the code is hosted */ + source?: string; + /** + * Builder is the docker image used to build the code deterministically, used + * for smart contract verification + */ + builder?: string; + /** + * CodeHash is the SHA256 sum of the code outputted by builder, used for smart + * contract verification + */ + code_hash?: string; +} +export interface StoreCodeProposalAminoMsg { + type: "wasm/StoreCodeProposal"; + value: StoreCodeProposalAmino; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit StoreCodeProposal. To submit WASM code to the system, + * a simple MsgStoreCode can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface StoreCodeProposalSDKType { + title: string; + description: string; + run_as: string; + wasm_byte_code: Uint8Array; + instantiate_permission?: AccessConfigV1Beta1SDKType; + unpin_code: boolean; + source: string; + builder: string; + code_hash: Uint8Array; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit InstantiateContractProposal. To instantiate a contract, + * a simple MsgInstantiateContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface InstantiateContractProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + runAs: string; + /** Admin is an optional address that can execute migrations */ + admin: string; + /** CodeID is the reference to the stored WASM code */ + codeId: bigint; + /** Label is optional metadata to be stored with a constract instance. */ + label: string; + /** Msg json encoded message to be passed to the contract on instantiation */ + msg: Uint8Array; + /** Funds coins that are transferred to the contract on instantiation */ + funds: Coin[]; +} +export interface InstantiateContractProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1beta1.InstantiateContractProposal"; + value: Uint8Array; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit InstantiateContractProposal. To instantiate a contract, + * a simple MsgInstantiateContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface InstantiateContractProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + run_as?: string; + /** Admin is an optional address that can execute migrations */ + admin?: string; + /** CodeID is the reference to the stored WASM code */ + code_id?: string; + /** Label is optional metadata to be stored with a constract instance. */ + label?: string; + /** Msg json encoded message to be passed to the contract on instantiation */ + msg?: any; + /** Funds coins that are transferred to the contract on instantiation */ + funds: CoinAmino[]; +} +export interface InstantiateContractProposalAminoMsg { + type: "wasm/InstantiateContractProposal"; + value: InstantiateContractProposalAmino; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit InstantiateContractProposal. To instantiate a contract, + * a simple MsgInstantiateContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface InstantiateContractProposalSDKType { + title: string; + description: string; + run_as: string; + admin: string; + code_id: bigint; + label: string; + msg: Uint8Array; + funds: CoinSDKType[]; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit InstantiateContract2Proposal. To instantiate contract 2, + * a simple MsgInstantiateContract2 can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface InstantiateContract2Proposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** RunAs is the address that is passed to the contract's enviroment as sender */ + runAs: string; + /** Admin is an optional address that can execute migrations */ + admin: string; + /** CodeID is the reference to the stored WASM code */ + codeId: bigint; + /** Label is optional metadata to be stored with a constract instance. */ + label: string; + /** Msg json encode message to be passed to the contract on instantiation */ + msg: Uint8Array; + /** Funds coins that are transferred to the contract on instantiation */ + funds: Coin[]; + /** Salt is an arbitrary value provided by the sender. Size can be 1 to 64. */ + salt: Uint8Array; + /** + * FixMsg include the msg value into the hash for the predictable address. + * Default is false + */ + fixMsg: boolean; +} +export interface InstantiateContract2ProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1beta1.InstantiateContract2Proposal"; + value: Uint8Array; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit InstantiateContract2Proposal. To instantiate contract 2, + * a simple MsgInstantiateContract2 can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface InstantiateContract2ProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** RunAs is the address that is passed to the contract's enviroment as sender */ + run_as?: string; + /** Admin is an optional address that can execute migrations */ + admin?: string; + /** CodeID is the reference to the stored WASM code */ + code_id?: string; + /** Label is optional metadata to be stored with a constract instance. */ + label?: string; + /** Msg json encode message to be passed to the contract on instantiation */ + msg?: any; + /** Funds coins that are transferred to the contract on instantiation */ + funds: CoinAmino[]; + /** Salt is an arbitrary value provided by the sender. Size can be 1 to 64. */ + salt?: string; + /** + * FixMsg include the msg value into the hash for the predictable address. + * Default is false + */ + fix_msg?: boolean; +} +export interface InstantiateContract2ProposalAminoMsg { + type: "wasm/InstantiateContract2Proposal"; + value: InstantiateContract2ProposalAmino; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit InstantiateContract2Proposal. To instantiate contract 2, + * a simple MsgInstantiateContract2 can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface InstantiateContract2ProposalSDKType { + title: string; + description: string; + run_as: string; + admin: string; + code_id: bigint; + label: string; + msg: Uint8Array; + funds: CoinSDKType[]; + salt: Uint8Array; + fix_msg: boolean; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit MigrateContractProposal. To migrate a contract, + * a simple MsgMigrateContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface MigrateContractProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** Contract is the address of the smart contract */ + contract: string; + /** CodeID references the new WASM code */ + codeId: bigint; + /** Msg json encoded message to be passed to the contract on migration */ + msg: Uint8Array; +} +export interface MigrateContractProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1beta1.MigrateContractProposal"; + value: Uint8Array; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit MigrateContractProposal. To migrate a contract, + * a simple MsgMigrateContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface MigrateContractProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** Contract is the address of the smart contract */ + contract?: string; + /** CodeID references the new WASM code */ + code_id?: string; + /** Msg json encoded message to be passed to the contract on migration */ + msg?: any; +} +export interface MigrateContractProposalAminoMsg { + type: "wasm/MigrateContractProposal"; + value: MigrateContractProposalAmino; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit MigrateContractProposal. To migrate a contract, + * a simple MsgMigrateContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface MigrateContractProposalSDKType { + title: string; + description: string; + contract: string; + code_id: bigint; + msg: Uint8Array; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit SudoContractProposal. To call sudo on a contract, + * a simple MsgSudoContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface SudoContractProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** Contract is the address of the smart contract */ + contract: string; + /** Msg json encoded message to be passed to the contract as sudo */ + msg: Uint8Array; +} +export interface SudoContractProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1beta1.SudoContractProposal"; + value: Uint8Array; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit SudoContractProposal. To call sudo on a contract, + * a simple MsgSudoContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface SudoContractProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** Contract is the address of the smart contract */ + contract?: string; + /** Msg json encoded message to be passed to the contract as sudo */ + msg?: any; +} +export interface SudoContractProposalAminoMsg { + type: "wasm/SudoContractProposal"; + value: SudoContractProposalAmino; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit SudoContractProposal. To call sudo on a contract, + * a simple MsgSudoContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface SudoContractProposalSDKType { + title: string; + description: string; + contract: string; + msg: Uint8Array; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit ExecuteContractProposal. To call execute on a contract, + * a simple MsgExecuteContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface ExecuteContractProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + runAs: string; + /** Contract is the address of the smart contract */ + contract: string; + /** Msg json encoded message to be passed to the contract as execute */ + msg: Uint8Array; + /** Funds coins that are transferred to the contract on instantiation */ + funds: Coin[]; +} +export interface ExecuteContractProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1beta1.ExecuteContractProposal"; + value: Uint8Array; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit ExecuteContractProposal. To call execute on a contract, + * a simple MsgExecuteContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface ExecuteContractProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + run_as?: string; + /** Contract is the address of the smart contract */ + contract?: string; + /** Msg json encoded message to be passed to the contract as execute */ + msg?: any; + /** Funds coins that are transferred to the contract on instantiation */ + funds: CoinAmino[]; +} +export interface ExecuteContractProposalAminoMsg { + type: "wasm/ExecuteContractProposal"; + value: ExecuteContractProposalAmino; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit ExecuteContractProposal. To call execute on a contract, + * a simple MsgExecuteContract can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface ExecuteContractProposalSDKType { + title: string; + description: string; + run_as: string; + contract: string; + msg: Uint8Array; + funds: CoinSDKType[]; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UpdateAdminProposal. To set an admin for a contract, + * a simple MsgUpdateAdmin can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface UpdateAdminProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** NewAdmin address to be set */ + newAdmin: string; + /** Contract is the address of the smart contract */ + contract: string; +} +export interface UpdateAdminProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1beta1.UpdateAdminProposal"; + value: Uint8Array; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UpdateAdminProposal. To set an admin for a contract, + * a simple MsgUpdateAdmin can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface UpdateAdminProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** NewAdmin address to be set */ + new_admin?: string; + /** Contract is the address of the smart contract */ + contract?: string; +} +export interface UpdateAdminProposalAminoMsg { + type: "wasm/UpdateAdminProposal"; + value: UpdateAdminProposalAmino; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UpdateAdminProposal. To set an admin for a contract, + * a simple MsgUpdateAdmin can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface UpdateAdminProposalSDKType { + title: string; + description: string; + new_admin: string; + contract: string; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit ClearAdminProposal. To clear the admin of a contract, + * a simple MsgClearAdmin can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface ClearAdminProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** Contract is the address of the smart contract */ + contract: string; +} +export interface ClearAdminProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1beta1.ClearAdminProposal"; + value: Uint8Array; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit ClearAdminProposal. To clear the admin of a contract, + * a simple MsgClearAdmin can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface ClearAdminProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** Contract is the address of the smart contract */ + contract?: string; +} +export interface ClearAdminProposalAminoMsg { + type: "wasm/ClearAdminProposal"; + value: ClearAdminProposalAmino; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit ClearAdminProposal. To clear the admin of a contract, + * a simple MsgClearAdmin can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface ClearAdminProposalSDKType { + title: string; + description: string; + contract: string; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit PinCodesProposal. To pin a set of code ids in the wasmvm + * cache, a simple MsgPinCodes can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface PinCodesProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** CodeIDs references the new WASM codes */ + codeIds: bigint[]; +} +export interface PinCodesProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1beta1.PinCodesProposal"; + value: Uint8Array; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit PinCodesProposal. To pin a set of code ids in the wasmvm + * cache, a simple MsgPinCodes can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface PinCodesProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** CodeIDs references the new WASM codes */ + code_ids?: string[]; +} +export interface PinCodesProposalAminoMsg { + type: "wasm/PinCodesProposal"; + value: PinCodesProposalAmino; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit PinCodesProposal. To pin a set of code ids in the wasmvm + * cache, a simple MsgPinCodes can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface PinCodesProposalSDKType { + title: string; + description: string; + code_ids: bigint[]; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UnpinCodesProposal. To unpin a set of code ids in the wasmvm + * cache, a simple MsgUnpinCodes can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface UnpinCodesProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** CodeIDs references the WASM codes */ + codeIds: bigint[]; +} +export interface UnpinCodesProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1beta1.UnpinCodesProposal"; + value: Uint8Array; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UnpinCodesProposal. To unpin a set of code ids in the wasmvm + * cache, a simple MsgUnpinCodes can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface UnpinCodesProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** CodeIDs references the WASM codes */ + code_ids?: string[]; +} +export interface UnpinCodesProposalAminoMsg { + type: "wasm/UnpinCodesProposal"; + value: UnpinCodesProposalAmino; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UnpinCodesProposal. To unpin a set of code ids in the wasmvm + * cache, a simple MsgUnpinCodes can be invoked from the x/gov module via + * a v1 governance proposal. + */ +/** @deprecated */ +export interface UnpinCodesProposalSDKType { + title: string; + description: string; + code_ids: bigint[]; +} +/** + * AccessConfigUpdateV1Beta1 contains the code id and the access config to be + * applied. + */ +export interface AccessConfigUpdateV1Beta1 { + /** CodeID is the reference to the stored WASM code to be updated */ + codeId: bigint; + /** InstantiatePermission to apply to the set of code ids */ + instantiatePermission: AccessConfigV1Beta1; +} +export interface AccessConfigUpdateV1Beta1ProtoMsg { + typeUrl: "/cosmwasm.wasm.v1beta1.AccessConfigUpdateV1Beta1"; + value: Uint8Array; +} +/** + * AccessConfigUpdateV1Beta1 contains the code id and the access config to be + * applied. + */ +export interface AccessConfigUpdateV1Beta1Amino { + /** CodeID is the reference to the stored WASM code to be updated */ + code_id?: string; + /** InstantiatePermission to apply to the set of code ids */ + instantiate_permission: AccessConfigV1Beta1Amino; +} +export interface AccessConfigUpdateV1Beta1AminoMsg { + type: "wasm/AccessConfigUpdateV1Beta1"; + value: AccessConfigUpdateV1Beta1Amino; +} +/** + * AccessConfigUpdateV1Beta1 contains the code id and the access config to be + * applied. + */ +export interface AccessConfigUpdateV1Beta1SDKType { + code_id: bigint; + instantiate_permission: AccessConfigV1Beta1SDKType; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UpdateInstantiateConfigProposal. To update instantiate config + * to a set of code ids, a simple MsgUpdateInstantiateConfig can be invoked from + * the x/gov module via a v1 governance proposal. + */ +/** @deprecated */ +export interface UpdateInstantiateConfigProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** + * AccessConfigUpdateV1Beta1 contains the list of code ids and the access + * config to be applied. + */ + accessConfigUpdates: AccessConfigUpdateV1Beta1[]; +} +export interface UpdateInstantiateConfigProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1beta1.UpdateInstantiateConfigProposal"; + value: Uint8Array; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UpdateInstantiateConfigProposal. To update instantiate config + * to a set of code ids, a simple MsgUpdateInstantiateConfig can be invoked from + * the x/gov module via a v1 governance proposal. + */ +/** @deprecated */ +export interface UpdateInstantiateConfigProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** + * AccessConfigUpdateV1Beta1 contains the list of code ids and the access + * config to be applied. + */ + access_config_updates: AccessConfigUpdateV1Beta1Amino[]; +} +export interface UpdateInstantiateConfigProposalAminoMsg { + type: "wasm/UpdateInstantiateConfigProposal"; + value: UpdateInstantiateConfigProposalAmino; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit UpdateInstantiateConfigProposal. To update instantiate config + * to a set of code ids, a simple MsgUpdateInstantiateConfig can be invoked from + * the x/gov module via a v1 governance proposal. + */ +/** @deprecated */ +export interface UpdateInstantiateConfigProposalSDKType { + title: string; + description: string; + access_config_updates: AccessConfigUpdateV1Beta1SDKType[]; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit StoreAndInstantiateContractProposal. To store and instantiate + * the contract, a simple MsgStoreAndInstantiateContract can be invoked from + * the x/gov module via a v1 governance proposal. + */ +/** @deprecated */ +export interface StoreAndInstantiateContractProposal { + /** Title is a short summary */ + title: string; + /** Description is a human readable text */ + description: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + runAs: string; + /** WASMByteCode can be raw or gzip compressed */ + wasmByteCode: Uint8Array; + /** InstantiatePermission to apply on contract creation, optional */ + instantiatePermission?: AccessConfigV1Beta1; + /** UnpinCode code on upload, optional */ + unpinCode: boolean; + /** Admin is an optional address that can execute migrations */ + admin: string; + /** Label is optional metadata to be stored with a constract instance. */ + label: string; + /** Msg json encoded message to be passed to the contract on instantiation */ + msg: Uint8Array; + /** Funds coins that are transferred to the contract on instantiation */ + funds: Coin[]; + /** Source is the URL where the code is hosted */ + source: string; + /** + * Builder is the docker image used to build the code deterministically, used + * for smart contract verification + */ + builder: string; + /** + * CodeHash is the SHA256 sum of the code outputted by builder, used for smart + * contract verification + */ + codeHash: Uint8Array; +} +export interface StoreAndInstantiateContractProposalProtoMsg { + typeUrl: "/cosmwasm.wasm.v1beta1.StoreAndInstantiateContractProposal"; + value: Uint8Array; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit StoreAndInstantiateContractProposal. To store and instantiate + * the contract, a simple MsgStoreAndInstantiateContract can be invoked from + * the x/gov module via a v1 governance proposal. + */ +/** @deprecated */ +export interface StoreAndInstantiateContractProposalAmino { + /** Title is a short summary */ + title?: string; + /** Description is a human readable text */ + description?: string; + /** RunAs is the address that is passed to the contract's environment as sender */ + run_as?: string; + /** WASMByteCode can be raw or gzip compressed */ + wasm_byte_code?: string; + /** InstantiatePermission to apply on contract creation, optional */ + instantiate_permission?: AccessConfigV1Beta1Amino; + /** UnpinCode code on upload, optional */ + unpin_code?: boolean; + /** Admin is an optional address that can execute migrations */ + admin?: string; + /** Label is optional metadata to be stored with a constract instance. */ + label?: string; + /** Msg json encoded message to be passed to the contract on instantiation */ + msg?: any; + /** Funds coins that are transferred to the contract on instantiation */ + funds: CoinAmino[]; + /** Source is the URL where the code is hosted */ + source?: string; + /** + * Builder is the docker image used to build the code deterministically, used + * for smart contract verification + */ + builder?: string; + /** + * CodeHash is the SHA256 sum of the code outputted by builder, used for smart + * contract verification + */ + code_hash?: string; +} +export interface StoreAndInstantiateContractProposalAminoMsg { + type: "wasm/StoreAndInstantiateContractProposal"; + value: StoreAndInstantiateContractProposalAmino; +} +/** + * Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for + * an explicit StoreAndInstantiateContractProposal. To store and instantiate + * the contract, a simple MsgStoreAndInstantiateContract can be invoked from + * the x/gov module via a v1 governance proposal. + */ +/** @deprecated */ +export interface StoreAndInstantiateContractProposalSDKType { + title: string; + description: string; + run_as: string; + wasm_byte_code: Uint8Array; + instantiate_permission?: AccessConfigV1Beta1SDKType; + unpin_code: boolean; + admin: string; + label: string; + msg: Uint8Array; + funds: CoinSDKType[]; + source: string; + builder: string; + code_hash: Uint8Array; +} +/** AccessConfigV1Beta1 access control type. */ +export interface AccessConfigV1Beta1 { + permission: AccessTypeV1Beta1; + addresses: string[]; +} +export interface AccessConfigV1Beta1ProtoMsg { + typeUrl: "/cosmwasm.wasm.v1beta1.AccessConfigV1Beta1"; + value: Uint8Array; +} +/** AccessConfigV1Beta1 access control type. */ +export interface AccessConfigV1Beta1Amino { + permission?: AccessTypeV1Beta1; + addresses?: string[]; +} +export interface AccessConfigV1Beta1AminoMsg { + type: "wasm/AccessConfigV1Beta1"; + value: AccessConfigV1Beta1Amino; +} +/** AccessConfigV1Beta1 access control type. */ +export interface AccessConfigV1Beta1SDKType { + permission: AccessTypeV1Beta1; + addresses: string[]; +} +function createBaseStoreCodeProposal(): StoreCodeProposal { + return { + title: "", + description: "", + runAs: "", + wasmByteCode: new Uint8Array(), + instantiatePermission: undefined, + unpinCode: false, + source: "", + builder: "", + codeHash: new Uint8Array() + }; +} +export const StoreCodeProposal = { + typeUrl: "/cosmwasm.wasm.v1beta1.StoreCodeProposal", + encode(message: StoreCodeProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.runAs !== "") { + writer.uint32(26).string(message.runAs); + } + if (message.wasmByteCode.length !== 0) { + writer.uint32(34).bytes(message.wasmByteCode); + } + if (message.instantiatePermission !== undefined) { + AccessConfigV1Beta1.encode(message.instantiatePermission, writer.uint32(58).fork()).ldelim(); + } + if (message.unpinCode === true) { + writer.uint32(64).bool(message.unpinCode); + } + if (message.source !== "") { + writer.uint32(74).string(message.source); + } + if (message.builder !== "") { + writer.uint32(82).string(message.builder); + } + if (message.codeHash.length !== 0) { + writer.uint32(90).bytes(message.codeHash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StoreCodeProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStoreCodeProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.runAs = reader.string(); + break; + case 4: + message.wasmByteCode = reader.bytes(); + break; + case 7: + message.instantiatePermission = AccessConfigV1Beta1.decode(reader, reader.uint32()); + break; + case 8: + message.unpinCode = reader.bool(); + break; + case 9: + message.source = reader.string(); + break; + case 10: + message.builder = reader.string(); + break; + case 11: + message.codeHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StoreCodeProposal { + const message = createBaseStoreCodeProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.runAs = object.runAs ?? ""; + message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); + message.instantiatePermission = object.instantiatePermission !== undefined && object.instantiatePermission !== null ? AccessConfigV1Beta1.fromPartial(object.instantiatePermission) : undefined; + message.unpinCode = object.unpinCode ?? false; + message.source = object.source ?? ""; + message.builder = object.builder ?? ""; + message.codeHash = object.codeHash ?? new Uint8Array(); + return message; + }, + fromAmino(object: StoreCodeProposalAmino): StoreCodeProposal { + const message = createBaseStoreCodeProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.run_as !== undefined && object.run_as !== null) { + message.runAs = object.run_as; + } + if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { + message.wasmByteCode = fromBase64(object.wasm_byte_code); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfigV1Beta1.fromAmino(object.instantiate_permission); + } + if (object.unpin_code !== undefined && object.unpin_code !== null) { + message.unpinCode = object.unpin_code; + } + if (object.source !== undefined && object.source !== null) { + message.source = object.source; + } + if (object.builder !== undefined && object.builder !== null) { + message.builder = object.builder; + } + if (object.code_hash !== undefined && object.code_hash !== null) { + message.codeHash = bytesFromBase64(object.code_hash); + } + return message; + }, + toAmino(message: StoreCodeProposal): StoreCodeProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.run_as = message.runAs === "" ? undefined : message.runAs; + obj.wasm_byte_code = message.wasmByteCode ? toBase64(message.wasmByteCode) : undefined; + obj.instantiate_permission = message.instantiatePermission ? AccessConfigV1Beta1.toAmino(message.instantiatePermission) : undefined; + obj.unpin_code = message.unpinCode === false ? undefined : message.unpinCode; + obj.source = message.source === "" ? undefined : message.source; + obj.builder = message.builder === "" ? undefined : message.builder; + obj.code_hash = message.codeHash ? base64FromBytes(message.codeHash) : undefined; + return obj; + }, + fromAminoMsg(object: StoreCodeProposalAminoMsg): StoreCodeProposal { + return StoreCodeProposal.fromAmino(object.value); + }, + toAminoMsg(message: StoreCodeProposal): StoreCodeProposalAminoMsg { + return { + type: "wasm/StoreCodeProposal", + value: StoreCodeProposal.toAmino(message) + }; + }, + fromProtoMsg(message: StoreCodeProposalProtoMsg): StoreCodeProposal { + return StoreCodeProposal.decode(message.value); + }, + toProto(message: StoreCodeProposal): Uint8Array { + return StoreCodeProposal.encode(message).finish(); + }, + toProtoMsg(message: StoreCodeProposal): StoreCodeProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1beta1.StoreCodeProposal", + value: StoreCodeProposal.encode(message).finish() + }; + } +}; +function createBaseInstantiateContractProposal(): InstantiateContractProposal { + return { + title: "", + description: "", + runAs: "", + admin: "", + codeId: BigInt(0), + label: "", + msg: new Uint8Array(), + funds: [] + }; +} +export const InstantiateContractProposal = { + typeUrl: "/cosmwasm.wasm.v1beta1.InstantiateContractProposal", + encode(message: InstantiateContractProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.runAs !== "") { + writer.uint32(26).string(message.runAs); + } + if (message.admin !== "") { + writer.uint32(34).string(message.admin); + } + if (message.codeId !== BigInt(0)) { + writer.uint32(40).uint64(message.codeId); + } + if (message.label !== "") { + writer.uint32(50).string(message.label); + } + if (message.msg.length !== 0) { + writer.uint32(58).bytes(message.msg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(66).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): InstantiateContractProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInstantiateContractProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.runAs = reader.string(); + break; + case 4: + message.admin = reader.string(); + break; + case 5: + message.codeId = reader.uint64(); + break; + case 6: + message.label = reader.string(); + break; + case 7: + message.msg = reader.bytes(); + break; + case 8: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): InstantiateContractProposal { + const message = createBaseInstantiateContractProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.runAs = object.runAs ?? ""; + message.admin = object.admin ?? ""; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.label = object.label ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: InstantiateContractProposalAmino): InstantiateContractProposal { + const message = createBaseInstantiateContractProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.run_as !== undefined && object.run_as !== null) { + message.runAs = object.run_as; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: InstantiateContractProposal): InstantiateContractProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.run_as = message.runAs === "" ? undefined : message.runAs; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + obj.label = message.label === "" ? undefined : message.label; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.funds = message.funds; + } + return obj; + }, + fromAminoMsg(object: InstantiateContractProposalAminoMsg): InstantiateContractProposal { + return InstantiateContractProposal.fromAmino(object.value); + }, + toAminoMsg(message: InstantiateContractProposal): InstantiateContractProposalAminoMsg { + return { + type: "wasm/InstantiateContractProposal", + value: InstantiateContractProposal.toAmino(message) + }; + }, + fromProtoMsg(message: InstantiateContractProposalProtoMsg): InstantiateContractProposal { + return InstantiateContractProposal.decode(message.value); + }, + toProto(message: InstantiateContractProposal): Uint8Array { + return InstantiateContractProposal.encode(message).finish(); + }, + toProtoMsg(message: InstantiateContractProposal): InstantiateContractProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1beta1.InstantiateContractProposal", + value: InstantiateContractProposal.encode(message).finish() + }; + } +}; +function createBaseInstantiateContract2Proposal(): InstantiateContract2Proposal { + return { + title: "", + description: "", + runAs: "", + admin: "", + codeId: BigInt(0), + label: "", + msg: new Uint8Array(), + funds: [], + salt: new Uint8Array(), + fixMsg: false + }; +} +export const InstantiateContract2Proposal = { + typeUrl: "/cosmwasm.wasm.v1beta1.InstantiateContract2Proposal", + encode(message: InstantiateContract2Proposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.runAs !== "") { + writer.uint32(26).string(message.runAs); + } + if (message.admin !== "") { + writer.uint32(34).string(message.admin); + } + if (message.codeId !== BigInt(0)) { + writer.uint32(40).uint64(message.codeId); + } + if (message.label !== "") { + writer.uint32(50).string(message.label); + } + if (message.msg.length !== 0) { + writer.uint32(58).bytes(message.msg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(66).fork()).ldelim(); + } + if (message.salt.length !== 0) { + writer.uint32(74).bytes(message.salt); + } + if (message.fixMsg === true) { + writer.uint32(80).bool(message.fixMsg); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): InstantiateContract2Proposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInstantiateContract2Proposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.runAs = reader.string(); + break; + case 4: + message.admin = reader.string(); + break; + case 5: + message.codeId = reader.uint64(); + break; + case 6: + message.label = reader.string(); + break; + case 7: + message.msg = reader.bytes(); + break; + case 8: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + case 9: + message.salt = reader.bytes(); + break; + case 10: + message.fixMsg = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): InstantiateContract2Proposal { + const message = createBaseInstantiateContract2Proposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.runAs = object.runAs ?? ""; + message.admin = object.admin ?? ""; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.label = object.label ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; + message.salt = object.salt ?? new Uint8Array(); + message.fixMsg = object.fixMsg ?? false; + return message; + }, + fromAmino(object: InstantiateContract2ProposalAmino): InstantiateContract2Proposal { + const message = createBaseInstantiateContract2Proposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.run_as !== undefined && object.run_as !== null) { + message.runAs = object.run_as; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + if (object.salt !== undefined && object.salt !== null) { + message.salt = bytesFromBase64(object.salt); + } + if (object.fix_msg !== undefined && object.fix_msg !== null) { + message.fixMsg = object.fix_msg; + } + return message; + }, + toAmino(message: InstantiateContract2Proposal): InstantiateContract2ProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.run_as = message.runAs === "" ? undefined : message.runAs; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + obj.label = message.label === "" ? undefined : message.label; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.funds = message.funds; + } + obj.salt = message.salt ? base64FromBytes(message.salt) : undefined; + obj.fix_msg = message.fixMsg === false ? undefined : message.fixMsg; + return obj; + }, + fromAminoMsg(object: InstantiateContract2ProposalAminoMsg): InstantiateContract2Proposal { + return InstantiateContract2Proposal.fromAmino(object.value); + }, + toAminoMsg(message: InstantiateContract2Proposal): InstantiateContract2ProposalAminoMsg { + return { + type: "wasm/InstantiateContract2Proposal", + value: InstantiateContract2Proposal.toAmino(message) + }; + }, + fromProtoMsg(message: InstantiateContract2ProposalProtoMsg): InstantiateContract2Proposal { + return InstantiateContract2Proposal.decode(message.value); + }, + toProto(message: InstantiateContract2Proposal): Uint8Array { + return InstantiateContract2Proposal.encode(message).finish(); + }, + toProtoMsg(message: InstantiateContract2Proposal): InstantiateContract2ProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1beta1.InstantiateContract2Proposal", + value: InstantiateContract2Proposal.encode(message).finish() + }; + } +}; +function createBaseMigrateContractProposal(): MigrateContractProposal { + return { + title: "", + description: "", + contract: "", + codeId: BigInt(0), + msg: new Uint8Array() + }; +} +export const MigrateContractProposal = { + typeUrl: "/cosmwasm.wasm.v1beta1.MigrateContractProposal", + encode(message: MigrateContractProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.contract !== "") { + writer.uint32(34).string(message.contract); + } + if (message.codeId !== BigInt(0)) { + writer.uint32(40).uint64(message.codeId); + } + if (message.msg.length !== 0) { + writer.uint32(50).bytes(message.msg); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MigrateContractProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMigrateContractProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 4: + message.contract = reader.string(); + break; + case 5: + message.codeId = reader.uint64(); + break; + case 6: + message.msg = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MigrateContractProposal { + const message = createBaseMigrateContractProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.contract = object.contract ?? ""; + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.msg = object.msg ?? new Uint8Array(); + return message; + }, + fromAmino(object: MigrateContractProposalAmino): MigrateContractProposal { + const message = createBaseMigrateContractProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + return message; + }, + toAmino(message: MigrateContractProposal): MigrateContractProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.contract = message.contract === "" ? undefined : message.contract; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + return obj; + }, + fromAminoMsg(object: MigrateContractProposalAminoMsg): MigrateContractProposal { + return MigrateContractProposal.fromAmino(object.value); + }, + toAminoMsg(message: MigrateContractProposal): MigrateContractProposalAminoMsg { + return { + type: "wasm/MigrateContractProposal", + value: MigrateContractProposal.toAmino(message) + }; + }, + fromProtoMsg(message: MigrateContractProposalProtoMsg): MigrateContractProposal { + return MigrateContractProposal.decode(message.value); + }, + toProto(message: MigrateContractProposal): Uint8Array { + return MigrateContractProposal.encode(message).finish(); + }, + toProtoMsg(message: MigrateContractProposal): MigrateContractProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1beta1.MigrateContractProposal", + value: MigrateContractProposal.encode(message).finish() + }; + } +}; +function createBaseSudoContractProposal(): SudoContractProposal { + return { + title: "", + description: "", + contract: "", + msg: new Uint8Array() + }; +} +export const SudoContractProposal = { + typeUrl: "/cosmwasm.wasm.v1beta1.SudoContractProposal", + encode(message: SudoContractProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.contract !== "") { + writer.uint32(26).string(message.contract); + } + if (message.msg.length !== 0) { + writer.uint32(34).bytes(message.msg); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SudoContractProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSudoContractProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.contract = reader.string(); + break; + case 4: + message.msg = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SudoContractProposal { + const message = createBaseSudoContractProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.contract = object.contract ?? ""; + message.msg = object.msg ?? new Uint8Array(); + return message; + }, + fromAmino(object: SudoContractProposalAmino): SudoContractProposal { + const message = createBaseSudoContractProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + return message; + }, + toAmino(message: SudoContractProposal): SudoContractProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.contract = message.contract === "" ? undefined : message.contract; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + return obj; + }, + fromAminoMsg(object: SudoContractProposalAminoMsg): SudoContractProposal { + return SudoContractProposal.fromAmino(object.value); + }, + toAminoMsg(message: SudoContractProposal): SudoContractProposalAminoMsg { + return { + type: "wasm/SudoContractProposal", + value: SudoContractProposal.toAmino(message) + }; + }, + fromProtoMsg(message: SudoContractProposalProtoMsg): SudoContractProposal { + return SudoContractProposal.decode(message.value); + }, + toProto(message: SudoContractProposal): Uint8Array { + return SudoContractProposal.encode(message).finish(); + }, + toProtoMsg(message: SudoContractProposal): SudoContractProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1beta1.SudoContractProposal", + value: SudoContractProposal.encode(message).finish() + }; + } +}; +function createBaseExecuteContractProposal(): ExecuteContractProposal { + return { + title: "", + description: "", + runAs: "", + contract: "", + msg: new Uint8Array(), + funds: [] + }; +} +export const ExecuteContractProposal = { + typeUrl: "/cosmwasm.wasm.v1beta1.ExecuteContractProposal", + encode(message: ExecuteContractProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.runAs !== "") { + writer.uint32(26).string(message.runAs); + } + if (message.contract !== "") { + writer.uint32(34).string(message.contract); + } + if (message.msg.length !== 0) { + writer.uint32(42).bytes(message.msg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ExecuteContractProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExecuteContractProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.runAs = reader.string(); + break; + case 4: + message.contract = reader.string(); + break; + case 5: + message.msg = reader.bytes(); + break; + case 6: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ExecuteContractProposal { + const message = createBaseExecuteContractProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.runAs = object.runAs ?? ""; + message.contract = object.contract ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ExecuteContractProposalAmino): ExecuteContractProposal { + const message = createBaseExecuteContractProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.run_as !== undefined && object.run_as !== null) { + message.runAs = object.run_as; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + return message; + }, + toAmino(message: ExecuteContractProposal): ExecuteContractProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.run_as = message.runAs === "" ? undefined : message.runAs; + obj.contract = message.contract === "" ? undefined : message.contract; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.funds = message.funds; + } + return obj; + }, + fromAminoMsg(object: ExecuteContractProposalAminoMsg): ExecuteContractProposal { + return ExecuteContractProposal.fromAmino(object.value); + }, + toAminoMsg(message: ExecuteContractProposal): ExecuteContractProposalAminoMsg { + return { + type: "wasm/ExecuteContractProposal", + value: ExecuteContractProposal.toAmino(message) + }; + }, + fromProtoMsg(message: ExecuteContractProposalProtoMsg): ExecuteContractProposal { + return ExecuteContractProposal.decode(message.value); + }, + toProto(message: ExecuteContractProposal): Uint8Array { + return ExecuteContractProposal.encode(message).finish(); + }, + toProtoMsg(message: ExecuteContractProposal): ExecuteContractProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1beta1.ExecuteContractProposal", + value: ExecuteContractProposal.encode(message).finish() + }; + } +}; +function createBaseUpdateAdminProposal(): UpdateAdminProposal { + return { + title: "", + description: "", + newAdmin: "", + contract: "" + }; +} +export const UpdateAdminProposal = { + typeUrl: "/cosmwasm.wasm.v1beta1.UpdateAdminProposal", + encode(message: UpdateAdminProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.newAdmin !== "") { + writer.uint32(26).string(message.newAdmin); + } + if (message.contract !== "") { + writer.uint32(34).string(message.contract); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UpdateAdminProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateAdminProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.newAdmin = reader.string(); + break; + case 4: + message.contract = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UpdateAdminProposal { + const message = createBaseUpdateAdminProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.newAdmin = object.newAdmin ?? ""; + message.contract = object.contract ?? ""; + return message; + }, + fromAmino(object: UpdateAdminProposalAmino): UpdateAdminProposal { + const message = createBaseUpdateAdminProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.new_admin !== undefined && object.new_admin !== null) { + message.newAdmin = object.new_admin; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + return message; + }, + toAmino(message: UpdateAdminProposal): UpdateAdminProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.new_admin = message.newAdmin === "" ? undefined : message.newAdmin; + obj.contract = message.contract === "" ? undefined : message.contract; + return obj; + }, + fromAminoMsg(object: UpdateAdminProposalAminoMsg): UpdateAdminProposal { + return UpdateAdminProposal.fromAmino(object.value); + }, + toAminoMsg(message: UpdateAdminProposal): UpdateAdminProposalAminoMsg { + return { + type: "wasm/UpdateAdminProposal", + value: UpdateAdminProposal.toAmino(message) + }; + }, + fromProtoMsg(message: UpdateAdminProposalProtoMsg): UpdateAdminProposal { + return UpdateAdminProposal.decode(message.value); + }, + toProto(message: UpdateAdminProposal): Uint8Array { + return UpdateAdminProposal.encode(message).finish(); + }, + toProtoMsg(message: UpdateAdminProposal): UpdateAdminProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1beta1.UpdateAdminProposal", + value: UpdateAdminProposal.encode(message).finish() + }; + } +}; +function createBaseClearAdminProposal(): ClearAdminProposal { + return { + title: "", + description: "", + contract: "" + }; +} +export const ClearAdminProposal = { + typeUrl: "/cosmwasm.wasm.v1beta1.ClearAdminProposal", + encode(message: ClearAdminProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.contract !== "") { + writer.uint32(26).string(message.contract); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ClearAdminProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClearAdminProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.contract = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ClearAdminProposal { + const message = createBaseClearAdminProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.contract = object.contract ?? ""; + return message; + }, + fromAmino(object: ClearAdminProposalAmino): ClearAdminProposal { + const message = createBaseClearAdminProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.contract !== undefined && object.contract !== null) { + message.contract = object.contract; + } + return message; + }, + toAmino(message: ClearAdminProposal): ClearAdminProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.contract = message.contract === "" ? undefined : message.contract; + return obj; + }, + fromAminoMsg(object: ClearAdminProposalAminoMsg): ClearAdminProposal { + return ClearAdminProposal.fromAmino(object.value); + }, + toAminoMsg(message: ClearAdminProposal): ClearAdminProposalAminoMsg { + return { + type: "wasm/ClearAdminProposal", + value: ClearAdminProposal.toAmino(message) + }; + }, + fromProtoMsg(message: ClearAdminProposalProtoMsg): ClearAdminProposal { + return ClearAdminProposal.decode(message.value); + }, + toProto(message: ClearAdminProposal): Uint8Array { + return ClearAdminProposal.encode(message).finish(); + }, + toProtoMsg(message: ClearAdminProposal): ClearAdminProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1beta1.ClearAdminProposal", + value: ClearAdminProposal.encode(message).finish() + }; + } +}; +function createBasePinCodesProposal(): PinCodesProposal { + return { + title: "", + description: "", + codeIds: [] + }; +} +export const PinCodesProposal = { + typeUrl: "/cosmwasm.wasm.v1beta1.PinCodesProposal", + encode(message: PinCodesProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.codeIds) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): PinCodesProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePinCodesProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.codeIds.push(reader.uint64()); + } + } else { + message.codeIds.push(reader.uint64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): PinCodesProposal { + const message = createBasePinCodesProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.codeIds = object.codeIds?.map(e => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: PinCodesProposalAmino): PinCodesProposal { + const message = createBasePinCodesProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.codeIds = object.code_ids?.map(e => BigInt(e)) || []; + return message; + }, + toAmino(message: PinCodesProposal): PinCodesProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.codeIds) { + obj.code_ids = message.codeIds.map(e => e.toString()); + } else { + obj.code_ids = message.codeIds; + } + return obj; + }, + fromAminoMsg(object: PinCodesProposalAminoMsg): PinCodesProposal { + return PinCodesProposal.fromAmino(object.value); + }, + toAminoMsg(message: PinCodesProposal): PinCodesProposalAminoMsg { + return { + type: "wasm/PinCodesProposal", + value: PinCodesProposal.toAmino(message) + }; + }, + fromProtoMsg(message: PinCodesProposalProtoMsg): PinCodesProposal { + return PinCodesProposal.decode(message.value); + }, + toProto(message: PinCodesProposal): Uint8Array { + return PinCodesProposal.encode(message).finish(); + }, + toProtoMsg(message: PinCodesProposal): PinCodesProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1beta1.PinCodesProposal", + value: PinCodesProposal.encode(message).finish() + }; + } +}; +function createBaseUnpinCodesProposal(): UnpinCodesProposal { + return { + title: "", + description: "", + codeIds: [] + }; +} +export const UnpinCodesProposal = { + typeUrl: "/cosmwasm.wasm.v1beta1.UnpinCodesProposal", + encode(message: UnpinCodesProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + writer.uint32(26).fork(); + for (const v of message.codeIds) { + writer.uint64(v); + } + writer.ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UnpinCodesProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUnpinCodesProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.codeIds.push(reader.uint64()); + } + } else { + message.codeIds.push(reader.uint64()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UnpinCodesProposal { + const message = createBaseUnpinCodesProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.codeIds = object.codeIds?.map(e => BigInt(e.toString())) || []; + return message; + }, + fromAmino(object: UnpinCodesProposalAmino): UnpinCodesProposal { + const message = createBaseUnpinCodesProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.codeIds = object.code_ids?.map(e => BigInt(e)) || []; + return message; + }, + toAmino(message: UnpinCodesProposal): UnpinCodesProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.codeIds) { + obj.code_ids = message.codeIds.map(e => e.toString()); + } else { + obj.code_ids = message.codeIds; + } + return obj; + }, + fromAminoMsg(object: UnpinCodesProposalAminoMsg): UnpinCodesProposal { + return UnpinCodesProposal.fromAmino(object.value); + }, + toAminoMsg(message: UnpinCodesProposal): UnpinCodesProposalAminoMsg { + return { + type: "wasm/UnpinCodesProposal", + value: UnpinCodesProposal.toAmino(message) + }; + }, + fromProtoMsg(message: UnpinCodesProposalProtoMsg): UnpinCodesProposal { + return UnpinCodesProposal.decode(message.value); + }, + toProto(message: UnpinCodesProposal): Uint8Array { + return UnpinCodesProposal.encode(message).finish(); + }, + toProtoMsg(message: UnpinCodesProposal): UnpinCodesProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1beta1.UnpinCodesProposal", + value: UnpinCodesProposal.encode(message).finish() + }; + } +}; +function createBaseAccessConfigUpdateV1Beta1(): AccessConfigUpdateV1Beta1 { + return { + codeId: BigInt(0), + instantiatePermission: AccessConfigV1Beta1.fromPartial({}) + }; +} +export const AccessConfigUpdateV1Beta1 = { + typeUrl: "/cosmwasm.wasm.v1beta1.AccessConfigUpdateV1Beta1", + encode(message: AccessConfigUpdateV1Beta1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeId !== BigInt(0)) { + writer.uint32(8).uint64(message.codeId); + } + if (message.instantiatePermission !== undefined) { + AccessConfigV1Beta1.encode(message.instantiatePermission, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AccessConfigUpdateV1Beta1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccessConfigUpdateV1Beta1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeId = reader.uint64(); + break; + case 2: + message.instantiatePermission = AccessConfigV1Beta1.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AccessConfigUpdateV1Beta1 { + const message = createBaseAccessConfigUpdateV1Beta1(); + message.codeId = object.codeId !== undefined && object.codeId !== null ? BigInt(object.codeId.toString()) : BigInt(0); + message.instantiatePermission = object.instantiatePermission !== undefined && object.instantiatePermission !== null ? AccessConfigV1Beta1.fromPartial(object.instantiatePermission) : undefined; + return message; + }, + fromAmino(object: AccessConfigUpdateV1Beta1Amino): AccessConfigUpdateV1Beta1 { + const message = createBaseAccessConfigUpdateV1Beta1(); + if (object.code_id !== undefined && object.code_id !== null) { + message.codeId = BigInt(object.code_id); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfigV1Beta1.fromAmino(object.instantiate_permission); + } + return message; + }, + toAmino(message: AccessConfigUpdateV1Beta1): AccessConfigUpdateV1Beta1Amino { + const obj: any = {}; + obj.code_id = message.codeId !== BigInt(0) ? message.codeId.toString() : undefined; + obj.instantiate_permission = message.instantiatePermission ? AccessConfigV1Beta1.toAmino(message.instantiatePermission) : AccessConfigV1Beta1.toAmino(AccessConfigV1Beta1.fromPartial({})); + return obj; + }, + fromAminoMsg(object: AccessConfigUpdateV1Beta1AminoMsg): AccessConfigUpdateV1Beta1 { + return AccessConfigUpdateV1Beta1.fromAmino(object.value); + }, + toAminoMsg(message: AccessConfigUpdateV1Beta1): AccessConfigUpdateV1Beta1AminoMsg { + return { + type: "wasm/AccessConfigUpdateV1Beta1", + value: AccessConfigUpdateV1Beta1.toAmino(message) + }; + }, + fromProtoMsg(message: AccessConfigUpdateV1Beta1ProtoMsg): AccessConfigUpdateV1Beta1 { + return AccessConfigUpdateV1Beta1.decode(message.value); + }, + toProto(message: AccessConfigUpdateV1Beta1): Uint8Array { + return AccessConfigUpdateV1Beta1.encode(message).finish(); + }, + toProtoMsg(message: AccessConfigUpdateV1Beta1): AccessConfigUpdateV1Beta1ProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1beta1.AccessConfigUpdateV1Beta1", + value: AccessConfigUpdateV1Beta1.encode(message).finish() + }; + } +}; +function createBaseUpdateInstantiateConfigProposal(): UpdateInstantiateConfigProposal { + return { + title: "", + description: "", + accessConfigUpdates: [] + }; +} +export const UpdateInstantiateConfigProposal = { + typeUrl: "/cosmwasm.wasm.v1beta1.UpdateInstantiateConfigProposal", + encode(message: UpdateInstantiateConfigProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + for (const v of message.accessConfigUpdates) { + AccessConfigUpdateV1Beta1.encode(v!, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UpdateInstantiateConfigProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateInstantiateConfigProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.accessConfigUpdates.push(AccessConfigUpdateV1Beta1.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UpdateInstantiateConfigProposal { + const message = createBaseUpdateInstantiateConfigProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.accessConfigUpdates = object.accessConfigUpdates?.map(e => AccessConfigUpdateV1Beta1.fromPartial(e)) || []; + return message; + }, + fromAmino(object: UpdateInstantiateConfigProposalAmino): UpdateInstantiateConfigProposal { + const message = createBaseUpdateInstantiateConfigProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + message.accessConfigUpdates = object.access_config_updates?.map(e => AccessConfigUpdateV1Beta1.fromAmino(e)) || []; + return message; + }, + toAmino(message: UpdateInstantiateConfigProposal): UpdateInstantiateConfigProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + if (message.accessConfigUpdates) { + obj.access_config_updates = message.accessConfigUpdates.map(e => e ? AccessConfigUpdateV1Beta1.toAmino(e) : undefined); + } else { + obj.access_config_updates = message.accessConfigUpdates; + } + return obj; + }, + fromAminoMsg(object: UpdateInstantiateConfigProposalAminoMsg): UpdateInstantiateConfigProposal { + return UpdateInstantiateConfigProposal.fromAmino(object.value); + }, + toAminoMsg(message: UpdateInstantiateConfigProposal): UpdateInstantiateConfigProposalAminoMsg { + return { + type: "wasm/UpdateInstantiateConfigProposal", + value: UpdateInstantiateConfigProposal.toAmino(message) + }; + }, + fromProtoMsg(message: UpdateInstantiateConfigProposalProtoMsg): UpdateInstantiateConfigProposal { + return UpdateInstantiateConfigProposal.decode(message.value); + }, + toProto(message: UpdateInstantiateConfigProposal): Uint8Array { + return UpdateInstantiateConfigProposal.encode(message).finish(); + }, + toProtoMsg(message: UpdateInstantiateConfigProposal): UpdateInstantiateConfigProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1beta1.UpdateInstantiateConfigProposal", + value: UpdateInstantiateConfigProposal.encode(message).finish() + }; + } +}; +function createBaseStoreAndInstantiateContractProposal(): StoreAndInstantiateContractProposal { + return { + title: "", + description: "", + runAs: "", + wasmByteCode: new Uint8Array(), + instantiatePermission: undefined, + unpinCode: false, + admin: "", + label: "", + msg: new Uint8Array(), + funds: [], + source: "", + builder: "", + codeHash: new Uint8Array() + }; +} +export const StoreAndInstantiateContractProposal = { + typeUrl: "/cosmwasm.wasm.v1beta1.StoreAndInstantiateContractProposal", + encode(message: StoreAndInstantiateContractProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.runAs !== "") { + writer.uint32(26).string(message.runAs); + } + if (message.wasmByteCode.length !== 0) { + writer.uint32(34).bytes(message.wasmByteCode); + } + if (message.instantiatePermission !== undefined) { + AccessConfigV1Beta1.encode(message.instantiatePermission, writer.uint32(42).fork()).ldelim(); + } + if (message.unpinCode === true) { + writer.uint32(48).bool(message.unpinCode); + } + if (message.admin !== "") { + writer.uint32(58).string(message.admin); + } + if (message.label !== "") { + writer.uint32(66).string(message.label); + } + if (message.msg.length !== 0) { + writer.uint32(74).bytes(message.msg); + } + for (const v of message.funds) { + Coin.encode(v!, writer.uint32(82).fork()).ldelim(); + } + if (message.source !== "") { + writer.uint32(90).string(message.source); + } + if (message.builder !== "") { + writer.uint32(98).string(message.builder); + } + if (message.codeHash.length !== 0) { + writer.uint32(106).bytes(message.codeHash); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): StoreAndInstantiateContractProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStoreAndInstantiateContractProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.runAs = reader.string(); + break; + case 4: + message.wasmByteCode = reader.bytes(); + break; + case 5: + message.instantiatePermission = AccessConfigV1Beta1.decode(reader, reader.uint32()); + break; + case 6: + message.unpinCode = reader.bool(); + break; + case 7: + message.admin = reader.string(); + break; + case 8: + message.label = reader.string(); + break; + case 9: + message.msg = reader.bytes(); + break; + case 10: + message.funds.push(Coin.decode(reader, reader.uint32())); + break; + case 11: + message.source = reader.string(); + break; + case 12: + message.builder = reader.string(); + break; + case 13: + message.codeHash = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): StoreAndInstantiateContractProposal { + const message = createBaseStoreAndInstantiateContractProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.runAs = object.runAs ?? ""; + message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); + message.instantiatePermission = object.instantiatePermission !== undefined && object.instantiatePermission !== null ? AccessConfigV1Beta1.fromPartial(object.instantiatePermission) : undefined; + message.unpinCode = object.unpinCode ?? false; + message.admin = object.admin ?? ""; + message.label = object.label ?? ""; + message.msg = object.msg ?? new Uint8Array(); + message.funds = object.funds?.map(e => Coin.fromPartial(e)) || []; + message.source = object.source ?? ""; + message.builder = object.builder ?? ""; + message.codeHash = object.codeHash ?? new Uint8Array(); + return message; + }, + fromAmino(object: StoreAndInstantiateContractProposalAmino): StoreAndInstantiateContractProposal { + const message = createBaseStoreAndInstantiateContractProposal(); + if (object.title !== undefined && object.title !== null) { + message.title = object.title; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } + if (object.run_as !== undefined && object.run_as !== null) { + message.runAs = object.run_as; + } + if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { + message.wasmByteCode = fromBase64(object.wasm_byte_code); + } + if (object.instantiate_permission !== undefined && object.instantiate_permission !== null) { + message.instantiatePermission = AccessConfigV1Beta1.fromAmino(object.instantiate_permission); + } + if (object.unpin_code !== undefined && object.unpin_code !== null) { + message.unpinCode = object.unpin_code; + } + if (object.admin !== undefined && object.admin !== null) { + message.admin = object.admin; + } + if (object.label !== undefined && object.label !== null) { + message.label = object.label; + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = toUtf8(JSON.stringify(object.msg)); + } + message.funds = object.funds?.map(e => Coin.fromAmino(e)) || []; + if (object.source !== undefined && object.source !== null) { + message.source = object.source; + } + if (object.builder !== undefined && object.builder !== null) { + message.builder = object.builder; + } + if (object.code_hash !== undefined && object.code_hash !== null) { + message.codeHash = bytesFromBase64(object.code_hash); + } + return message; + }, + toAmino(message: StoreAndInstantiateContractProposal): StoreAndInstantiateContractProposalAmino { + const obj: any = {}; + obj.title = message.title === "" ? undefined : message.title; + obj.description = message.description === "" ? undefined : message.description; + obj.run_as = message.runAs === "" ? undefined : message.runAs; + obj.wasm_byte_code = message.wasmByteCode ? toBase64(message.wasmByteCode) : undefined; + obj.instantiate_permission = message.instantiatePermission ? AccessConfigV1Beta1.toAmino(message.instantiatePermission) : undefined; + obj.unpin_code = message.unpinCode === false ? undefined : message.unpinCode; + obj.admin = message.admin === "" ? undefined : message.admin; + obj.label = message.label === "" ? undefined : message.label; + obj.msg = message.msg ? JSON.parse(fromUtf8(message.msg)) : undefined; + if (message.funds) { + obj.funds = message.funds.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.funds = message.funds; + } + obj.source = message.source === "" ? undefined : message.source; + obj.builder = message.builder === "" ? undefined : message.builder; + obj.code_hash = message.codeHash ? base64FromBytes(message.codeHash) : undefined; + return obj; + }, + fromAminoMsg(object: StoreAndInstantiateContractProposalAminoMsg): StoreAndInstantiateContractProposal { + return StoreAndInstantiateContractProposal.fromAmino(object.value); + }, + toAminoMsg(message: StoreAndInstantiateContractProposal): StoreAndInstantiateContractProposalAminoMsg { + return { + type: "wasm/StoreAndInstantiateContractProposal", + value: StoreAndInstantiateContractProposal.toAmino(message) + }; + }, + fromProtoMsg(message: StoreAndInstantiateContractProposalProtoMsg): StoreAndInstantiateContractProposal { + return StoreAndInstantiateContractProposal.decode(message.value); + }, + toProto(message: StoreAndInstantiateContractProposal): Uint8Array { + return StoreAndInstantiateContractProposal.encode(message).finish(); + }, + toProtoMsg(message: StoreAndInstantiateContractProposal): StoreAndInstantiateContractProposalProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1beta1.StoreAndInstantiateContractProposal", + value: StoreAndInstantiateContractProposal.encode(message).finish() + }; + } +}; +function createBaseAccessConfigV1Beta1(): AccessConfigV1Beta1 { + return { + permission: 0, + addresses: [] + }; +} +export const AccessConfigV1Beta1 = { + typeUrl: "/cosmwasm.wasm.v1beta1.AccessConfigV1Beta1", + encode(message: AccessConfigV1Beta1, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.permission !== 0) { + writer.uint32(8).int32(message.permission); + } + for (const v of message.addresses) { + writer.uint32(26).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): AccessConfigV1Beta1 { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccessConfigV1Beta1(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.permission = (reader.int32() as any); + break; + case 3: + message.addresses.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): AccessConfigV1Beta1 { + const message = createBaseAccessConfigV1Beta1(); + message.permission = object.permission ?? 0; + message.addresses = object.addresses?.map(e => e) || []; + return message; + }, + fromAmino(object: AccessConfigV1Beta1Amino): AccessConfigV1Beta1 { + const message = createBaseAccessConfigV1Beta1(); + if (object.permission !== undefined && object.permission !== null) { + message.permission = object.permission; + } + message.addresses = object.addresses?.map(e => e) || []; + return message; + }, + toAmino(message: AccessConfigV1Beta1): AccessConfigV1Beta1Amino { + const obj: any = {}; + obj.permission = message.permission === 0 ? undefined : message.permission; + if (message.addresses) { + obj.addresses = message.addresses.map(e => e); + } else { + obj.addresses = message.addresses; + } + return obj; + }, + fromAminoMsg(object: AccessConfigV1Beta1AminoMsg): AccessConfigV1Beta1 { + return AccessConfigV1Beta1.fromAmino(object.value); + }, + toAminoMsg(message: AccessConfigV1Beta1): AccessConfigV1Beta1AminoMsg { + return { + type: "wasm/AccessConfigV1Beta1", + value: AccessConfigV1Beta1.toAmino(message) + }; + }, + fromProtoMsg(message: AccessConfigV1Beta1ProtoMsg): AccessConfigV1Beta1 { + return AccessConfigV1Beta1.decode(message.value); + }, + toProto(message: AccessConfigV1Beta1): Uint8Array { + return AccessConfigV1Beta1.encode(message).finish(); + }, + toProtoMsg(message: AccessConfigV1Beta1): AccessConfigV1Beta1ProtoMsg { + return { + typeUrl: "/cosmwasm.wasm.v1beta1.AccessConfigV1Beta1", + value: AccessConfigV1Beta1.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/gogoproto/bundle.ts b/src/codegen/gogoproto/bundle.ts index 81c0534..c66efa7 100644 --- a/src/codegen/gogoproto/bundle.ts +++ b/src/codegen/gogoproto/bundle.ts @@ -1,4 +1,4 @@ -import * as _88 from "./gogo"; +import * as _153 from "./gogo"; export const gogoproto = { - ..._88 + ..._153 }; \ No newline at end of file diff --git a/src/codegen/google/bundle.ts b/src/codegen/google/bundle.ts index a6c7690..004f0f5 100644 --- a/src/codegen/google/bundle.ts +++ b/src/codegen/google/bundle.ts @@ -1,22 +1,20 @@ -import * as _80 from "../descriptor"; -import * as _81 from "./protobuf/any"; -import * as _82 from "./protobuf/descriptor"; -import * as _83 from "./protobuf/timestamp"; -import * as _84 from "./protobuf/duration"; -import * as _85 from "./api/annotations"; -import * as _86 from "./api/http"; -import * as _87 from "./api/httpbody"; +import * as _154 from "./api/annotations"; +import * as _155 from "./api/http"; +import * as _156 from "./api/httpbody"; +import * as _157 from "./protobuf/any"; +import * as _158 from "./protobuf/descriptor"; +import * as _159 from "./protobuf/timestamp"; +import * as _160 from "./protobuf/duration"; export namespace google { - export const protobuf = { - ..._80, - ..._81, - ..._82, - ..._83, - ..._84 - }; export const api = { - ..._85, - ..._86, - ..._87 + ..._154, + ..._155, + ..._156 + }; + export const protobuf = { + ..._157, + ..._158, + ..._159, + ..._160 }; } \ No newline at end of file diff --git a/src/codegen/ibc/applications/fee/v1/query.ts b/src/codegen/ibc/applications/fee/v1/query.ts index 0dac4cf..2a179f2 100644 --- a/src/codegen/ibc/applications/fee/v1/query.ts +++ b/src/codegen/ibc/applications/fee/v1/query.ts @@ -1,4 +1,4 @@ -import { PageRequest, PageRequestAmino, PageRequestSDKType } from "../../../../cosmos/base/query/v1beta1/pagination"; +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../../cosmos/base/query/v1beta1/pagination"; import { PacketId, PacketIdAmino, PacketIdSDKType } from "../../../core/channel/v1/channel"; import { IdentifiedPacketFees, IdentifiedPacketFeesAmino, IdentifiedPacketFeesSDKType } from "./fee"; import { Coin, CoinAmino, CoinSDKType } from "../../../../cosmos/base/v1beta1/coin"; @@ -35,6 +35,8 @@ export interface QueryIncentivizedPacketsRequestSDKType { export interface QueryIncentivizedPacketsResponse { /** list of identified fees for incentivized packets */ incentivizedPackets: IdentifiedPacketFees[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; } export interface QueryIncentivizedPacketsResponseProtoMsg { typeUrl: "/ibc.applications.fee.v1.QueryIncentivizedPacketsResponse"; @@ -44,6 +46,8 @@ export interface QueryIncentivizedPacketsResponseProtoMsg { export interface QueryIncentivizedPacketsResponseAmino { /** list of identified fees for incentivized packets */ incentivized_packets?: IdentifiedPacketFeesAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; } export interface QueryIncentivizedPacketsResponseAminoMsg { type: "cosmos-sdk/QueryIncentivizedPacketsResponse"; @@ -52,6 +56,7 @@ export interface QueryIncentivizedPacketsResponseAminoMsg { /** QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPackets rpc */ export interface QueryIncentivizedPacketsResponseSDKType { incentivized_packets: IdentifiedPacketFeesSDKType[]; + pagination?: PageResponseSDKType; } /** QueryIncentivizedPacketRequest defines the request type for the IncentivizedPacket rpc */ export interface QueryIncentivizedPacketRequest { @@ -148,6 +153,8 @@ export interface QueryIncentivizedPacketsForChannelRequestSDKType { export interface QueryIncentivizedPacketsForChannelResponse { /** Map of all incentivized_packets */ incentivizedPackets: IdentifiedPacketFees[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; } export interface QueryIncentivizedPacketsForChannelResponseProtoMsg { typeUrl: "/ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse"; @@ -157,6 +164,8 @@ export interface QueryIncentivizedPacketsForChannelResponseProtoMsg { export interface QueryIncentivizedPacketsForChannelResponseAmino { /** Map of all incentivized_packets */ incentivized_packets?: IdentifiedPacketFeesAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; } export interface QueryIncentivizedPacketsForChannelResponseAminoMsg { type: "cosmos-sdk/QueryIncentivizedPacketsForChannelResponse"; @@ -165,6 +174,7 @@ export interface QueryIncentivizedPacketsForChannelResponseAminoMsg { /** QueryIncentivizedPacketsResponse defines the response type for the incentivized packets RPC */ export interface QueryIncentivizedPacketsForChannelResponseSDKType { incentivized_packets: IdentifiedPacketFeesSDKType[]; + pagination?: PageResponseSDKType; } /** QueryTotalRecvFeesRequest defines the request type for the TotalRecvFees rpc */ export interface QueryTotalRecvFeesRequest { @@ -427,6 +437,8 @@ export interface QueryFeeEnabledChannelsRequestSDKType { export interface QueryFeeEnabledChannelsResponse { /** list of fee enabled channels */ feeEnabledChannels: FeeEnabledChannel[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; } export interface QueryFeeEnabledChannelsResponseProtoMsg { typeUrl: "/ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse"; @@ -436,6 +448,8 @@ export interface QueryFeeEnabledChannelsResponseProtoMsg { export interface QueryFeeEnabledChannelsResponseAmino { /** list of fee enabled channels */ fee_enabled_channels?: FeeEnabledChannelAmino[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; } export interface QueryFeeEnabledChannelsResponseAminoMsg { type: "cosmos-sdk/QueryFeeEnabledChannelsResponse"; @@ -444,6 +458,7 @@ export interface QueryFeeEnabledChannelsResponseAminoMsg { /** QueryFeeEnabledChannelsResponse defines the response type for the FeeEnabledChannels rpc */ export interface QueryFeeEnabledChannelsResponseSDKType { fee_enabled_channels: FeeEnabledChannelSDKType[]; + pagination?: PageResponseSDKType; } /** QueryFeeEnabledChannelRequest defines the request type for the FeeEnabledChannel rpc */ export interface QueryFeeEnabledChannelRequest { @@ -577,7 +592,8 @@ export const QueryIncentivizedPacketsRequest = { }; function createBaseQueryIncentivizedPacketsResponse(): QueryIncentivizedPacketsResponse { return { - incentivizedPackets: [] + incentivizedPackets: [], + pagination: undefined }; } export const QueryIncentivizedPacketsResponse = { @@ -586,6 +602,9 @@ export const QueryIncentivizedPacketsResponse = { for (const v of message.incentivizedPackets) { IdentifiedPacketFees.encode(v!, writer.uint32(10).fork()).ldelim(); } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryIncentivizedPacketsResponse { @@ -598,6 +617,9 @@ export const QueryIncentivizedPacketsResponse = { case 1: message.incentivizedPackets.push(IdentifiedPacketFees.decode(reader, reader.uint32())); break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -608,11 +630,15 @@ export const QueryIncentivizedPacketsResponse = { fromPartial(object: Partial): QueryIncentivizedPacketsResponse { const message = createBaseQueryIncentivizedPacketsResponse(); message.incentivizedPackets = object.incentivizedPackets?.map(e => IdentifiedPacketFees.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: QueryIncentivizedPacketsResponseAmino): QueryIncentivizedPacketsResponse { const message = createBaseQueryIncentivizedPacketsResponse(); message.incentivizedPackets = object.incentivized_packets?.map(e => IdentifiedPacketFees.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } return message; }, toAmino(message: QueryIncentivizedPacketsResponse): QueryIncentivizedPacketsResponseAmino { @@ -622,6 +648,7 @@ export const QueryIncentivizedPacketsResponse = { } else { obj.incentivized_packets = message.incentivizedPackets; } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; }, fromAminoMsg(object: QueryIncentivizedPacketsResponseAminoMsg): QueryIncentivizedPacketsResponse { @@ -903,7 +930,8 @@ export const QueryIncentivizedPacketsForChannelRequest = { }; function createBaseQueryIncentivizedPacketsForChannelResponse(): QueryIncentivizedPacketsForChannelResponse { return { - incentivizedPackets: [] + incentivizedPackets: [], + pagination: undefined }; } export const QueryIncentivizedPacketsForChannelResponse = { @@ -912,6 +940,9 @@ export const QueryIncentivizedPacketsForChannelResponse = { for (const v of message.incentivizedPackets) { IdentifiedPacketFees.encode(v!, writer.uint32(10).fork()).ldelim(); } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryIncentivizedPacketsForChannelResponse { @@ -924,6 +955,9 @@ export const QueryIncentivizedPacketsForChannelResponse = { case 1: message.incentivizedPackets.push(IdentifiedPacketFees.decode(reader, reader.uint32())); break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -934,11 +968,15 @@ export const QueryIncentivizedPacketsForChannelResponse = { fromPartial(object: Partial): QueryIncentivizedPacketsForChannelResponse { const message = createBaseQueryIncentivizedPacketsForChannelResponse(); message.incentivizedPackets = object.incentivizedPackets?.map(e => IdentifiedPacketFees.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: QueryIncentivizedPacketsForChannelResponseAmino): QueryIncentivizedPacketsForChannelResponse { const message = createBaseQueryIncentivizedPacketsForChannelResponse(); message.incentivizedPackets = object.incentivized_packets?.map(e => IdentifiedPacketFees.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } return message; }, toAmino(message: QueryIncentivizedPacketsForChannelResponse): QueryIncentivizedPacketsForChannelResponseAmino { @@ -948,6 +986,7 @@ export const QueryIncentivizedPacketsForChannelResponse = { } else { obj.incentivized_packets = message.incentivizedPackets; } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; }, fromAminoMsg(object: QueryIncentivizedPacketsForChannelResponseAminoMsg): QueryIncentivizedPacketsForChannelResponse { @@ -1775,7 +1814,8 @@ export const QueryFeeEnabledChannelsRequest = { }; function createBaseQueryFeeEnabledChannelsResponse(): QueryFeeEnabledChannelsResponse { return { - feeEnabledChannels: [] + feeEnabledChannels: [], + pagination: undefined }; } export const QueryFeeEnabledChannelsResponse = { @@ -1784,6 +1824,9 @@ export const QueryFeeEnabledChannelsResponse = { for (const v of message.feeEnabledChannels) { FeeEnabledChannel.encode(v!, writer.uint32(10).fork()).ldelim(); } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryFeeEnabledChannelsResponse { @@ -1796,6 +1839,9 @@ export const QueryFeeEnabledChannelsResponse = { case 1: message.feeEnabledChannels.push(FeeEnabledChannel.decode(reader, reader.uint32())); break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -1806,11 +1852,15 @@ export const QueryFeeEnabledChannelsResponse = { fromPartial(object: Partial): QueryFeeEnabledChannelsResponse { const message = createBaseQueryFeeEnabledChannelsResponse(); message.feeEnabledChannels = object.feeEnabledChannels?.map(e => FeeEnabledChannel.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; return message; }, fromAmino(object: QueryFeeEnabledChannelsResponseAmino): QueryFeeEnabledChannelsResponse { const message = createBaseQueryFeeEnabledChannelsResponse(); message.feeEnabledChannels = object.fee_enabled_channels?.map(e => FeeEnabledChannel.fromAmino(e)) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } return message; }, toAmino(message: QueryFeeEnabledChannelsResponse): QueryFeeEnabledChannelsResponseAmino { @@ -1820,6 +1870,7 @@ export const QueryFeeEnabledChannelsResponse = { } else { obj.fee_enabled_channels = message.feeEnabledChannels; } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; return obj; }, fromAminoMsg(object: QueryFeeEnabledChannelsResponseAminoMsg): QueryFeeEnabledChannelsResponse { diff --git a/src/codegen/ibc/applications/fee/v1/tx.ts b/src/codegen/ibc/applications/fee/v1/tx.ts index 9ecf3ad..86a650b 100644 --- a/src/codegen/ibc/applications/fee/v1/tx.ts +++ b/src/codegen/ibc/applications/fee/v1/tx.ts @@ -131,7 +131,7 @@ export interface MsgPayPacketFeeProtoMsg { */ export interface MsgPayPacketFeeAmino { /** fee encapsulates the recv, ack and timeout fees associated with an IBC packet */ - fee?: FeeAmino; + fee: FeeAmino; /** the source port unique identifier */ source_port_id?: string; /** the source channel unique identifer */ @@ -191,9 +191,9 @@ export interface MsgPayPacketFeeAsyncProtoMsg { */ export interface MsgPayPacketFeeAsyncAmino { /** unique packet identifier comprised of the channel ID, port ID and sequence */ - packet_id?: PacketIdAmino; + packet_id: PacketIdAmino; /** the packet fee associated with a particular IBC packet */ - packet_fee?: PacketFeeAmino; + packet_fee: PacketFeeAmino; } export interface MsgPayPacketFeeAsyncAminoMsg { type: "cosmos-sdk/MsgPayPacketFeeAsync"; @@ -629,7 +629,7 @@ export const MsgPayPacketFee = { }, toAmino(message: MsgPayPacketFee): MsgPayPacketFeeAmino { const obj: any = {}; - obj.fee = message.fee ? Fee.toAmino(message.fee) : undefined; + obj.fee = message.fee ? Fee.toAmino(message.fee) : Fee.toAmino(Fee.fromPartial({})); obj.source_port_id = message.sourcePortId === "" ? undefined : message.sourcePortId; obj.source_channel_id = message.sourceChannelId === "" ? undefined : message.sourceChannelId; obj.signer = message.signer === "" ? undefined : message.signer; @@ -773,8 +773,8 @@ export const MsgPayPacketFeeAsync = { }, toAmino(message: MsgPayPacketFeeAsync): MsgPayPacketFeeAsyncAmino { const obj: any = {}; - obj.packet_id = message.packetId ? PacketId.toAmino(message.packetId) : undefined; - obj.packet_fee = message.packetFee ? PacketFee.toAmino(message.packetFee) : undefined; + obj.packet_id = message.packetId ? PacketId.toAmino(message.packetId) : PacketId.toAmino(PacketId.fromPartial({})); + obj.packet_fee = message.packetFee ? PacketFee.toAmino(message.packetFee) : PacketFee.toAmino(PacketFee.fromPartial({})); return obj; }, fromAminoMsg(object: MsgPayPacketFeeAsyncAminoMsg): MsgPayPacketFeeAsync { diff --git a/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.amino.ts b/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.amino.ts new file mode 100644 index 0000000..3076fe1 --- /dev/null +++ b/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.amino.ts @@ -0,0 +1,18 @@ +import { MsgRegisterInterchainAccount, MsgSendTx, MsgUpdateParams } from "./tx"; +export const AminoConverter = { + "/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount": { + aminoType: "cosmos-sdk/MsgRegisterInterchainAccount", + toAmino: MsgRegisterInterchainAccount.toAmino, + fromAmino: MsgRegisterInterchainAccount.fromAmino + }, + "/ibc.applications.interchain_accounts.controller.v1.MsgSendTx": { + aminoType: "cosmos-sdk/MsgSendTx", + toAmino: MsgSendTx.toAmino, + fromAmino: MsgSendTx.fromAmino + }, + "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams": { + aminoType: "cosmos-sdk/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + } +}; \ No newline at end of file diff --git a/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.registry.ts b/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.registry.ts new file mode 100644 index 0000000..0091f86 --- /dev/null +++ b/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.registry.ts @@ -0,0 +1,70 @@ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgRegisterInterchainAccount, MsgSendTx, MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount", MsgRegisterInterchainAccount], ["/ibc.applications.interchain_accounts.controller.v1.MsgSendTx", MsgSendTx], ["/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams", MsgUpdateParams]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + registerInterchainAccount(value: MsgRegisterInterchainAccount) { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount", + value: MsgRegisterInterchainAccount.encode(value).finish() + }; + }, + sendTx(value: MsgSendTx) { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgSendTx", + value: MsgSendTx.encode(value).finish() + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + } + }, + withTypeUrl: { + registerInterchainAccount(value: MsgRegisterInterchainAccount) { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount", + value + }; + }, + sendTx(value: MsgSendTx) { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgSendTx", + value + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams", + value + }; + } + }, + fromPartial: { + registerInterchainAccount(value: MsgRegisterInterchainAccount) { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount", + value: MsgRegisterInterchainAccount.fromPartial(value) + }; + }, + sendTx(value: MsgSendTx) { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgSendTx", + value: MsgSendTx.fromPartial(value) + }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.rpc.msg.ts b/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.rpc.msg.ts new file mode 100644 index 0000000..c2d828b --- /dev/null +++ b/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.rpc.msg.ts @@ -0,0 +1,36 @@ +import { Rpc } from "../../../../../helpers"; +import { BinaryReader } from "../../../../../binary"; +import { MsgRegisterInterchainAccount, MsgRegisterInterchainAccountResponse, MsgSendTx, MsgSendTxResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; +/** Msg defines the 27-interchain-accounts/controller Msg service. */ +export interface Msg { + /** RegisterInterchainAccount defines a rpc handler for MsgRegisterInterchainAccount. */ + registerInterchainAccount(request: MsgRegisterInterchainAccount): Promise; + /** SendTx defines a rpc handler for MsgSendTx. */ + sendTx(request: MsgSendTx): Promise; + /** UpdateParams defines a rpc handler for MsgUpdateParams. */ + updateParams(request: MsgUpdateParams): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.registerInterchainAccount = this.registerInterchainAccount.bind(this); + this.sendTx = this.sendTx.bind(this); + this.updateParams = this.updateParams.bind(this); + } + registerInterchainAccount(request: MsgRegisterInterchainAccount): Promise { + const data = MsgRegisterInterchainAccount.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.interchain_accounts.controller.v1.Msg", "RegisterInterchainAccount", data); + return promise.then(data => MsgRegisterInterchainAccountResponse.decode(new BinaryReader(data))); + } + sendTx(request: MsgSendTx): Promise { + const data = MsgSendTx.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.interchain_accounts.controller.v1.Msg", "SendTx", data); + return promise.then(data => MsgSendTxResponse.decode(new BinaryReader(data))); + } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.interchain_accounts.controller.v1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.ts b/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.ts new file mode 100644 index 0000000..22fbac9 --- /dev/null +++ b/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.ts @@ -0,0 +1,659 @@ +import { Order } from "../../../../core/channel/v1/channel"; +import { InterchainAccountPacketData, InterchainAccountPacketDataAmino, InterchainAccountPacketDataSDKType } from "../../v1/packet"; +import { Params, ParamsAmino, ParamsSDKType } from "./controller"; +import { BinaryReader, BinaryWriter } from "../../../../../binary"; +/** MsgRegisterInterchainAccount defines the payload for Msg/RegisterAccount */ +export interface MsgRegisterInterchainAccount { + owner: string; + connectionId: string; + version: string; + ordering: Order; +} +export interface MsgRegisterInterchainAccountProtoMsg { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount"; + value: Uint8Array; +} +/** MsgRegisterInterchainAccount defines the payload for Msg/RegisterAccount */ +export interface MsgRegisterInterchainAccountAmino { + owner?: string; + connection_id?: string; + version?: string; + ordering?: Order; +} +export interface MsgRegisterInterchainAccountAminoMsg { + type: "cosmos-sdk/MsgRegisterInterchainAccount"; + value: MsgRegisterInterchainAccountAmino; +} +/** MsgRegisterInterchainAccount defines the payload for Msg/RegisterAccount */ +export interface MsgRegisterInterchainAccountSDKType { + owner: string; + connection_id: string; + version: string; + ordering: Order; +} +/** MsgRegisterInterchainAccountResponse defines the response for Msg/RegisterAccount */ +export interface MsgRegisterInterchainAccountResponse { + channelId: string; + portId: string; +} +export interface MsgRegisterInterchainAccountResponseProtoMsg { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccountResponse"; + value: Uint8Array; +} +/** MsgRegisterInterchainAccountResponse defines the response for Msg/RegisterAccount */ +export interface MsgRegisterInterchainAccountResponseAmino { + channel_id?: string; + port_id?: string; +} +export interface MsgRegisterInterchainAccountResponseAminoMsg { + type: "cosmos-sdk/MsgRegisterInterchainAccountResponse"; + value: MsgRegisterInterchainAccountResponseAmino; +} +/** MsgRegisterInterchainAccountResponse defines the response for Msg/RegisterAccount */ +export interface MsgRegisterInterchainAccountResponseSDKType { + channel_id: string; + port_id: string; +} +/** MsgSendTx defines the payload for Msg/SendTx */ +export interface MsgSendTx { + owner: string; + connectionId: string; + packetData: InterchainAccountPacketData; + /** + * Relative timeout timestamp provided will be added to the current block time during transaction execution. + * The timeout timestamp must be non-zero. + */ + relativeTimeout: bigint; +} +export interface MsgSendTxProtoMsg { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgSendTx"; + value: Uint8Array; +} +/** MsgSendTx defines the payload for Msg/SendTx */ +export interface MsgSendTxAmino { + owner?: string; + connection_id?: string; + packet_data?: InterchainAccountPacketDataAmino; + /** + * Relative timeout timestamp provided will be added to the current block time during transaction execution. + * The timeout timestamp must be non-zero. + */ + relative_timeout?: string; +} +export interface MsgSendTxAminoMsg { + type: "cosmos-sdk/MsgSendTx"; + value: MsgSendTxAmino; +} +/** MsgSendTx defines the payload for Msg/SendTx */ +export interface MsgSendTxSDKType { + owner: string; + connection_id: string; + packet_data: InterchainAccountPacketDataSDKType; + relative_timeout: bigint; +} +/** MsgSendTxResponse defines the response for MsgSendTx */ +export interface MsgSendTxResponse { + sequence: bigint; +} +export interface MsgSendTxResponseProtoMsg { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgSendTxResponse"; + value: Uint8Array; +} +/** MsgSendTxResponse defines the response for MsgSendTx */ +export interface MsgSendTxResponseAmino { + sequence?: string; +} +export interface MsgSendTxResponseAminoMsg { + type: "cosmos-sdk/MsgSendTxResponse"; + value: MsgSendTxResponseAmino; +} +/** MsgSendTxResponse defines the response for MsgSendTx */ +export interface MsgSendTxResponseSDKType { + sequence: bigint; +} +/** MsgUpdateParams defines the payload for Msg/UpdateParams */ +export interface MsgUpdateParams { + /** signer address */ + signer: string; + /** + * params defines the 27-interchain-accounts/controller parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** MsgUpdateParams defines the payload for Msg/UpdateParams */ +export interface MsgUpdateParamsAmino { + /** signer address */ + signer?: string; + /** + * params defines the 27-interchain-accounts/controller parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params?: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** MsgUpdateParams defines the payload for Msg/UpdateParams */ +export interface MsgUpdateParamsSDKType { + signer: string; + params: ParamsSDKType; +} +/** MsgUpdateParamsResponse defines the response for Msg/UpdateParams */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** MsgUpdateParamsResponse defines the response for Msg/UpdateParams */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** MsgUpdateParamsResponse defines the response for Msg/UpdateParams */ +export interface MsgUpdateParamsResponseSDKType {} +function createBaseMsgRegisterInterchainAccount(): MsgRegisterInterchainAccount { + return { + owner: "", + connectionId: "", + version: "", + ordering: 0 + }; +} +export const MsgRegisterInterchainAccount = { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount", + encode(message: MsgRegisterInterchainAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.owner !== "") { + writer.uint32(10).string(message.owner); + } + if (message.connectionId !== "") { + writer.uint32(18).string(message.connectionId); + } + if (message.version !== "") { + writer.uint32(26).string(message.version); + } + if (message.ordering !== 0) { + writer.uint32(32).int32(message.ordering); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRegisterInterchainAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRegisterInterchainAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + case 2: + message.connectionId = reader.string(); + break; + case 3: + message.version = reader.string(); + break; + case 4: + message.ordering = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgRegisterInterchainAccount { + const message = createBaseMsgRegisterInterchainAccount(); + message.owner = object.owner ?? ""; + message.connectionId = object.connectionId ?? ""; + message.version = object.version ?? ""; + message.ordering = object.ordering ?? 0; + return message; + }, + fromAmino(object: MsgRegisterInterchainAccountAmino): MsgRegisterInterchainAccount { + const message = createBaseMsgRegisterInterchainAccount(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + if (object.ordering !== undefined && object.ordering !== null) { + message.ordering = object.ordering; + } + return message; + }, + toAmino(message: MsgRegisterInterchainAccount): MsgRegisterInterchainAccountAmino { + const obj: any = {}; + obj.owner = message.owner === "" ? undefined : message.owner; + obj.connection_id = message.connectionId === "" ? undefined : message.connectionId; + obj.version = message.version === "" ? undefined : message.version; + obj.ordering = message.ordering === 0 ? undefined : message.ordering; + return obj; + }, + fromAminoMsg(object: MsgRegisterInterchainAccountAminoMsg): MsgRegisterInterchainAccount { + return MsgRegisterInterchainAccount.fromAmino(object.value); + }, + toAminoMsg(message: MsgRegisterInterchainAccount): MsgRegisterInterchainAccountAminoMsg { + return { + type: "cosmos-sdk/MsgRegisterInterchainAccount", + value: MsgRegisterInterchainAccount.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRegisterInterchainAccountProtoMsg): MsgRegisterInterchainAccount { + return MsgRegisterInterchainAccount.decode(message.value); + }, + toProto(message: MsgRegisterInterchainAccount): Uint8Array { + return MsgRegisterInterchainAccount.encode(message).finish(); + }, + toProtoMsg(message: MsgRegisterInterchainAccount): MsgRegisterInterchainAccountProtoMsg { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount", + value: MsgRegisterInterchainAccount.encode(message).finish() + }; + } +}; +function createBaseMsgRegisterInterchainAccountResponse(): MsgRegisterInterchainAccountResponse { + return { + channelId: "", + portId: "" + }; +} +export const MsgRegisterInterchainAccountResponse = { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccountResponse", + encode(message: MsgRegisterInterchainAccountResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.channelId !== "") { + writer.uint32(10).string(message.channelId); + } + if (message.portId !== "") { + writer.uint32(18).string(message.portId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRegisterInterchainAccountResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRegisterInterchainAccountResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelId = reader.string(); + break; + case 2: + message.portId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgRegisterInterchainAccountResponse { + const message = createBaseMsgRegisterInterchainAccountResponse(); + message.channelId = object.channelId ?? ""; + message.portId = object.portId ?? ""; + return message; + }, + fromAmino(object: MsgRegisterInterchainAccountResponseAmino): MsgRegisterInterchainAccountResponse { + const message = createBaseMsgRegisterInterchainAccountResponse(); + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + return message; + }, + toAmino(message: MsgRegisterInterchainAccountResponse): MsgRegisterInterchainAccountResponseAmino { + const obj: any = {}; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.port_id = message.portId === "" ? undefined : message.portId; + return obj; + }, + fromAminoMsg(object: MsgRegisterInterchainAccountResponseAminoMsg): MsgRegisterInterchainAccountResponse { + return MsgRegisterInterchainAccountResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgRegisterInterchainAccountResponse): MsgRegisterInterchainAccountResponseAminoMsg { + return { + type: "cosmos-sdk/MsgRegisterInterchainAccountResponse", + value: MsgRegisterInterchainAccountResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRegisterInterchainAccountResponseProtoMsg): MsgRegisterInterchainAccountResponse { + return MsgRegisterInterchainAccountResponse.decode(message.value); + }, + toProto(message: MsgRegisterInterchainAccountResponse): Uint8Array { + return MsgRegisterInterchainAccountResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRegisterInterchainAccountResponse): MsgRegisterInterchainAccountResponseProtoMsg { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccountResponse", + value: MsgRegisterInterchainAccountResponse.encode(message).finish() + }; + } +}; +function createBaseMsgSendTx(): MsgSendTx { + return { + owner: "", + connectionId: "", + packetData: InterchainAccountPacketData.fromPartial({}), + relativeTimeout: BigInt(0) + }; +} +export const MsgSendTx = { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgSendTx", + encode(message: MsgSendTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.owner !== "") { + writer.uint32(10).string(message.owner); + } + if (message.connectionId !== "") { + writer.uint32(18).string(message.connectionId); + } + if (message.packetData !== undefined) { + InterchainAccountPacketData.encode(message.packetData, writer.uint32(26).fork()).ldelim(); + } + if (message.relativeTimeout !== BigInt(0)) { + writer.uint32(32).uint64(message.relativeTimeout); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSendTx { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSendTx(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + case 2: + message.connectionId = reader.string(); + break; + case 3: + message.packetData = InterchainAccountPacketData.decode(reader, reader.uint32()); + break; + case 4: + message.relativeTimeout = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSendTx { + const message = createBaseMsgSendTx(); + message.owner = object.owner ?? ""; + message.connectionId = object.connectionId ?? ""; + message.packetData = object.packetData !== undefined && object.packetData !== null ? InterchainAccountPacketData.fromPartial(object.packetData) : undefined; + message.relativeTimeout = object.relativeTimeout !== undefined && object.relativeTimeout !== null ? BigInt(object.relativeTimeout.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgSendTxAmino): MsgSendTx { + const message = createBaseMsgSendTx(); + if (object.owner !== undefined && object.owner !== null) { + message.owner = object.owner; + } + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.packet_data !== undefined && object.packet_data !== null) { + message.packetData = InterchainAccountPacketData.fromAmino(object.packet_data); + } + if (object.relative_timeout !== undefined && object.relative_timeout !== null) { + message.relativeTimeout = BigInt(object.relative_timeout); + } + return message; + }, + toAmino(message: MsgSendTx): MsgSendTxAmino { + const obj: any = {}; + obj.owner = message.owner === "" ? undefined : message.owner; + obj.connection_id = message.connectionId === "" ? undefined : message.connectionId; + obj.packet_data = message.packetData ? InterchainAccountPacketData.toAmino(message.packetData) : undefined; + obj.relative_timeout = message.relativeTimeout !== BigInt(0) ? message.relativeTimeout.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgSendTxAminoMsg): MsgSendTx { + return MsgSendTx.fromAmino(object.value); + }, + toAminoMsg(message: MsgSendTx): MsgSendTxAminoMsg { + return { + type: "cosmos-sdk/MsgSendTx", + value: MsgSendTx.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSendTxProtoMsg): MsgSendTx { + return MsgSendTx.decode(message.value); + }, + toProto(message: MsgSendTx): Uint8Array { + return MsgSendTx.encode(message).finish(); + }, + toProtoMsg(message: MsgSendTx): MsgSendTxProtoMsg { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgSendTx", + value: MsgSendTx.encode(message).finish() + }; + } +}; +function createBaseMsgSendTxResponse(): MsgSendTxResponse { + return { + sequence: BigInt(0) + }; +} +export const MsgSendTxResponse = { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgSendTxResponse", + encode(message: MsgSendTxResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sequence !== BigInt(0)) { + writer.uint32(8).uint64(message.sequence); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgSendTxResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSendTxResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgSendTxResponse { + const message = createBaseMsgSendTxResponse(); + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgSendTxResponseAmino): MsgSendTxResponse { + const message = createBaseMsgSendTxResponse(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + return message; + }, + toAmino(message: MsgSendTxResponse): MsgSendTxResponseAmino { + const obj: any = {}; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgSendTxResponseAminoMsg): MsgSendTxResponse { + return MsgSendTxResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgSendTxResponse): MsgSendTxResponseAminoMsg { + return { + type: "cosmos-sdk/MsgSendTxResponse", + value: MsgSendTxResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgSendTxResponseProtoMsg): MsgSendTxResponse { + return MsgSendTxResponse.decode(message.value); + }, + toProto(message: MsgSendTxResponse): Uint8Array { + return MsgSendTxResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgSendTxResponse): MsgSendTxResponseProtoMsg { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgSendTxResponse", + value: MsgSendTxResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + signer: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.signer = object.signer ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.signer = message.signer === "" ? undefined : message.signer; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/ibc/applications/interchain_accounts/genesis/v1/genesis.ts b/src/codegen/ibc/applications/interchain_accounts/genesis/v1/genesis.ts new file mode 100644 index 0000000..ec542a7 --- /dev/null +++ b/src/codegen/ibc/applications/interchain_accounts/genesis/v1/genesis.ts @@ -0,0 +1,651 @@ +import { Params as Params1 } from "../../controller/v1/controller"; +import { ParamsAmino as Params1Amino } from "../../controller/v1/controller"; +import { ParamsSDKType as Params1SDKType } from "../../controller/v1/controller"; +import { Params as Params2 } from "../../host/v1/host"; +import { ParamsAmino as Params2Amino } from "../../host/v1/host"; +import { ParamsSDKType as Params2SDKType } from "../../host/v1/host"; +import { BinaryReader, BinaryWriter } from "../../../../../binary"; +/** GenesisState defines the interchain accounts genesis state */ +export interface GenesisState { + controllerGenesisState: ControllerGenesisState; + hostGenesisState: HostGenesisState; +} +export interface GenesisStateProtoMsg { + typeUrl: "/ibc.applications.interchain_accounts.genesis.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines the interchain accounts genesis state */ +export interface GenesisStateAmino { + controller_genesis_state?: ControllerGenesisStateAmino; + host_genesis_state?: HostGenesisStateAmino; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines the interchain accounts genesis state */ +export interface GenesisStateSDKType { + controller_genesis_state: ControllerGenesisStateSDKType; + host_genesis_state: HostGenesisStateSDKType; +} +/** ControllerGenesisState defines the interchain accounts controller genesis state */ +export interface ControllerGenesisState { + activeChannels: ActiveChannel[]; + interchainAccounts: RegisteredInterchainAccount[]; + ports: string[]; + params: Params1; +} +export interface ControllerGenesisStateProtoMsg { + typeUrl: "/ibc.applications.interchain_accounts.genesis.v1.ControllerGenesisState"; + value: Uint8Array; +} +/** ControllerGenesisState defines the interchain accounts controller genesis state */ +export interface ControllerGenesisStateAmino { + active_channels?: ActiveChannelAmino[]; + interchain_accounts?: RegisteredInterchainAccountAmino[]; + ports?: string[]; + params?: Params1Amino; +} +export interface ControllerGenesisStateAminoMsg { + type: "cosmos-sdk/ControllerGenesisState"; + value: ControllerGenesisStateAmino; +} +/** ControllerGenesisState defines the interchain accounts controller genesis state */ +export interface ControllerGenesisStateSDKType { + active_channels: ActiveChannelSDKType[]; + interchain_accounts: RegisteredInterchainAccountSDKType[]; + ports: string[]; + params: Params1SDKType; +} +/** HostGenesisState defines the interchain accounts host genesis state */ +export interface HostGenesisState { + activeChannels: ActiveChannel[]; + interchainAccounts: RegisteredInterchainAccount[]; + port: string; + params: Params2; +} +export interface HostGenesisStateProtoMsg { + typeUrl: "/ibc.applications.interchain_accounts.genesis.v1.HostGenesisState"; + value: Uint8Array; +} +/** HostGenesisState defines the interchain accounts host genesis state */ +export interface HostGenesisStateAmino { + active_channels?: ActiveChannelAmino[]; + interchain_accounts?: RegisteredInterchainAccountAmino[]; + port?: string; + params?: Params2Amino; +} +export interface HostGenesisStateAminoMsg { + type: "cosmos-sdk/HostGenesisState"; + value: HostGenesisStateAmino; +} +/** HostGenesisState defines the interchain accounts host genesis state */ +export interface HostGenesisStateSDKType { + active_channels: ActiveChannelSDKType[]; + interchain_accounts: RegisteredInterchainAccountSDKType[]; + port: string; + params: Params2SDKType; +} +/** + * ActiveChannel contains a connection ID, port ID and associated active channel ID, as well as a boolean flag to + * indicate if the channel is middleware enabled + */ +export interface ActiveChannel { + connectionId: string; + portId: string; + channelId: string; + isMiddlewareEnabled: boolean; +} +export interface ActiveChannelProtoMsg { + typeUrl: "/ibc.applications.interchain_accounts.genesis.v1.ActiveChannel"; + value: Uint8Array; +} +/** + * ActiveChannel contains a connection ID, port ID and associated active channel ID, as well as a boolean flag to + * indicate if the channel is middleware enabled + */ +export interface ActiveChannelAmino { + connection_id?: string; + port_id?: string; + channel_id?: string; + is_middleware_enabled?: boolean; +} +export interface ActiveChannelAminoMsg { + type: "cosmos-sdk/ActiveChannel"; + value: ActiveChannelAmino; +} +/** + * ActiveChannel contains a connection ID, port ID and associated active channel ID, as well as a boolean flag to + * indicate if the channel is middleware enabled + */ +export interface ActiveChannelSDKType { + connection_id: string; + port_id: string; + channel_id: string; + is_middleware_enabled: boolean; +} +/** RegisteredInterchainAccount contains a connection ID, port ID and associated interchain account address */ +export interface RegisteredInterchainAccount { + connectionId: string; + portId: string; + accountAddress: string; +} +export interface RegisteredInterchainAccountProtoMsg { + typeUrl: "/ibc.applications.interchain_accounts.genesis.v1.RegisteredInterchainAccount"; + value: Uint8Array; +} +/** RegisteredInterchainAccount contains a connection ID, port ID and associated interchain account address */ +export interface RegisteredInterchainAccountAmino { + connection_id?: string; + port_id?: string; + account_address?: string; +} +export interface RegisteredInterchainAccountAminoMsg { + type: "cosmos-sdk/RegisteredInterchainAccount"; + value: RegisteredInterchainAccountAmino; +} +/** RegisteredInterchainAccount contains a connection ID, port ID and associated interchain account address */ +export interface RegisteredInterchainAccountSDKType { + connection_id: string; + port_id: string; + account_address: string; +} +function createBaseGenesisState(): GenesisState { + return { + controllerGenesisState: ControllerGenesisState.fromPartial({}), + hostGenesisState: HostGenesisState.fromPartial({}) + }; +} +export const GenesisState = { + typeUrl: "/ibc.applications.interchain_accounts.genesis.v1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.controllerGenesisState !== undefined) { + ControllerGenesisState.encode(message.controllerGenesisState, writer.uint32(10).fork()).ldelim(); + } + if (message.hostGenesisState !== undefined) { + HostGenesisState.encode(message.hostGenesisState, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.controllerGenesisState = ControllerGenesisState.decode(reader, reader.uint32()); + break; + case 2: + message.hostGenesisState = HostGenesisState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.controllerGenesisState = object.controllerGenesisState !== undefined && object.controllerGenesisState !== null ? ControllerGenesisState.fromPartial(object.controllerGenesisState) : undefined; + message.hostGenesisState = object.hostGenesisState !== undefined && object.hostGenesisState !== null ? HostGenesisState.fromPartial(object.hostGenesisState) : undefined; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + if (object.controller_genesis_state !== undefined && object.controller_genesis_state !== null) { + message.controllerGenesisState = ControllerGenesisState.fromAmino(object.controller_genesis_state); + } + if (object.host_genesis_state !== undefined && object.host_genesis_state !== null) { + message.hostGenesisState = HostGenesisState.fromAmino(object.host_genesis_state); + } + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + obj.controller_genesis_state = message.controllerGenesisState ? ControllerGenesisState.toAmino(message.controllerGenesisState) : undefined; + obj.host_genesis_state = message.hostGenesisState ? HostGenesisState.toAmino(message.hostGenesisState) : undefined; + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: "cosmos-sdk/GenesisState", + value: GenesisState.toAmino(message) + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/ibc.applications.interchain_accounts.genesis.v1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +function createBaseControllerGenesisState(): ControllerGenesisState { + return { + activeChannels: [], + interchainAccounts: [], + ports: [], + params: Params1.fromPartial({}) + }; +} +export const ControllerGenesisState = { + typeUrl: "/ibc.applications.interchain_accounts.genesis.v1.ControllerGenesisState", + encode(message: ControllerGenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.activeChannels) { + ActiveChannel.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.interchainAccounts) { + RegisteredInterchainAccount.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.ports) { + writer.uint32(26).string(v!); + } + if (message.params !== undefined) { + Params1.encode(message.params, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ControllerGenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseControllerGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.activeChannels.push(ActiveChannel.decode(reader, reader.uint32())); + break; + case 2: + message.interchainAccounts.push(RegisteredInterchainAccount.decode(reader, reader.uint32())); + break; + case 3: + message.ports.push(reader.string()); + break; + case 4: + message.params = Params1.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ControllerGenesisState { + const message = createBaseControllerGenesisState(); + message.activeChannels = object.activeChannels?.map(e => ActiveChannel.fromPartial(e)) || []; + message.interchainAccounts = object.interchainAccounts?.map(e => RegisteredInterchainAccount.fromPartial(e)) || []; + message.ports = object.ports?.map(e => e) || []; + message.params = object.params !== undefined && object.params !== null ? Params1.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: ControllerGenesisStateAmino): ControllerGenesisState { + const message = createBaseControllerGenesisState(); + message.activeChannels = object.active_channels?.map(e => ActiveChannel.fromAmino(e)) || []; + message.interchainAccounts = object.interchain_accounts?.map(e => RegisteredInterchainAccount.fromAmino(e)) || []; + message.ports = object.ports?.map(e => e) || []; + if (object.params !== undefined && object.params !== null) { + message.params = Params1.fromAmino(object.params); + } + return message; + }, + toAmino(message: ControllerGenesisState): ControllerGenesisStateAmino { + const obj: any = {}; + if (message.activeChannels) { + obj.active_channels = message.activeChannels.map(e => e ? ActiveChannel.toAmino(e) : undefined); + } else { + obj.active_channels = message.activeChannels; + } + if (message.interchainAccounts) { + obj.interchain_accounts = message.interchainAccounts.map(e => e ? RegisteredInterchainAccount.toAmino(e) : undefined); + } else { + obj.interchain_accounts = message.interchainAccounts; + } + if (message.ports) { + obj.ports = message.ports.map(e => e); + } else { + obj.ports = message.ports; + } + obj.params = message.params ? Params1.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: ControllerGenesisStateAminoMsg): ControllerGenesisState { + return ControllerGenesisState.fromAmino(object.value); + }, + toAminoMsg(message: ControllerGenesisState): ControllerGenesisStateAminoMsg { + return { + type: "cosmos-sdk/ControllerGenesisState", + value: ControllerGenesisState.toAmino(message) + }; + }, + fromProtoMsg(message: ControllerGenesisStateProtoMsg): ControllerGenesisState { + return ControllerGenesisState.decode(message.value); + }, + toProto(message: ControllerGenesisState): Uint8Array { + return ControllerGenesisState.encode(message).finish(); + }, + toProtoMsg(message: ControllerGenesisState): ControllerGenesisStateProtoMsg { + return { + typeUrl: "/ibc.applications.interchain_accounts.genesis.v1.ControllerGenesisState", + value: ControllerGenesisState.encode(message).finish() + }; + } +}; +function createBaseHostGenesisState(): HostGenesisState { + return { + activeChannels: [], + interchainAccounts: [], + port: "", + params: Params2.fromPartial({}) + }; +} +export const HostGenesisState = { + typeUrl: "/ibc.applications.interchain_accounts.genesis.v1.HostGenesisState", + encode(message: HostGenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.activeChannels) { + ActiveChannel.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.interchainAccounts) { + RegisteredInterchainAccount.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.port !== "") { + writer.uint32(26).string(message.port); + } + if (message.params !== undefined) { + Params2.encode(message.params, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): HostGenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHostGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.activeChannels.push(ActiveChannel.decode(reader, reader.uint32())); + break; + case 2: + message.interchainAccounts.push(RegisteredInterchainAccount.decode(reader, reader.uint32())); + break; + case 3: + message.port = reader.string(); + break; + case 4: + message.params = Params2.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): HostGenesisState { + const message = createBaseHostGenesisState(); + message.activeChannels = object.activeChannels?.map(e => ActiveChannel.fromPartial(e)) || []; + message.interchainAccounts = object.interchainAccounts?.map(e => RegisteredInterchainAccount.fromPartial(e)) || []; + message.port = object.port ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params2.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: HostGenesisStateAmino): HostGenesisState { + const message = createBaseHostGenesisState(); + message.activeChannels = object.active_channels?.map(e => ActiveChannel.fromAmino(e)) || []; + message.interchainAccounts = object.interchain_accounts?.map(e => RegisteredInterchainAccount.fromAmino(e)) || []; + if (object.port !== undefined && object.port !== null) { + message.port = object.port; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params2.fromAmino(object.params); + } + return message; + }, + toAmino(message: HostGenesisState): HostGenesisStateAmino { + const obj: any = {}; + if (message.activeChannels) { + obj.active_channels = message.activeChannels.map(e => e ? ActiveChannel.toAmino(e) : undefined); + } else { + obj.active_channels = message.activeChannels; + } + if (message.interchainAccounts) { + obj.interchain_accounts = message.interchainAccounts.map(e => e ? RegisteredInterchainAccount.toAmino(e) : undefined); + } else { + obj.interchain_accounts = message.interchainAccounts; + } + obj.port = message.port === "" ? undefined : message.port; + obj.params = message.params ? Params2.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: HostGenesisStateAminoMsg): HostGenesisState { + return HostGenesisState.fromAmino(object.value); + }, + toAminoMsg(message: HostGenesisState): HostGenesisStateAminoMsg { + return { + type: "cosmos-sdk/HostGenesisState", + value: HostGenesisState.toAmino(message) + }; + }, + fromProtoMsg(message: HostGenesisStateProtoMsg): HostGenesisState { + return HostGenesisState.decode(message.value); + }, + toProto(message: HostGenesisState): Uint8Array { + return HostGenesisState.encode(message).finish(); + }, + toProtoMsg(message: HostGenesisState): HostGenesisStateProtoMsg { + return { + typeUrl: "/ibc.applications.interchain_accounts.genesis.v1.HostGenesisState", + value: HostGenesisState.encode(message).finish() + }; + } +}; +function createBaseActiveChannel(): ActiveChannel { + return { + connectionId: "", + portId: "", + channelId: "", + isMiddlewareEnabled: false + }; +} +export const ActiveChannel = { + typeUrl: "/ibc.applications.interchain_accounts.genesis.v1.ActiveChannel", + encode(message: ActiveChannel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.connectionId !== "") { + writer.uint32(10).string(message.connectionId); + } + if (message.portId !== "") { + writer.uint32(18).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(26).string(message.channelId); + } + if (message.isMiddlewareEnabled === true) { + writer.uint32(32).bool(message.isMiddlewareEnabled); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ActiveChannel { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseActiveChannel(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + case 2: + message.portId = reader.string(); + break; + case 3: + message.channelId = reader.string(); + break; + case 4: + message.isMiddlewareEnabled = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ActiveChannel { + const message = createBaseActiveChannel(); + message.connectionId = object.connectionId ?? ""; + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.isMiddlewareEnabled = object.isMiddlewareEnabled ?? false; + return message; + }, + fromAmino(object: ActiveChannelAmino): ActiveChannel { + const message = createBaseActiveChannel(); + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.is_middleware_enabled !== undefined && object.is_middleware_enabled !== null) { + message.isMiddlewareEnabled = object.is_middleware_enabled; + } + return message; + }, + toAmino(message: ActiveChannel): ActiveChannelAmino { + const obj: any = {}; + obj.connection_id = message.connectionId === "" ? undefined : message.connectionId; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.is_middleware_enabled = message.isMiddlewareEnabled === false ? undefined : message.isMiddlewareEnabled; + return obj; + }, + fromAminoMsg(object: ActiveChannelAminoMsg): ActiveChannel { + return ActiveChannel.fromAmino(object.value); + }, + toAminoMsg(message: ActiveChannel): ActiveChannelAminoMsg { + return { + type: "cosmos-sdk/ActiveChannel", + value: ActiveChannel.toAmino(message) + }; + }, + fromProtoMsg(message: ActiveChannelProtoMsg): ActiveChannel { + return ActiveChannel.decode(message.value); + }, + toProto(message: ActiveChannel): Uint8Array { + return ActiveChannel.encode(message).finish(); + }, + toProtoMsg(message: ActiveChannel): ActiveChannelProtoMsg { + return { + typeUrl: "/ibc.applications.interchain_accounts.genesis.v1.ActiveChannel", + value: ActiveChannel.encode(message).finish() + }; + } +}; +function createBaseRegisteredInterchainAccount(): RegisteredInterchainAccount { + return { + connectionId: "", + portId: "", + accountAddress: "" + }; +} +export const RegisteredInterchainAccount = { + typeUrl: "/ibc.applications.interchain_accounts.genesis.v1.RegisteredInterchainAccount", + encode(message: RegisteredInterchainAccount, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.connectionId !== "") { + writer.uint32(10).string(message.connectionId); + } + if (message.portId !== "") { + writer.uint32(18).string(message.portId); + } + if (message.accountAddress !== "") { + writer.uint32(26).string(message.accountAddress); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): RegisteredInterchainAccount { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRegisteredInterchainAccount(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectionId = reader.string(); + break; + case 2: + message.portId = reader.string(); + break; + case 3: + message.accountAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): RegisteredInterchainAccount { + const message = createBaseRegisteredInterchainAccount(); + message.connectionId = object.connectionId ?? ""; + message.portId = object.portId ?? ""; + message.accountAddress = object.accountAddress ?? ""; + return message; + }, + fromAmino(object: RegisteredInterchainAccountAmino): RegisteredInterchainAccount { + const message = createBaseRegisteredInterchainAccount(); + if (object.connection_id !== undefined && object.connection_id !== null) { + message.connectionId = object.connection_id; + } + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.account_address !== undefined && object.account_address !== null) { + message.accountAddress = object.account_address; + } + return message; + }, + toAmino(message: RegisteredInterchainAccount): RegisteredInterchainAccountAmino { + const obj: any = {}; + obj.connection_id = message.connectionId === "" ? undefined : message.connectionId; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.account_address = message.accountAddress === "" ? undefined : message.accountAddress; + return obj; + }, + fromAminoMsg(object: RegisteredInterchainAccountAminoMsg): RegisteredInterchainAccount { + return RegisteredInterchainAccount.fromAmino(object.value); + }, + toAminoMsg(message: RegisteredInterchainAccount): RegisteredInterchainAccountAminoMsg { + return { + type: "cosmos-sdk/RegisteredInterchainAccount", + value: RegisteredInterchainAccount.toAmino(message) + }; + }, + fromProtoMsg(message: RegisteredInterchainAccountProtoMsg): RegisteredInterchainAccount { + return RegisteredInterchainAccount.decode(message.value); + }, + toProto(message: RegisteredInterchainAccount): Uint8Array { + return RegisteredInterchainAccount.encode(message).finish(); + }, + toProtoMsg(message: RegisteredInterchainAccount): RegisteredInterchainAccountProtoMsg { + return { + typeUrl: "/ibc.applications.interchain_accounts.genesis.v1.RegisteredInterchainAccount", + value: RegisteredInterchainAccount.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/ibc/applications/interchain_accounts/host/v1/host.ts b/src/codegen/ibc/applications/interchain_accounts/host/v1/host.ts index 3f67515..31a8ecc 100644 --- a/src/codegen/ibc/applications/interchain_accounts/host/v1/host.ts +++ b/src/codegen/ibc/applications/interchain_accounts/host/v1/host.ts @@ -1,4 +1,5 @@ import { BinaryReader, BinaryWriter } from "../../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../../helpers"; /** * Params defines the set of on-chain interchain accounts parameters. * The following parameters may be used to disable the host submodule. @@ -35,6 +36,54 @@ export interface ParamsSDKType { host_enabled: boolean; allow_messages: string[]; } +/** + * QueryRequest defines the parameters for a particular query request + * by an interchain account. + */ +export interface QueryRequest { + /** + * path defines the path of the query request as defined by ADR-021. + * https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-021-protobuf-query-encoding.md#custom-query-registration-and-routing + */ + path: string; + /** + * data defines the payload of the query request as defined by ADR-021. + * https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-021-protobuf-query-encoding.md#custom-query-registration-and-routing + */ + data: Uint8Array; +} +export interface QueryRequestProtoMsg { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.QueryRequest"; + value: Uint8Array; +} +/** + * QueryRequest defines the parameters for a particular query request + * by an interchain account. + */ +export interface QueryRequestAmino { + /** + * path defines the path of the query request as defined by ADR-021. + * https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-021-protobuf-query-encoding.md#custom-query-registration-and-routing + */ + path?: string; + /** + * data defines the payload of the query request as defined by ADR-021. + * https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-021-protobuf-query-encoding.md#custom-query-registration-and-routing + */ + data?: string; +} +export interface QueryRequestAminoMsg { + type: "cosmos-sdk/QueryRequest"; + value: QueryRequestAmino; +} +/** + * QueryRequest defines the parameters for a particular query request + * by an interchain account. + */ +export interface QueryRequestSDKType { + path: string; + data: Uint8Array; +} function createBaseParams(): Params { return { hostEnabled: false, @@ -117,4 +166,85 @@ export const Params = { value: Params.encode(message).finish() }; } +}; +function createBaseQueryRequest(): QueryRequest { + return { + path: "", + data: new Uint8Array() + }; +} +export const QueryRequest = { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.QueryRequest", + encode(message: QueryRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.path !== "") { + writer.uint32(10).string(message.path); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.path = reader.string(); + break; + case 2: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryRequest { + const message = createBaseQueryRequest(); + message.path = object.path ?? ""; + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: QueryRequestAmino): QueryRequest { + const message = createBaseQueryRequest(); + if (object.path !== undefined && object.path !== null) { + message.path = object.path; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: QueryRequest): QueryRequestAmino { + const obj: any = {}; + obj.path = message.path === "" ? undefined : message.path; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: QueryRequestAminoMsg): QueryRequest { + return QueryRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryRequest): QueryRequestAminoMsg { + return { + type: "cosmos-sdk/QueryRequest", + value: QueryRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryRequestProtoMsg): QueryRequest { + return QueryRequest.decode(message.value); + }, + toProto(message: QueryRequest): Uint8Array { + return QueryRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryRequest): QueryRequestProtoMsg { + return { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.QueryRequest", + value: QueryRequest.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.amino.ts b/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.amino.ts new file mode 100644 index 0000000..b19577a --- /dev/null +++ b/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.amino.ts @@ -0,0 +1,13 @@ +import { MsgUpdateParams, MsgModuleQuerySafe } from "./tx"; +export const AminoConverter = { + "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams": { + aminoType: "cosmos-sdk/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + }, + "/ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafe": { + aminoType: "cosmos-sdk/MsgModuleQuerySafe", + toAmino: MsgModuleQuerySafe.toAmino, + fromAmino: MsgModuleQuerySafe.fromAmino + } +}; \ No newline at end of file diff --git a/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.registry.ts b/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.registry.ts new file mode 100644 index 0000000..521e190 --- /dev/null +++ b/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.registry.ts @@ -0,0 +1,52 @@ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgUpdateParams, MsgModuleQuerySafe } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams", MsgUpdateParams], ["/ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafe", MsgModuleQuerySafe]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + }, + moduleQuerySafe(value: MsgModuleQuerySafe) { + return { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafe", + value: MsgModuleQuerySafe.encode(value).finish() + }; + } + }, + withTypeUrl: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams", + value + }; + }, + moduleQuerySafe(value: MsgModuleQuerySafe) { + return { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafe", + value + }; + } + }, + fromPartial: { + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + }, + moduleQuerySafe(value: MsgModuleQuerySafe) { + return { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafe", + value: MsgModuleQuerySafe.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.rpc.msg.ts b/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.rpc.msg.ts new file mode 100644 index 0000000..5416fd7 --- /dev/null +++ b/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.rpc.msg.ts @@ -0,0 +1,28 @@ +import { Rpc } from "../../../../../helpers"; +import { BinaryReader } from "../../../../../binary"; +import { MsgUpdateParams, MsgUpdateParamsResponse, MsgModuleQuerySafe, MsgModuleQuerySafeResponse } from "./tx"; +/** Msg defines the 27-interchain-accounts/host Msg service. */ +export interface Msg { + /** UpdateParams defines a rpc handler for MsgUpdateParams. */ + updateParams(request: MsgUpdateParams): Promise; + /** ModuleQuerySafe defines a rpc handler for MsgModuleQuerySafe. */ + moduleQuerySafe(request: MsgModuleQuerySafe): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.updateParams = this.updateParams.bind(this); + this.moduleQuerySafe = this.moduleQuerySafe.bind(this); + } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.interchain_accounts.host.v1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } + moduleQuerySafe(request: MsgModuleQuerySafe): Promise { + const data = MsgModuleQuerySafe.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.interchain_accounts.host.v1.Msg", "ModuleQuerySafe", data); + return promise.then(data => MsgModuleQuerySafeResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.ts b/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.ts new file mode 100644 index 0000000..0794e58 --- /dev/null +++ b/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.ts @@ -0,0 +1,409 @@ +import { Params, ParamsAmino, ParamsSDKType, QueryRequest, QueryRequestAmino, QueryRequestSDKType } from "./host"; +import { BinaryReader, BinaryWriter } from "../../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../../helpers"; +/** MsgUpdateParams defines the payload for Msg/UpdateParams */ +export interface MsgUpdateParams { + /** signer address */ + signer: string; + /** + * params defines the 27-interchain-accounts/host parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** MsgUpdateParams defines the payload for Msg/UpdateParams */ +export interface MsgUpdateParamsAmino { + /** signer address */ + signer?: string; + /** + * params defines the 27-interchain-accounts/host parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params?: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** MsgUpdateParams defines the payload for Msg/UpdateParams */ +export interface MsgUpdateParamsSDKType { + signer: string; + params: ParamsSDKType; +} +/** MsgUpdateParamsResponse defines the response for Msg/UpdateParams */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** MsgUpdateParamsResponse defines the response for Msg/UpdateParams */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** MsgUpdateParamsResponse defines the response for Msg/UpdateParams */ +export interface MsgUpdateParamsResponseSDKType {} +/** MsgModuleQuerySafe defines the payload for Msg/ModuleQuerySafe */ +export interface MsgModuleQuerySafe { + /** signer address */ + signer: string; + /** requests defines the module safe queries to execute. */ + requests: QueryRequest[]; +} +export interface MsgModuleQuerySafeProtoMsg { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafe"; + value: Uint8Array; +} +/** MsgModuleQuerySafe defines the payload for Msg/ModuleQuerySafe */ +export interface MsgModuleQuerySafeAmino { + /** signer address */ + signer?: string; + /** requests defines the module safe queries to execute. */ + requests?: QueryRequestAmino[]; +} +export interface MsgModuleQuerySafeAminoMsg { + type: "cosmos-sdk/MsgModuleQuerySafe"; + value: MsgModuleQuerySafeAmino; +} +/** MsgModuleQuerySafe defines the payload for Msg/ModuleQuerySafe */ +export interface MsgModuleQuerySafeSDKType { + signer: string; + requests: QueryRequestSDKType[]; +} +/** MsgModuleQuerySafeResponse defines the response for Msg/ModuleQuerySafe */ +export interface MsgModuleQuerySafeResponse { + /** height at which the responses were queried */ + height: bigint; + /** protobuf encoded responses for each query */ + responses: Uint8Array[]; +} +export interface MsgModuleQuerySafeResponseProtoMsg { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafeResponse"; + value: Uint8Array; +} +/** MsgModuleQuerySafeResponse defines the response for Msg/ModuleQuerySafe */ +export interface MsgModuleQuerySafeResponseAmino { + /** height at which the responses were queried */ + height?: string; + /** protobuf encoded responses for each query */ + responses?: string[]; +} +export interface MsgModuleQuerySafeResponseAminoMsg { + type: "cosmos-sdk/MsgModuleQuerySafeResponse"; + value: MsgModuleQuerySafeResponseAmino; +} +/** MsgModuleQuerySafeResponse defines the response for Msg/ModuleQuerySafe */ +export interface MsgModuleQuerySafeResponseSDKType { + height: bigint; + responses: Uint8Array[]; +} +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + signer: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.signer = object.signer ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.signer = message.signer === "" ? undefined : message.signer; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +function createBaseMsgModuleQuerySafe(): MsgModuleQuerySafe { + return { + signer: "", + requests: [] + }; +} +export const MsgModuleQuerySafe = { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafe", + encode(message: MsgModuleQuerySafe, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + for (const v of message.requests) { + QueryRequest.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgModuleQuerySafe { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgModuleQuerySafe(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.requests.push(QueryRequest.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgModuleQuerySafe { + const message = createBaseMsgModuleQuerySafe(); + message.signer = object.signer ?? ""; + message.requests = object.requests?.map(e => QueryRequest.fromPartial(e)) || []; + return message; + }, + fromAmino(object: MsgModuleQuerySafeAmino): MsgModuleQuerySafe { + const message = createBaseMsgModuleQuerySafe(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + message.requests = object.requests?.map(e => QueryRequest.fromAmino(e)) || []; + return message; + }, + toAmino(message: MsgModuleQuerySafe): MsgModuleQuerySafeAmino { + const obj: any = {}; + obj.signer = message.signer === "" ? undefined : message.signer; + if (message.requests) { + obj.requests = message.requests.map(e => e ? QueryRequest.toAmino(e) : undefined); + } else { + obj.requests = message.requests; + } + return obj; + }, + fromAminoMsg(object: MsgModuleQuerySafeAminoMsg): MsgModuleQuerySafe { + return MsgModuleQuerySafe.fromAmino(object.value); + }, + toAminoMsg(message: MsgModuleQuerySafe): MsgModuleQuerySafeAminoMsg { + return { + type: "cosmos-sdk/MsgModuleQuerySafe", + value: MsgModuleQuerySafe.toAmino(message) + }; + }, + fromProtoMsg(message: MsgModuleQuerySafeProtoMsg): MsgModuleQuerySafe { + return MsgModuleQuerySafe.decode(message.value); + }, + toProto(message: MsgModuleQuerySafe): Uint8Array { + return MsgModuleQuerySafe.encode(message).finish(); + }, + toProtoMsg(message: MsgModuleQuerySafe): MsgModuleQuerySafeProtoMsg { + return { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafe", + value: MsgModuleQuerySafe.encode(message).finish() + }; + } +}; +function createBaseMsgModuleQuerySafeResponse(): MsgModuleQuerySafeResponse { + return { + height: BigInt(0), + responses: [] + }; +} +export const MsgModuleQuerySafeResponse = { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafeResponse", + encode(message: MsgModuleQuerySafeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { + writer.uint32(8).uint64(message.height); + } + for (const v of message.responses) { + writer.uint32(18).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgModuleQuerySafeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgModuleQuerySafeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.uint64(); + break; + case 2: + message.responses.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgModuleQuerySafeResponse { + const message = createBaseMsgModuleQuerySafeResponse(); + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.responses = object.responses?.map(e => e) || []; + return message; + }, + fromAmino(object: MsgModuleQuerySafeResponseAmino): MsgModuleQuerySafeResponse { + const message = createBaseMsgModuleQuerySafeResponse(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + message.responses = object.responses?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: MsgModuleQuerySafeResponse): MsgModuleQuerySafeResponseAmino { + const obj: any = {}; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + if (message.responses) { + obj.responses = message.responses.map(e => base64FromBytes(e)); + } else { + obj.responses = message.responses; + } + return obj; + }, + fromAminoMsg(object: MsgModuleQuerySafeResponseAminoMsg): MsgModuleQuerySafeResponse { + return MsgModuleQuerySafeResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgModuleQuerySafeResponse): MsgModuleQuerySafeResponseAminoMsg { + return { + type: "cosmos-sdk/MsgModuleQuerySafeResponse", + value: MsgModuleQuerySafeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgModuleQuerySafeResponseProtoMsg): MsgModuleQuerySafeResponse { + return MsgModuleQuerySafeResponse.decode(message.value); + }, + toProto(message: MsgModuleQuerySafeResponse): Uint8Array { + return MsgModuleQuerySafeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgModuleQuerySafeResponse): MsgModuleQuerySafeResponseProtoMsg { + return { + typeUrl: "/ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafeResponse", + value: MsgModuleQuerySafeResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/ibc/applications/transfer/v1/authz.ts b/src/codegen/ibc/applications/transfer/v1/authz.ts new file mode 100644 index 0000000..ca5a1d8 --- /dev/null +++ b/src/codegen/ibc/applications/transfer/v1/authz.ts @@ -0,0 +1,275 @@ +import { Coin, CoinAmino, CoinSDKType } from "../../../../cosmos/base/v1beta1/coin"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +/** Allocation defines the spend limit for a particular port and channel */ +export interface Allocation { + /** the port on which the packet will be sent */ + sourcePort: string; + /** the channel by which the packet will be sent */ + sourceChannel: string; + /** spend limitation on the channel */ + spendLimit: Coin[]; + /** allow list of receivers, an empty allow list permits any receiver address */ + allowList: string[]; + /** + * allow list of memo strings, an empty list prohibits all memo strings; + * a list only with "*" permits any memo string + */ + allowedPacketData: string[]; +} +export interface AllocationProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.Allocation"; + value: Uint8Array; +} +/** Allocation defines the spend limit for a particular port and channel */ +export interface AllocationAmino { + /** the port on which the packet will be sent */ + source_port?: string; + /** the channel by which the packet will be sent */ + source_channel?: string; + /** spend limitation on the channel */ + spend_limit?: CoinAmino[]; + /** allow list of receivers, an empty allow list permits any receiver address */ + allow_list?: string[]; + /** + * allow list of memo strings, an empty list prohibits all memo strings; + * a list only with "*" permits any memo string + */ + allowed_packet_data?: string[]; +} +export interface AllocationAminoMsg { + type: "cosmos-sdk/Allocation"; + value: AllocationAmino; +} +/** Allocation defines the spend limit for a particular port and channel */ +export interface AllocationSDKType { + source_port: string; + source_channel: string; + spend_limit: CoinSDKType[]; + allow_list: string[]; + allowed_packet_data: string[]; +} +/** + * TransferAuthorization allows the grantee to spend up to spend_limit coins from + * the granter's account for ibc transfer on a specific channel + */ +export interface TransferAuthorization { + /** port and channel amounts */ + allocations: Allocation[]; +} +export interface TransferAuthorizationProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.TransferAuthorization"; + value: Uint8Array; +} +/** + * TransferAuthorization allows the grantee to spend up to spend_limit coins from + * the granter's account for ibc transfer on a specific channel + */ +export interface TransferAuthorizationAmino { + /** port and channel amounts */ + allocations?: AllocationAmino[]; +} +export interface TransferAuthorizationAminoMsg { + type: "cosmos-sdk/TransferAuthorization"; + value: TransferAuthorizationAmino; +} +/** + * TransferAuthorization allows the grantee to spend up to spend_limit coins from + * the granter's account for ibc transfer on a specific channel + */ +export interface TransferAuthorizationSDKType { + allocations: AllocationSDKType[]; +} +function createBaseAllocation(): Allocation { + return { + sourcePort: "", + sourceChannel: "", + spendLimit: [], + allowList: [], + allowedPacketData: [] + }; +} +export const Allocation = { + typeUrl: "/ibc.applications.transfer.v1.Allocation", + encode(message: Allocation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sourcePort !== "") { + writer.uint32(10).string(message.sourcePort); + } + if (message.sourceChannel !== "") { + writer.uint32(18).string(message.sourceChannel); + } + for (const v of message.spendLimit) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.allowList) { + writer.uint32(34).string(v!); + } + for (const v of message.allowedPacketData) { + writer.uint32(42).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Allocation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAllocation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sourcePort = reader.string(); + break; + case 2: + message.sourceChannel = reader.string(); + break; + case 3: + message.spendLimit.push(Coin.decode(reader, reader.uint32())); + break; + case 4: + message.allowList.push(reader.string()); + break; + case 5: + message.allowedPacketData.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Allocation { + const message = createBaseAllocation(); + message.sourcePort = object.sourcePort ?? ""; + message.sourceChannel = object.sourceChannel ?? ""; + message.spendLimit = object.spendLimit?.map(e => Coin.fromPartial(e)) || []; + message.allowList = object.allowList?.map(e => e) || []; + message.allowedPacketData = object.allowedPacketData?.map(e => e) || []; + return message; + }, + fromAmino(object: AllocationAmino): Allocation { + const message = createBaseAllocation(); + if (object.source_port !== undefined && object.source_port !== null) { + message.sourcePort = object.source_port; + } + if (object.source_channel !== undefined && object.source_channel !== null) { + message.sourceChannel = object.source_channel; + } + message.spendLimit = object.spend_limit?.map(e => Coin.fromAmino(e)) || []; + message.allowList = object.allow_list?.map(e => e) || []; + message.allowedPacketData = object.allowed_packet_data?.map(e => e) || []; + return message; + }, + toAmino(message: Allocation): AllocationAmino { + const obj: any = {}; + obj.source_port = message.sourcePort === "" ? undefined : message.sourcePort; + obj.source_channel = message.sourceChannel === "" ? undefined : message.sourceChannel; + if (message.spendLimit) { + obj.spend_limit = message.spendLimit.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.spend_limit = message.spendLimit; + } + if (message.allowList) { + obj.allow_list = message.allowList.map(e => e); + } else { + obj.allow_list = message.allowList; + } + if (message.allowedPacketData) { + obj.allowed_packet_data = message.allowedPacketData.map(e => e); + } else { + obj.allowed_packet_data = message.allowedPacketData; + } + return obj; + }, + fromAminoMsg(object: AllocationAminoMsg): Allocation { + return Allocation.fromAmino(object.value); + }, + toAminoMsg(message: Allocation): AllocationAminoMsg { + return { + type: "cosmos-sdk/Allocation", + value: Allocation.toAmino(message) + }; + }, + fromProtoMsg(message: AllocationProtoMsg): Allocation { + return Allocation.decode(message.value); + }, + toProto(message: Allocation): Uint8Array { + return Allocation.encode(message).finish(); + }, + toProtoMsg(message: Allocation): AllocationProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.Allocation", + value: Allocation.encode(message).finish() + }; + } +}; +function createBaseTransferAuthorization(): TransferAuthorization { + return { + allocations: [] + }; +} +export const TransferAuthorization = { + typeUrl: "/ibc.applications.transfer.v1.TransferAuthorization", + encode(message: TransferAuthorization, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.allocations) { + Allocation.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TransferAuthorization { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTransferAuthorization(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allocations.push(Allocation.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TransferAuthorization { + const message = createBaseTransferAuthorization(); + message.allocations = object.allocations?.map(e => Allocation.fromPartial(e)) || []; + return message; + }, + fromAmino(object: TransferAuthorizationAmino): TransferAuthorization { + const message = createBaseTransferAuthorization(); + message.allocations = object.allocations?.map(e => Allocation.fromAmino(e)) || []; + return message; + }, + toAmino(message: TransferAuthorization): TransferAuthorizationAmino { + const obj: any = {}; + if (message.allocations) { + obj.allocations = message.allocations.map(e => e ? Allocation.toAmino(e) : undefined); + } else { + obj.allocations = message.allocations; + } + return obj; + }, + fromAminoMsg(object: TransferAuthorizationAminoMsg): TransferAuthorization { + return TransferAuthorization.fromAmino(object.value); + }, + toAminoMsg(message: TransferAuthorization): TransferAuthorizationAminoMsg { + return { + type: "cosmos-sdk/TransferAuthorization", + value: TransferAuthorization.toAmino(message) + }; + }, + fromProtoMsg(message: TransferAuthorizationProtoMsg): TransferAuthorization { + return TransferAuthorization.decode(message.value); + }, + toProto(message: TransferAuthorization): Uint8Array { + return TransferAuthorization.encode(message).finish(); + }, + toProtoMsg(message: TransferAuthorization): TransferAuthorizationProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.TransferAuthorization", + value: TransferAuthorization.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/ibc/applications/transfer/v1/genesis.ts b/src/codegen/ibc/applications/transfer/v1/genesis.ts index ee8bb4b..3aa8ad3 100644 --- a/src/codegen/ibc/applications/transfer/v1/genesis.ts +++ b/src/codegen/ibc/applications/transfer/v1/genesis.ts @@ -1,10 +1,16 @@ import { DenomTrace, DenomTraceAmino, DenomTraceSDKType, Params, ParamsAmino, ParamsSDKType } from "./transfer"; +import { Coin, CoinAmino, CoinSDKType } from "../../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../../binary"; /** GenesisState defines the ibc-transfer genesis state */ export interface GenesisState { portId: string; denomTraces: DenomTrace[]; params: Params; + /** + * total_escrowed contains the total amount of tokens escrowed + * by the transfer module + */ + totalEscrowed: Coin[]; } export interface GenesisStateProtoMsg { typeUrl: "/ibc.applications.transfer.v1.GenesisState"; @@ -15,6 +21,11 @@ export interface GenesisStateAmino { port_id?: string; denom_traces?: DenomTraceAmino[]; params?: ParamsAmino; + /** + * total_escrowed contains the total amount of tokens escrowed + * by the transfer module + */ + total_escrowed?: CoinAmino[]; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -25,12 +36,14 @@ export interface GenesisStateSDKType { port_id: string; denom_traces: DenomTraceSDKType[]; params: ParamsSDKType; + total_escrowed: CoinSDKType[]; } function createBaseGenesisState(): GenesisState { return { portId: "", denomTraces: [], - params: Params.fromPartial({}) + params: Params.fromPartial({}), + totalEscrowed: [] }; } export const GenesisState = { @@ -45,6 +58,9 @@ export const GenesisState = { if (message.params !== undefined) { Params.encode(message.params, writer.uint32(26).fork()).ldelim(); } + for (const v of message.totalEscrowed) { + Coin.encode(v!, writer.uint32(34).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { @@ -63,6 +79,9 @@ export const GenesisState = { case 3: message.params = Params.decode(reader, reader.uint32()); break; + case 4: + message.totalEscrowed.push(Coin.decode(reader, reader.uint32())); + break; default: reader.skipType(tag & 7); break; @@ -75,6 +94,7 @@ export const GenesisState = { message.portId = object.portId ?? ""; message.denomTraces = object.denomTraces?.map(e => DenomTrace.fromPartial(e)) || []; message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.totalEscrowed = object.totalEscrowed?.map(e => Coin.fromPartial(e)) || []; return message; }, fromAmino(object: GenesisStateAmino): GenesisState { @@ -86,6 +106,7 @@ export const GenesisState = { if (object.params !== undefined && object.params !== null) { message.params = Params.fromAmino(object.params); } + message.totalEscrowed = object.total_escrowed?.map(e => Coin.fromAmino(e)) || []; return message; }, toAmino(message: GenesisState): GenesisStateAmino { @@ -97,6 +118,11 @@ export const GenesisState = { obj.denom_traces = message.denomTraces; } obj.params = message.params ? Params.toAmino(message.params) : undefined; + if (message.totalEscrowed) { + obj.total_escrowed = message.totalEscrowed.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.total_escrowed = message.totalEscrowed; + } return obj; }, fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { diff --git a/src/codegen/ibc/applications/transfer/v1/query.lcd.ts b/src/codegen/ibc/applications/transfer/v1/query.lcd.ts index 3e61d40..28cf41a 100644 --- a/src/codegen/ibc/applications/transfer/v1/query.lcd.ts +++ b/src/codegen/ibc/applications/transfer/v1/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../../../helpers"; import { LCDClient } from "@cosmology/lcd"; -import { QueryDenomTracesRequest, QueryDenomTracesResponseSDKType, QueryDenomTraceRequest, QueryDenomTraceResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType, QueryDenomHashRequest, QueryDenomHashResponseSDKType, QueryEscrowAddressRequest, QueryEscrowAddressResponseSDKType } from "./query"; +import { QueryDenomTracesRequest, QueryDenomTracesResponseSDKType, QueryDenomTraceRequest, QueryDenomTraceResponseSDKType, QueryParamsRequest, QueryParamsResponseSDKType, QueryDenomHashRequest, QueryDenomHashResponseSDKType, QueryEscrowAddressRequest, QueryEscrowAddressResponseSDKType, QueryTotalEscrowForDenomRequest, QueryTotalEscrowForDenomResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -14,6 +14,7 @@ export class LCDQueryClient { this.params = this.params.bind(this); this.denomHash = this.denomHash.bind(this); this.escrowAddress = this.escrowAddress.bind(this); + this.totalEscrowForDenom = this.totalEscrowForDenom.bind(this); } /* DenomTraces queries all denomination traces. */ async denomTraces(params: QueryDenomTracesRequest = { @@ -60,4 +61,15 @@ export class LCDQueryClient { const endpoint = `ibc/apps/transfer/v1/channels/${params.channelId}/ports/${params.portId}/escrow_address`; return await this.req.get(endpoint); } + /* TotalEscrowForDenom returns the total amount of tokens in escrow based on the denom. */ + async totalEscrowForDenom(params: QueryTotalEscrowForDenomRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.denom !== "undefined") { + options.params.denom = params.denom; + } + const endpoint = `ibc/apps/transfer/v1/denoms/${params.denom}/total_escrow`; + return await this.req.get(endpoint, options); + } } \ No newline at end of file diff --git a/src/codegen/ibc/applications/transfer/v1/query.rpc.Query.ts b/src/codegen/ibc/applications/transfer/v1/query.rpc.Query.ts index 5a15985..2bb450c 100644 --- a/src/codegen/ibc/applications/transfer/v1/query.rpc.Query.ts +++ b/src/codegen/ibc/applications/transfer/v1/query.rpc.Query.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../../../helpers"; import { BinaryReader } from "../../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryDenomTracesRequest, QueryDenomTracesResponse, QueryDenomTraceRequest, QueryDenomTraceResponse, QueryParamsRequest, QueryParamsResponse, QueryDenomHashRequest, QueryDenomHashResponse, QueryEscrowAddressRequest, QueryEscrowAddressResponse } from "./query"; +import { QueryDenomTracesRequest, QueryDenomTracesResponse, QueryDenomTraceRequest, QueryDenomTraceResponse, QueryParamsRequest, QueryParamsResponse, QueryDenomHashRequest, QueryDenomHashResponse, QueryEscrowAddressRequest, QueryEscrowAddressResponse, QueryTotalEscrowForDenomRequest, QueryTotalEscrowForDenomResponse } from "./query"; /** Query provides defines the gRPC querier service. */ export interface Query { /** DenomTraces queries all denomination traces. */ @@ -14,6 +14,8 @@ export interface Query { denomHash(request: QueryDenomHashRequest): Promise; /** EscrowAddress returns the escrow address for a particular port and channel id. */ escrowAddress(request: QueryEscrowAddressRequest): Promise; + /** TotalEscrowForDenom returns the total amount of tokens in escrow based on the denom. */ + totalEscrowForDenom(request: QueryTotalEscrowForDenomRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -24,6 +26,7 @@ export class QueryClientImpl implements Query { this.params = this.params.bind(this); this.denomHash = this.denomHash.bind(this); this.escrowAddress = this.escrowAddress.bind(this); + this.totalEscrowForDenom = this.totalEscrowForDenom.bind(this); } denomTraces(request: QueryDenomTracesRequest = { pagination: undefined @@ -52,6 +55,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "EscrowAddress", data); return promise.then(data => QueryEscrowAddressResponse.decode(new BinaryReader(data))); } + totalEscrowForDenom(request: QueryTotalEscrowForDenomRequest): Promise { + const data = QueryTotalEscrowForDenomRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.transfer.v1.Query", "TotalEscrowForDenom", data); + return promise.then(data => QueryTotalEscrowForDenomResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -71,6 +79,9 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, escrowAddress(request: QueryEscrowAddressRequest): Promise { return queryService.escrowAddress(request); + }, + totalEscrowForDenom(request: QueryTotalEscrowForDenomRequest): Promise { + return queryService.totalEscrowForDenom(request); } }; }; \ No newline at end of file diff --git a/src/codegen/ibc/applications/transfer/v1/query.ts b/src/codegen/ibc/applications/transfer/v1/query.ts index 956c080..9caf222 100644 --- a/src/codegen/ibc/applications/transfer/v1/query.ts +++ b/src/codegen/ibc/applications/transfer/v1/query.ts @@ -1,5 +1,6 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../../cosmos/base/query/v1beta1/pagination"; import { DenomTrace, DenomTraceAmino, DenomTraceSDKType, Params, ParamsAmino, ParamsSDKType } from "./transfer"; +import { Coin, CoinAmino, CoinSDKType } from "../../../../cosmos/base/v1beta1/coin"; import { BinaryReader, BinaryWriter } from "../../../../binary"; /** * QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC @@ -277,6 +278,46 @@ export interface QueryEscrowAddressResponseAminoMsg { export interface QueryEscrowAddressResponseSDKType { escrow_address: string; } +/** QueryTotalEscrowForDenomRequest is the request type for TotalEscrowForDenom RPC method. */ +export interface QueryTotalEscrowForDenomRequest { + denom: string; +} +export interface QueryTotalEscrowForDenomRequestProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.QueryTotalEscrowForDenomRequest"; + value: Uint8Array; +} +/** QueryTotalEscrowForDenomRequest is the request type for TotalEscrowForDenom RPC method. */ +export interface QueryTotalEscrowForDenomRequestAmino { + denom?: string; +} +export interface QueryTotalEscrowForDenomRequestAminoMsg { + type: "cosmos-sdk/QueryTotalEscrowForDenomRequest"; + value: QueryTotalEscrowForDenomRequestAmino; +} +/** QueryTotalEscrowForDenomRequest is the request type for TotalEscrowForDenom RPC method. */ +export interface QueryTotalEscrowForDenomRequestSDKType { + denom: string; +} +/** QueryTotalEscrowForDenomResponse is the response type for TotalEscrowForDenom RPC method. */ +export interface QueryTotalEscrowForDenomResponse { + amount: Coin; +} +export interface QueryTotalEscrowForDenomResponseProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.QueryTotalEscrowForDenomResponse"; + value: Uint8Array; +} +/** QueryTotalEscrowForDenomResponse is the response type for TotalEscrowForDenom RPC method. */ +export interface QueryTotalEscrowForDenomResponseAmino { + amount?: CoinAmino; +} +export interface QueryTotalEscrowForDenomResponseAminoMsg { + type: "cosmos-sdk/QueryTotalEscrowForDenomResponse"; + value: QueryTotalEscrowForDenomResponseAmino; +} +/** QueryTotalEscrowForDenomResponse is the response type for TotalEscrowForDenom RPC method. */ +export interface QueryTotalEscrowForDenomResponseSDKType { + amount: CoinSDKType; +} function createBaseQueryDenomTraceRequest(): QueryDenomTraceRequest { return { hash: "" @@ -979,4 +1020,142 @@ export const QueryEscrowAddressResponse = { value: QueryEscrowAddressResponse.encode(message).finish() }; } +}; +function createBaseQueryTotalEscrowForDenomRequest(): QueryTotalEscrowForDenomRequest { + return { + denom: "" + }; +} +export const QueryTotalEscrowForDenomRequest = { + typeUrl: "/ibc.applications.transfer.v1.QueryTotalEscrowForDenomRequest", + encode(message: QueryTotalEscrowForDenomRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTotalEscrowForDenomRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTotalEscrowForDenomRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryTotalEscrowForDenomRequest { + const message = createBaseQueryTotalEscrowForDenomRequest(); + message.denom = object.denom ?? ""; + return message; + }, + fromAmino(object: QueryTotalEscrowForDenomRequestAmino): QueryTotalEscrowForDenomRequest { + const message = createBaseQueryTotalEscrowForDenomRequest(); + if (object.denom !== undefined && object.denom !== null) { + message.denom = object.denom; + } + return message; + }, + toAmino(message: QueryTotalEscrowForDenomRequest): QueryTotalEscrowForDenomRequestAmino { + const obj: any = {}; + obj.denom = message.denom === "" ? undefined : message.denom; + return obj; + }, + fromAminoMsg(object: QueryTotalEscrowForDenomRequestAminoMsg): QueryTotalEscrowForDenomRequest { + return QueryTotalEscrowForDenomRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryTotalEscrowForDenomRequest): QueryTotalEscrowForDenomRequestAminoMsg { + return { + type: "cosmos-sdk/QueryTotalEscrowForDenomRequest", + value: QueryTotalEscrowForDenomRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryTotalEscrowForDenomRequestProtoMsg): QueryTotalEscrowForDenomRequest { + return QueryTotalEscrowForDenomRequest.decode(message.value); + }, + toProto(message: QueryTotalEscrowForDenomRequest): Uint8Array { + return QueryTotalEscrowForDenomRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryTotalEscrowForDenomRequest): QueryTotalEscrowForDenomRequestProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.QueryTotalEscrowForDenomRequest", + value: QueryTotalEscrowForDenomRequest.encode(message).finish() + }; + } +}; +function createBaseQueryTotalEscrowForDenomResponse(): QueryTotalEscrowForDenomResponse { + return { + amount: Coin.fromPartial({}) + }; +} +export const QueryTotalEscrowForDenomResponse = { + typeUrl: "/ibc.applications.transfer.v1.QueryTotalEscrowForDenomResponse", + encode(message: QueryTotalEscrowForDenomResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryTotalEscrowForDenomResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTotalEscrowForDenomResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount = Coin.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryTotalEscrowForDenomResponse { + const message = createBaseQueryTotalEscrowForDenomResponse(); + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + }, + fromAmino(object: QueryTotalEscrowForDenomResponseAmino): QueryTotalEscrowForDenomResponse { + const message = createBaseQueryTotalEscrowForDenomResponse(); + if (object.amount !== undefined && object.amount !== null) { + message.amount = Coin.fromAmino(object.amount); + } + return message; + }, + toAmino(message: QueryTotalEscrowForDenomResponse): QueryTotalEscrowForDenomResponseAmino { + const obj: any = {}; + obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined; + return obj; + }, + fromAminoMsg(object: QueryTotalEscrowForDenomResponseAminoMsg): QueryTotalEscrowForDenomResponse { + return QueryTotalEscrowForDenomResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryTotalEscrowForDenomResponse): QueryTotalEscrowForDenomResponseAminoMsg { + return { + type: "cosmos-sdk/QueryTotalEscrowForDenomResponse", + value: QueryTotalEscrowForDenomResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryTotalEscrowForDenomResponseProtoMsg): QueryTotalEscrowForDenomResponse { + return QueryTotalEscrowForDenomResponse.decode(message.value); + }, + toProto(message: QueryTotalEscrowForDenomResponse): Uint8Array { + return QueryTotalEscrowForDenomResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryTotalEscrowForDenomResponse): QueryTotalEscrowForDenomResponseProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.QueryTotalEscrowForDenomResponse", + value: QueryTotalEscrowForDenomResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/src/codegen/ibc/applications/transfer/v1/tx.amino.ts b/src/codegen/ibc/applications/transfer/v1/tx.amino.ts index 65002c1..0ebb51c 100644 --- a/src/codegen/ibc/applications/transfer/v1/tx.amino.ts +++ b/src/codegen/ibc/applications/transfer/v1/tx.amino.ts @@ -1,8 +1,13 @@ -import { MsgTransfer } from "./tx"; +import { MsgTransfer, MsgUpdateParams } from "./tx"; export const AminoConverter = { "/ibc.applications.transfer.v1.MsgTransfer": { aminoType: "cosmos-sdk/MsgTransfer", toAmino: MsgTransfer.toAmino, fromAmino: MsgTransfer.fromAmino + }, + "/ibc.applications.transfer.v1.MsgUpdateParams": { + aminoType: "cosmos-sdk/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino } }; \ No newline at end of file diff --git a/src/codegen/ibc/applications/transfer/v1/tx.registry.ts b/src/codegen/ibc/applications/transfer/v1/tx.registry.ts index 6726e57..5a11b2e 100644 --- a/src/codegen/ibc/applications/transfer/v1/tx.registry.ts +++ b/src/codegen/ibc/applications/transfer/v1/tx.registry.ts @@ -1,6 +1,6 @@ import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgTransfer } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.applications.transfer.v1.MsgTransfer", MsgTransfer]]; +import { MsgTransfer, MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.applications.transfer.v1.MsgTransfer", MsgTransfer], ["/ibc.applications.transfer.v1.MsgUpdateParams", MsgUpdateParams]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -13,6 +13,12 @@ export const MessageComposer = { typeUrl: "/ibc.applications.transfer.v1.MsgTransfer", value: MsgTransfer.encode(value).finish() }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; } }, withTypeUrl: { @@ -21,6 +27,12 @@ export const MessageComposer = { typeUrl: "/ibc.applications.transfer.v1.MsgTransfer", value }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParams", + value + }; } }, fromPartial: { @@ -29,6 +41,12 @@ export const MessageComposer = { typeUrl: "/ibc.applications.transfer.v1.MsgTransfer", value: MsgTransfer.fromPartial(value) }; + }, + updateParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/src/codegen/ibc/applications/transfer/v1/tx.rpc.msg.ts b/src/codegen/ibc/applications/transfer/v1/tx.rpc.msg.ts index c4f2857..20d9f8a 100644 --- a/src/codegen/ibc/applications/transfer/v1/tx.rpc.msg.ts +++ b/src/codegen/ibc/applications/transfer/v1/tx.rpc.msg.ts @@ -1,20 +1,28 @@ import { Rpc } from "../../../../helpers"; import { BinaryReader } from "../../../../binary"; -import { MsgTransfer, MsgTransferResponse } from "./tx"; +import { MsgTransfer, MsgTransferResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; /** Msg defines the ibc/transfer Msg service. */ export interface Msg { /** Transfer defines a rpc handler method for MsgTransfer. */ transfer(request: MsgTransfer): Promise; + /** UpdateParams defines a rpc handler for MsgUpdateParams. */ + updateParams(request: MsgUpdateParams): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; this.transfer = this.transfer.bind(this); + this.updateParams = this.updateParams.bind(this); } transfer(request: MsgTransfer): Promise { const data = MsgTransfer.encode(request).finish(); const promise = this.rpc.request("ibc.applications.transfer.v1.Msg", "Transfer", data); return promise.then(data => MsgTransferResponse.decode(new BinaryReader(data))); } + updateParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("ibc.applications.transfer.v1.Msg", "UpdateParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } } \ No newline at end of file diff --git a/src/codegen/ibc/applications/transfer/v1/tx.ts b/src/codegen/ibc/applications/transfer/v1/tx.ts index cb56508..6090778 100644 --- a/src/codegen/ibc/applications/transfer/v1/tx.ts +++ b/src/codegen/ibc/applications/transfer/v1/tx.ts @@ -1,5 +1,5 @@ import { Coin, CoinAmino, CoinSDKType } from "../../../../cosmos/base/v1beta1/coin"; -import { Height, HeightAmino, HeightSDKType } from "../../../core/client/v1/client"; +import { Height, HeightAmino, HeightSDKType, Params, ParamsAmino, ParamsSDKType } from "../../../core/client/v1/client"; import { BinaryReader, BinaryWriter } from "../../../../binary"; /** * MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between @@ -45,7 +45,7 @@ export interface MsgTransferAmino { /** the channel by which the packet will be sent */ source_channel?: string; /** the tokens to be transferred */ - token?: CoinAmino; + token: CoinAmino; /** the sender address */ sender?: string; /** the recipient address on the destination chain */ @@ -54,7 +54,7 @@ export interface MsgTransferAmino { * Timeout height relative to the current block height. * The timeout is disabled when set to 0. */ - timeout_height?: HeightAmino; + timeout_height: HeightAmino; /** * Timeout timestamp in absolute nanoseconds since unix epoch. * The timeout is disabled when set to 0. @@ -104,6 +104,64 @@ export interface MsgTransferResponseAminoMsg { export interface MsgTransferResponseSDKType { sequence: bigint; } +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParams { + /** signer address */ + signer: string; + /** + * params defines the transfer parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParamsAmino { + /** signer address */ + signer?: string; + /** + * params defines the transfer parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params?: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** MsgUpdateParams is the Msg/UpdateParams request type. */ +export interface MsgUpdateParamsSDKType { + signer: string; + params: ParamsSDKType; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** + * MsgUpdateParamsResponse defines the response structure for executing a + * MsgUpdateParams message. + */ +export interface MsgUpdateParamsResponseSDKType {} function createBaseMsgTransfer(): MsgTransfer { return { sourcePort: "", @@ -227,7 +285,7 @@ export const MsgTransfer = { const obj: any = {}; obj.source_port = message.sourcePort === "" ? undefined : message.sourcePort; obj.source_channel = message.sourceChannel === "" ? undefined : message.sourceChannel; - obj.token = message.token ? Coin.toAmino(message.token) : undefined; + obj.token = message.token ? Coin.toAmino(message.token) : Coin.toAmino(Coin.fromPartial({})); obj.sender = message.sender === "" ? undefined : message.sender; obj.receiver = message.receiver === "" ? undefined : message.receiver; obj.timeout_height = message.timeoutHeight ? Height.toAmino(message.timeoutHeight) : {}; @@ -325,4 +383,141 @@ export const MsgTransferResponse = { value: MsgTransferResponse.encode(message).finish() }; } +}; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + signer: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.signer = object.signer ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.signer = message.signer === "" ? undefined : message.signer; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/ibc.applications.transfer.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/src/codegen/ibc/bundle.ts b/src/codegen/ibc/bundle.ts index c7fc217..7ee4828 100644 --- a/src/codegen/ibc/bundle.ts +++ b/src/codegen/ibc/bundle.ts @@ -1,204 +1,260 @@ -import * as _89 from "./applications/fee/v1/ack"; -import * as _90 from "./applications/fee/v1/fee"; -import * as _91 from "./applications/fee/v1/genesis"; -import * as _92 from "./applications/fee/v1/metadata"; -import * as _93 from "./applications/fee/v1/query"; -import * as _94 from "./applications/fee/v1/tx"; -import * as _95 from "./applications/interchain_accounts/controller/v1/controller"; -import * as _96 from "./applications/interchain_accounts/controller/v1/query"; -import * as _97 from "./applications/interchain_accounts/host/v1/host"; -import * as _98 from "./applications/interchain_accounts/host/v1/query"; -import * as _99 from "./applications/interchain_accounts/v1/account"; -import * as _100 from "./applications/interchain_accounts/v1/genesis"; -import * as _101 from "./applications/interchain_accounts/v1/metadata"; -import * as _102 from "./applications/interchain_accounts/v1/packet"; -import * as _103 from "./applications/transfer/v1/genesis"; -import * as _104 from "./applications/transfer/v1/query"; -import * as _105 from "./applications/transfer/v1/transfer"; -import * as _106 from "./applications/transfer/v1/tx"; -import * as _107 from "./applications/transfer/v2/packet"; -import * as _108 from "./core/channel/v1/channel"; -import * as _109 from "./core/channel/v1/genesis"; -import * as _110 from "./core/channel/v1/query"; -import * as _111 from "./core/channel/v1/tx"; -import * as _112 from "./core/client/v1/client"; -import * as _113 from "./core/client/v1/genesis"; -import * as _114 from "./core/client/v1/query"; -import * as _115 from "./core/client/v1/tx"; -import * as _116 from "./core/commitment/v1/commitment"; -import * as _117 from "./core/connection/v1/connection"; -import * as _118 from "./core/connection/v1/genesis"; -import * as _119 from "./core/connection/v1/query"; -import * as _120 from "./core/connection/v1/tx"; -import * as _121 from "./core/types/v1/genesis"; -import * as _122 from "./lightclients/localhost/v1/localhost"; -import * as _123 from "./lightclients/solomachine/v1/solomachine"; -import * as _124 from "./lightclients/solomachine/v2/solomachine"; -import * as _125 from "./lightclients/tendermint/v1/tendermint"; -import * as _202 from "./applications/fee/v1/tx.amino"; -import * as _203 from "./applications/transfer/v1/tx.amino"; -import * as _204 from "./core/channel/v1/tx.amino"; -import * as _205 from "./core/client/v1/tx.amino"; -import * as _206 from "./core/connection/v1/tx.amino"; -import * as _207 from "./applications/fee/v1/tx.registry"; -import * as _208 from "./applications/transfer/v1/tx.registry"; -import * as _209 from "./core/channel/v1/tx.registry"; -import * as _210 from "./core/client/v1/tx.registry"; -import * as _211 from "./core/connection/v1/tx.registry"; -import * as _212 from "./applications/fee/v1/query.lcd"; -import * as _213 from "./applications/interchain_accounts/controller/v1/query.lcd"; -import * as _214 from "./applications/interchain_accounts/host/v1/query.lcd"; -import * as _215 from "./applications/transfer/v1/query.lcd"; -import * as _216 from "./core/channel/v1/query.lcd"; -import * as _217 from "./core/client/v1/query.lcd"; -import * as _218 from "./core/connection/v1/query.lcd"; -import * as _219 from "./applications/fee/v1/query.rpc.Query"; -import * as _220 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; -import * as _221 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; -import * as _222 from "./applications/transfer/v1/query.rpc.Query"; -import * as _223 from "./core/channel/v1/query.rpc.Query"; -import * as _224 from "./core/client/v1/query.rpc.Query"; -import * as _225 from "./core/connection/v1/query.rpc.Query"; -import * as _226 from "./applications/fee/v1/tx.rpc.msg"; -import * as _227 from "./applications/transfer/v1/tx.rpc.msg"; -import * as _228 from "./core/channel/v1/tx.rpc.msg"; -import * as _229 from "./core/client/v1/tx.rpc.msg"; -import * as _230 from "./core/connection/v1/tx.rpc.msg"; -import * as _237 from "./lcd"; -import * as _238 from "./rpc.query"; -import * as _239 from "./rpc.tx"; +import * as _161 from "./applications/fee/v1/ack"; +import * as _162 from "./applications/fee/v1/fee"; +import * as _163 from "./applications/fee/v1/genesis"; +import * as _164 from "./applications/fee/v1/metadata"; +import * as _165 from "./applications/fee/v1/query"; +import * as _166 from "./applications/fee/v1/tx"; +import * as _167 from "./applications/interchain_accounts/controller/v1/controller"; +import * as _168 from "./applications/interchain_accounts/controller/v1/query"; +import * as _169 from "./applications/interchain_accounts/controller/v1/tx"; +import * as _170 from "./applications/interchain_accounts/genesis/v1/genesis"; +import * as _171 from "./applications/interchain_accounts/host/v1/host"; +import * as _172 from "./applications/interchain_accounts/host/v1/query"; +import * as _173 from "./applications/interchain_accounts/host/v1/tx"; +import * as _174 from "./applications/interchain_accounts/v1/account"; +import * as _175 from "./applications/interchain_accounts/v1/genesis"; +import * as _176 from "./applications/interchain_accounts/v1/metadata"; +import * as _177 from "./applications/interchain_accounts/v1/packet"; +import * as _178 from "./applications/transfer/v1/authz"; +import * as _179 from "./applications/transfer/v1/genesis"; +import * as _180 from "./applications/transfer/v1/query"; +import * as _181 from "./applications/transfer/v1/transfer"; +import * as _182 from "./applications/transfer/v1/tx"; +import * as _183 from "./applications/transfer/v2/packet"; +import * as _184 from "./core/channel/v1/channel"; +import * as _185 from "./core/channel/v1/genesis"; +import * as _186 from "./core/channel/v1/query"; +import * as _187 from "./core/channel/v1/tx"; +import * as _188 from "./core/channel/v1/upgrade"; +import * as _189 from "./core/client/v1/client"; +import * as _190 from "./core/client/v1/genesis"; +import * as _191 from "./core/client/v1/query"; +import * as _192 from "./core/client/v1/tx"; +import * as _193 from "./core/commitment/v1/commitment"; +import * as _194 from "./core/connection/v1/connection"; +import * as _195 from "./core/connection/v1/genesis"; +import * as _196 from "./core/connection/v1/query"; +import * as _197 from "./core/connection/v1/tx"; +import * as _198 from "./core/types/v1/genesis"; +import * as _199 from "./lightclients/localhost/v1/localhost"; +import * as _200 from "./lightclients/localhost/v2/localhost"; +import * as _201 from "./lightclients/solomachine/v1/solomachine"; +import * as _202 from "./lightclients/solomachine/v2/solomachine"; +import * as _203 from "./lightclients/solomachine/v3/solomachine"; +import * as _204 from "./lightclients/tendermint/v1/tendermint"; +import * as _205 from "./lightclients/wasm/v1/genesis"; +import * as _206 from "./lightclients/wasm/v1/query"; +import * as _207 from "./lightclients/wasm/v1/tx"; +import * as _208 from "./lightclients/wasm/v1/wasm"; +import * as _327 from "./applications/fee/v1/tx.amino"; +import * as _328 from "./applications/interchain_accounts/controller/v1/tx.amino"; +import * as _329 from "./applications/interchain_accounts/host/v1/tx.amino"; +import * as _330 from "./applications/transfer/v1/tx.amino"; +import * as _331 from "./core/channel/v1/tx.amino"; +import * as _332 from "./core/client/v1/tx.amino"; +import * as _333 from "./core/connection/v1/tx.amino"; +import * as _334 from "./lightclients/wasm/v1/tx.amino"; +import * as _335 from "./applications/fee/v1/tx.registry"; +import * as _336 from "./applications/interchain_accounts/controller/v1/tx.registry"; +import * as _337 from "./applications/interchain_accounts/host/v1/tx.registry"; +import * as _338 from "./applications/transfer/v1/tx.registry"; +import * as _339 from "./core/channel/v1/tx.registry"; +import * as _340 from "./core/client/v1/tx.registry"; +import * as _341 from "./core/connection/v1/tx.registry"; +import * as _342 from "./lightclients/wasm/v1/tx.registry"; +import * as _343 from "./applications/fee/v1/query.lcd"; +import * as _344 from "./applications/interchain_accounts/controller/v1/query.lcd"; +import * as _345 from "./applications/interchain_accounts/host/v1/query.lcd"; +import * as _346 from "./applications/transfer/v1/query.lcd"; +import * as _347 from "./core/channel/v1/query.lcd"; +import * as _348 from "./core/client/v1/query.lcd"; +import * as _349 from "./core/connection/v1/query.lcd"; +import * as _350 from "./lightclients/wasm/v1/query.lcd"; +import * as _351 from "./applications/fee/v1/query.rpc.Query"; +import * as _352 from "./applications/interchain_accounts/controller/v1/query.rpc.Query"; +import * as _353 from "./applications/interchain_accounts/host/v1/query.rpc.Query"; +import * as _354 from "./applications/transfer/v1/query.rpc.Query"; +import * as _355 from "./core/channel/v1/query.rpc.Query"; +import * as _356 from "./core/client/v1/query.rpc.Query"; +import * as _357 from "./core/connection/v1/query.rpc.Query"; +import * as _358 from "./lightclients/wasm/v1/query.rpc.Query"; +import * as _359 from "./applications/fee/v1/tx.rpc.msg"; +import * as _360 from "./applications/interchain_accounts/controller/v1/tx.rpc.msg"; +import * as _361 from "./applications/interchain_accounts/host/v1/tx.rpc.msg"; +import * as _362 from "./applications/transfer/v1/tx.rpc.msg"; +import * as _363 from "./core/channel/v1/tx.rpc.msg"; +import * as _364 from "./core/client/v1/tx.rpc.msg"; +import * as _365 from "./core/connection/v1/tx.rpc.msg"; +import * as _366 from "./lightclients/wasm/v1/tx.rpc.msg"; +import * as _373 from "./lcd"; +import * as _374 from "./rpc.query"; +import * as _375 from "./rpc.tx"; export namespace ibc { export namespace applications { export namespace fee { export const v1 = { - ..._89, - ..._90, - ..._91, - ..._92, - ..._93, - ..._94, - ..._202, - ..._207, - ..._212, - ..._219, - ..._226 + ..._161, + ..._162, + ..._163, + ..._164, + ..._165, + ..._166, + ..._327, + ..._335, + ..._343, + ..._351, + ..._359 }; } export namespace interchain_accounts { export namespace controller { export const v1 = { - ..._95, - ..._96, - ..._213, - ..._220 + ..._167, + ..._168, + ..._169, + ..._328, + ..._336, + ..._344, + ..._352, + ..._360 + }; + } + export namespace genesis { + export const v1 = { + ..._170 }; } export namespace host { export const v1 = { - ..._97, - ..._98, - ..._214, - ..._221 + ..._171, + ..._172, + ..._173, + ..._329, + ..._337, + ..._345, + ..._353, + ..._361 }; } export const v1 = { - ..._99, - ..._100, - ..._101, - ..._102 + ..._174, + ..._175, + ..._176, + ..._177 }; } export namespace transfer { export const v1 = { - ..._103, - ..._104, - ..._105, - ..._106, - ..._203, - ..._208, - ..._215, - ..._222, - ..._227 + ..._178, + ..._179, + ..._180, + ..._181, + ..._182, + ..._330, + ..._338, + ..._346, + ..._354, + ..._362 }; export const v2 = { - ..._107 + ..._183 }; } } export namespace core { export namespace channel { export const v1 = { - ..._108, - ..._109, - ..._110, - ..._111, - ..._204, - ..._209, - ..._216, - ..._223, - ..._228 + ..._184, + ..._185, + ..._186, + ..._187, + ..._188, + ..._331, + ..._339, + ..._347, + ..._355, + ..._363 }; } export namespace client { export const v1 = { - ..._112, - ..._113, - ..._114, - ..._115, - ..._205, - ..._210, - ..._217, - ..._224, - ..._229 + ..._189, + ..._190, + ..._191, + ..._192, + ..._332, + ..._340, + ..._348, + ..._356, + ..._364 }; } export namespace commitment { export const v1 = { - ..._116 + ..._193 }; } export namespace connection { export const v1 = { - ..._117, - ..._118, - ..._119, - ..._120, - ..._206, - ..._211, - ..._218, - ..._225, - ..._230 + ..._194, + ..._195, + ..._196, + ..._197, + ..._333, + ..._341, + ..._349, + ..._357, + ..._365 }; } export namespace types { export const v1 = { - ..._121 + ..._198 }; } } export namespace lightclients { export namespace localhost { export const v1 = { - ..._122 + ..._199 + }; + export const v2 = { + ..._200 }; } export namespace solomachine { export const v1 = { - ..._123 + ..._201 }; export const v2 = { - ..._124 + ..._202 + }; + export const v3 = { + ..._203 }; } export namespace tendermint { export const v1 = { - ..._125 + ..._204 + }; + } + export namespace wasm { + export const v1 = { + ..._205, + ..._206, + ..._207, + ..._208, + ..._334, + ..._342, + ..._350, + ..._358, + ..._366 }; } } export const ClientFactory = { - ..._237, - ..._238, - ..._239 + ..._373, + ..._374, + ..._375 }; } \ No newline at end of file diff --git a/src/codegen/ibc/client.ts b/src/codegen/ibc/client.ts index bfc549d..5b1c2f6 100644 --- a/src/codegen/ibc/client.ts +++ b/src/codegen/ibc/client.ts @@ -2,23 +2,32 @@ import { GeneratedType, Registry, OfflineSigner } from "@cosmjs/proto-signing"; import { defaultRegistryTypes, AminoTypes, SigningStargateClient } from "@cosmjs/stargate"; import { HttpEndpoint } from "@cosmjs/tendermint-rpc"; import * as ibcApplicationsFeeV1TxRegistry from "./applications/fee/v1/tx.registry"; +import * as ibcApplicationsInterchainAccountsControllerV1TxRegistry from "./applications/interchain_accounts/controller/v1/tx.registry"; +import * as ibcApplicationsInterchainAccountsHostV1TxRegistry from "./applications/interchain_accounts/host/v1/tx.registry"; import * as ibcApplicationsTransferV1TxRegistry from "./applications/transfer/v1/tx.registry"; import * as ibcCoreChannelV1TxRegistry from "./core/channel/v1/tx.registry"; import * as ibcCoreClientV1TxRegistry from "./core/client/v1/tx.registry"; import * as ibcCoreConnectionV1TxRegistry from "./core/connection/v1/tx.registry"; +import * as ibcLightclientsWasmV1TxRegistry from "./lightclients/wasm/v1/tx.registry"; import * as ibcApplicationsFeeV1TxAmino from "./applications/fee/v1/tx.amino"; +import * as ibcApplicationsInterchainAccountsControllerV1TxAmino from "./applications/interchain_accounts/controller/v1/tx.amino"; +import * as ibcApplicationsInterchainAccountsHostV1TxAmino from "./applications/interchain_accounts/host/v1/tx.amino"; import * as ibcApplicationsTransferV1TxAmino from "./applications/transfer/v1/tx.amino"; import * as ibcCoreChannelV1TxAmino from "./core/channel/v1/tx.amino"; import * as ibcCoreClientV1TxAmino from "./core/client/v1/tx.amino"; import * as ibcCoreConnectionV1TxAmino from "./core/connection/v1/tx.amino"; +import * as ibcLightclientsWasmV1TxAmino from "./lightclients/wasm/v1/tx.amino"; export const ibcAminoConverters = { ...ibcApplicationsFeeV1TxAmino.AminoConverter, + ...ibcApplicationsInterchainAccountsControllerV1TxAmino.AminoConverter, + ...ibcApplicationsInterchainAccountsHostV1TxAmino.AminoConverter, ...ibcApplicationsTransferV1TxAmino.AminoConverter, ...ibcCoreChannelV1TxAmino.AminoConverter, ...ibcCoreClientV1TxAmino.AminoConverter, - ...ibcCoreConnectionV1TxAmino.AminoConverter + ...ibcCoreConnectionV1TxAmino.AminoConverter, + ...ibcLightclientsWasmV1TxAmino.AminoConverter }; -export const ibcProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...ibcApplicationsFeeV1TxRegistry.registry, ...ibcApplicationsTransferV1TxRegistry.registry, ...ibcCoreChannelV1TxRegistry.registry, ...ibcCoreClientV1TxRegistry.registry, ...ibcCoreConnectionV1TxRegistry.registry]; +export const ibcProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...ibcApplicationsFeeV1TxRegistry.registry, ...ibcApplicationsInterchainAccountsControllerV1TxRegistry.registry, ...ibcApplicationsInterchainAccountsHostV1TxRegistry.registry, ...ibcApplicationsTransferV1TxRegistry.registry, ...ibcCoreChannelV1TxRegistry.registry, ...ibcCoreClientV1TxRegistry.registry, ...ibcCoreConnectionV1TxRegistry.registry, ...ibcLightclientsWasmV1TxRegistry.registry]; export const getSigningIbcClientOptions = ({ defaultTypes = defaultRegistryTypes }: { diff --git a/src/codegen/ibc/core/channel/v1/channel.ts b/src/codegen/ibc/core/channel/v1/channel.ts index bca38d2..a23fedb 100644 --- a/src/codegen/ibc/core/channel/v1/channel.ts +++ b/src/codegen/ibc/core/channel/v1/channel.ts @@ -3,7 +3,7 @@ import { BinaryReader, BinaryWriter } from "../../../../binary"; import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** * State defines if a channel is in one of the following states: - * CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. + * CLOSED, INIT, TRYOPEN, OPEN, FLUSHING, FLUSHCOMPLETE or UNINITIALIZED. */ export enum State { /** STATE_UNINITIALIZED_UNSPECIFIED - Default State */ @@ -22,6 +22,10 @@ export enum State { * packets. */ STATE_CLOSED = 4, + /** STATE_FLUSHING - A channel has just accepted the upgrade handshake attempt and is flushing in-flight packets. */ + STATE_FLUSHING = 5, + /** STATE_FLUSHCOMPLETE - A channel has just completed flushing any in-flight packets. */ + STATE_FLUSHCOMPLETE = 6, UNRECOGNIZED = -1, } export const StateSDKType = State; @@ -43,6 +47,12 @@ export function stateFromJSON(object: any): State { case 4: case "STATE_CLOSED": return State.STATE_CLOSED; + case 5: + case "STATE_FLUSHING": + return State.STATE_FLUSHING; + case 6: + case "STATE_FLUSHCOMPLETE": + return State.STATE_FLUSHCOMPLETE; case -1: case "UNRECOGNIZED": default: @@ -61,6 +71,10 @@ export function stateToJSON(object: State): string { return "STATE_OPEN"; case State.STATE_CLOSED: return "STATE_CLOSED"; + case State.STATE_FLUSHING: + return "STATE_FLUSHING"; + case State.STATE_FLUSHCOMPLETE: + return "STATE_FLUSHCOMPLETE"; case State.UNRECOGNIZED: default: return "UNRECOGNIZED"; @@ -130,6 +144,11 @@ export interface Channel { connectionHops: string[]; /** opaque channel version, which is agreed upon during the handshake */ version: string; + /** + * upgrade sequence indicates the latest upgrade attempt performed by this channel + * the value of 0 indicates the channel has never been upgraded + */ + upgradeSequence: bigint; } export interface ChannelProtoMsg { typeUrl: "/ibc.core.channel.v1.Channel"; @@ -154,6 +173,11 @@ export interface ChannelAmino { connection_hops?: string[]; /** opaque channel version, which is agreed upon during the handshake */ version?: string; + /** + * upgrade sequence indicates the latest upgrade attempt performed by this channel + * the value of 0 indicates the channel has never been upgraded + */ + upgrade_sequence?: string; } export interface ChannelAminoMsg { type: "cosmos-sdk/Channel"; @@ -170,6 +194,7 @@ export interface ChannelSDKType { counterparty: CounterpartySDKType; connection_hops: string[]; version: string; + upgrade_sequence: bigint; } /** * IdentifiedChannel defines a channel with additional port and channel @@ -193,6 +218,11 @@ export interface IdentifiedChannel { portId: string; /** channel identifier */ channelId: string; + /** + * upgrade sequence indicates the latest upgrade attempt performed by this channel + * the value of 0 indicates the channel has never been upgraded + */ + upgradeSequence: bigint; } export interface IdentifiedChannelProtoMsg { typeUrl: "/ibc.core.channel.v1.IdentifiedChannel"; @@ -220,6 +250,11 @@ export interface IdentifiedChannelAmino { port_id?: string; /** channel identifier */ channel_id?: string; + /** + * upgrade sequence indicates the latest upgrade attempt performed by this channel + * the value of 0 indicates the channel has never been upgraded + */ + upgrade_sequence?: string; } export interface IdentifiedChannelAminoMsg { type: "cosmos-sdk/IdentifiedChannel"; @@ -237,6 +272,7 @@ export interface IdentifiedChannelSDKType { version: string; port_id: string; channel_id: string; + upgrade_sequence: bigint; } /** Counterparty defines a channel end counterparty */ export interface Counterparty { @@ -473,13 +509,75 @@ export interface AcknowledgementSDKType { result?: Uint8Array; error?: string; } +/** + * Timeout defines an execution deadline structure for 04-channel handlers. + * This includes packet lifecycle handlers as well as the upgrade handshake handlers. + * A valid Timeout contains either one or both of a timestamp and block height (sequence). + */ +export interface Timeout { + /** block height after which the packet or upgrade times out */ + height: Height; + /** block timestamp (in nanoseconds) after which the packet or upgrade times out */ + timestamp: bigint; +} +export interface TimeoutProtoMsg { + typeUrl: "/ibc.core.channel.v1.Timeout"; + value: Uint8Array; +} +/** + * Timeout defines an execution deadline structure for 04-channel handlers. + * This includes packet lifecycle handlers as well as the upgrade handshake handlers. + * A valid Timeout contains either one or both of a timestamp and block height (sequence). + */ +export interface TimeoutAmino { + /** block height after which the packet or upgrade times out */ + height?: HeightAmino; + /** block timestamp (in nanoseconds) after which the packet or upgrade times out */ + timestamp?: string; +} +export interface TimeoutAminoMsg { + type: "cosmos-sdk/Timeout"; + value: TimeoutAmino; +} +/** + * Timeout defines an execution deadline structure for 04-channel handlers. + * This includes packet lifecycle handlers as well as the upgrade handshake handlers. + * A valid Timeout contains either one or both of a timestamp and block height (sequence). + */ +export interface TimeoutSDKType { + height: HeightSDKType; + timestamp: bigint; +} +/** Params defines the set of IBC channel parameters. */ +export interface Params { + /** the relative timeout after which channel upgrades will time out. */ + upgradeTimeout: Timeout; +} +export interface ParamsProtoMsg { + typeUrl: "/ibc.core.channel.v1.Params"; + value: Uint8Array; +} +/** Params defines the set of IBC channel parameters. */ +export interface ParamsAmino { + /** the relative timeout after which channel upgrades will time out. */ + upgrade_timeout?: TimeoutAmino; +} +export interface ParamsAminoMsg { + type: "cosmos-sdk/Params"; + value: ParamsAmino; +} +/** Params defines the set of IBC channel parameters. */ +export interface ParamsSDKType { + upgrade_timeout: TimeoutSDKType; +} function createBaseChannel(): Channel { return { state: 0, ordering: 0, counterparty: Counterparty.fromPartial({}), connectionHops: [], - version: "" + version: "", + upgradeSequence: BigInt(0) }; } export const Channel = { @@ -500,6 +598,9 @@ export const Channel = { if (message.version !== "") { writer.uint32(42).string(message.version); } + if (message.upgradeSequence !== BigInt(0)) { + writer.uint32(48).uint64(message.upgradeSequence); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Channel { @@ -524,6 +625,9 @@ export const Channel = { case 5: message.version = reader.string(); break; + case 6: + message.upgradeSequence = reader.uint64(); + break; default: reader.skipType(tag & 7); break; @@ -538,6 +642,7 @@ export const Channel = { message.counterparty = object.counterparty !== undefined && object.counterparty !== null ? Counterparty.fromPartial(object.counterparty) : undefined; message.connectionHops = object.connectionHops?.map(e => e) || []; message.version = object.version ?? ""; + message.upgradeSequence = object.upgradeSequence !== undefined && object.upgradeSequence !== null ? BigInt(object.upgradeSequence.toString()) : BigInt(0); return message; }, fromAmino(object: ChannelAmino): Channel { @@ -555,6 +660,9 @@ export const Channel = { if (object.version !== undefined && object.version !== null) { message.version = object.version; } + if (object.upgrade_sequence !== undefined && object.upgrade_sequence !== null) { + message.upgradeSequence = BigInt(object.upgrade_sequence); + } return message; }, toAmino(message: Channel): ChannelAmino { @@ -568,6 +676,7 @@ export const Channel = { obj.connection_hops = message.connectionHops; } obj.version = message.version === "" ? undefined : message.version; + obj.upgrade_sequence = message.upgradeSequence !== BigInt(0) ? message.upgradeSequence.toString() : undefined; return obj; }, fromAminoMsg(object: ChannelAminoMsg): Channel { @@ -600,7 +709,8 @@ function createBaseIdentifiedChannel(): IdentifiedChannel { connectionHops: [], version: "", portId: "", - channelId: "" + channelId: "", + upgradeSequence: BigInt(0) }; } export const IdentifiedChannel = { @@ -627,6 +737,9 @@ export const IdentifiedChannel = { if (message.channelId !== "") { writer.uint32(58).string(message.channelId); } + if (message.upgradeSequence !== BigInt(0)) { + writer.uint32(64).uint64(message.upgradeSequence); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): IdentifiedChannel { @@ -657,6 +770,9 @@ export const IdentifiedChannel = { case 7: message.channelId = reader.string(); break; + case 8: + message.upgradeSequence = reader.uint64(); + break; default: reader.skipType(tag & 7); break; @@ -673,6 +789,7 @@ export const IdentifiedChannel = { message.version = object.version ?? ""; message.portId = object.portId ?? ""; message.channelId = object.channelId ?? ""; + message.upgradeSequence = object.upgradeSequence !== undefined && object.upgradeSequence !== null ? BigInt(object.upgradeSequence.toString()) : BigInt(0); return message; }, fromAmino(object: IdentifiedChannelAmino): IdentifiedChannel { @@ -696,6 +813,9 @@ export const IdentifiedChannel = { if (object.channel_id !== undefined && object.channel_id !== null) { message.channelId = object.channel_id; } + if (object.upgrade_sequence !== undefined && object.upgrade_sequence !== null) { + message.upgradeSequence = BigInt(object.upgrade_sequence); + } return message; }, toAmino(message: IdentifiedChannel): IdentifiedChannelAmino { @@ -711,6 +831,7 @@ export const IdentifiedChannel = { obj.version = message.version === "" ? undefined : message.version; obj.port_id = message.portId === "" ? undefined : message.portId; obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.upgrade_sequence = message.upgradeSequence !== BigInt(0) ? message.upgradeSequence.toString() : undefined; return obj; }, fromAminoMsg(object: IdentifiedChannelAminoMsg): IdentifiedChannel { @@ -1247,4 +1368,154 @@ export const Acknowledgement = { value: Acknowledgement.encode(message).finish() }; } +}; +function createBaseTimeout(): Timeout { + return { + height: Height.fromPartial({}), + timestamp: BigInt(0) + }; +} +export const Timeout = { + typeUrl: "/ibc.core.channel.v1.Timeout", + encode(message: Timeout, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== undefined) { + Height.encode(message.height, writer.uint32(10).fork()).ldelim(); + } + if (message.timestamp !== BigInt(0)) { + writer.uint32(16).uint64(message.timestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Timeout { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTimeout(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = Height.decode(reader, reader.uint32()); + break; + case 2: + message.timestamp = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Timeout { + const message = createBaseTimeout(); + message.height = object.height !== undefined && object.height !== null ? Height.fromPartial(object.height) : undefined; + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: TimeoutAmino): Timeout { + const message = createBaseTimeout(); + if (object.height !== undefined && object.height !== null) { + message.height = Height.fromAmino(object.height); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + return message; + }, + toAmino(message: Timeout): TimeoutAmino { + const obj: any = {}; + obj.height = message.height ? Height.toAmino(message.height) : {}; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp.toString() : undefined; + return obj; + }, + fromAminoMsg(object: TimeoutAminoMsg): Timeout { + return Timeout.fromAmino(object.value); + }, + toAminoMsg(message: Timeout): TimeoutAminoMsg { + return { + type: "cosmos-sdk/Timeout", + value: Timeout.toAmino(message) + }; + }, + fromProtoMsg(message: TimeoutProtoMsg): Timeout { + return Timeout.decode(message.value); + }, + toProto(message: Timeout): Uint8Array { + return Timeout.encode(message).finish(); + }, + toProtoMsg(message: Timeout): TimeoutProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.Timeout", + value: Timeout.encode(message).finish() + }; + } +}; +function createBaseParams(): Params { + return { + upgradeTimeout: Timeout.fromPartial({}) + }; +} +export const Params = { + typeUrl: "/ibc.core.channel.v1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.upgradeTimeout !== undefined) { + Timeout.encode(message.upgradeTimeout, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.upgradeTimeout = Timeout.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.upgradeTimeout = object.upgradeTimeout !== undefined && object.upgradeTimeout !== null ? Timeout.fromPartial(object.upgradeTimeout) : undefined; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + if (object.upgrade_timeout !== undefined && object.upgrade_timeout !== null) { + message.upgradeTimeout = Timeout.fromAmino(object.upgrade_timeout); + } + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + obj.upgrade_timeout = message.upgradeTimeout ? Timeout.toAmino(message.upgradeTimeout) : undefined; + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "cosmos-sdk/Params", + value: Params.toAmino(message) + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.Params", + value: Params.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/src/codegen/ibc/core/channel/v1/genesis.ts b/src/codegen/ibc/core/channel/v1/genesis.ts index 8da8670..ebc5815 100644 --- a/src/codegen/ibc/core/channel/v1/genesis.ts +++ b/src/codegen/ibc/core/channel/v1/genesis.ts @@ -1,4 +1,4 @@ -import { IdentifiedChannel, IdentifiedChannelAmino, IdentifiedChannelSDKType, PacketState, PacketStateAmino, PacketStateSDKType } from "./channel"; +import { IdentifiedChannel, IdentifiedChannelAmino, IdentifiedChannelSDKType, PacketState, PacketStateAmino, PacketStateSDKType, Params, ParamsAmino, ParamsSDKType } from "./channel"; import { BinaryReader, BinaryWriter } from "../../../../binary"; /** GenesisState defines the ibc channel submodule's genesis state. */ export interface GenesisState { @@ -11,6 +11,7 @@ export interface GenesisState { ackSequences: PacketSequence[]; /** the sequence for the next generated channel identifier */ nextChannelSequence: bigint; + params: Params; } export interface GenesisStateProtoMsg { typeUrl: "/ibc.core.channel.v1.GenesisState"; @@ -27,6 +28,7 @@ export interface GenesisStateAmino { ack_sequences?: PacketSequenceAmino[]; /** the sequence for the next generated channel identifier */ next_channel_sequence?: string; + params?: ParamsAmino; } export interface GenesisStateAminoMsg { type: "cosmos-sdk/GenesisState"; @@ -42,6 +44,7 @@ export interface GenesisStateSDKType { recv_sequences: PacketSequenceSDKType[]; ack_sequences: PacketSequenceSDKType[]; next_channel_sequence: bigint; + params: ParamsSDKType; } /** * PacketSequence defines the genesis type necessary to retrieve and store @@ -87,7 +90,8 @@ function createBaseGenesisState(): GenesisState { sendSequences: [], recvSequences: [], ackSequences: [], - nextChannelSequence: BigInt(0) + nextChannelSequence: BigInt(0), + params: Params.fromPartial({}) }; } export const GenesisState = { @@ -117,6 +121,9 @@ export const GenesisState = { if (message.nextChannelSequence !== BigInt(0)) { writer.uint32(64).uint64(message.nextChannelSequence); } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(74).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { @@ -150,6 +157,9 @@ export const GenesisState = { case 8: message.nextChannelSequence = reader.uint64(); break; + case 9: + message.params = Params.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -167,6 +177,7 @@ export const GenesisState = { message.recvSequences = object.recvSequences?.map(e => PacketSequence.fromPartial(e)) || []; message.ackSequences = object.ackSequences?.map(e => PacketSequence.fromPartial(e)) || []; message.nextChannelSequence = object.nextChannelSequence !== undefined && object.nextChannelSequence !== null ? BigInt(object.nextChannelSequence.toString()) : BigInt(0); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; return message; }, fromAmino(object: GenesisStateAmino): GenesisState { @@ -181,6 +192,9 @@ export const GenesisState = { if (object.next_channel_sequence !== undefined && object.next_channel_sequence !== null) { message.nextChannelSequence = BigInt(object.next_channel_sequence); } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } return message; }, toAmino(message: GenesisState): GenesisStateAmino { @@ -221,6 +235,7 @@ export const GenesisState = { obj.ack_sequences = message.ackSequences; } obj.next_channel_sequence = message.nextChannelSequence !== BigInt(0) ? message.nextChannelSequence.toString() : undefined; + obj.params = message.params ? Params.toAmino(message.params) : undefined; return obj; }, fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { diff --git a/src/codegen/ibc/core/channel/v1/query.lcd.ts b/src/codegen/ibc/core/channel/v1/query.lcd.ts index 758cdbf..d94588a 100644 --- a/src/codegen/ibc/core/channel/v1/query.lcd.ts +++ b/src/codegen/ibc/core/channel/v1/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../../../helpers"; import { LCDClient } from "@cosmology/lcd"; -import { QueryChannelRequest, QueryChannelResponseSDKType, QueryChannelsRequest, QueryChannelsResponseSDKType, QueryConnectionChannelsRequest, QueryConnectionChannelsResponseSDKType, QueryChannelClientStateRequest, QueryChannelClientStateResponseSDKType, QueryChannelConsensusStateRequest, QueryChannelConsensusStateResponseSDKType, QueryPacketCommitmentRequest, QueryPacketCommitmentResponseSDKType, QueryPacketCommitmentsRequest, QueryPacketCommitmentsResponseSDKType, QueryPacketReceiptRequest, QueryPacketReceiptResponseSDKType, QueryPacketAcknowledgementRequest, QueryPacketAcknowledgementResponseSDKType, QueryPacketAcknowledgementsRequest, QueryPacketAcknowledgementsResponseSDKType, QueryUnreceivedPacketsRequest, QueryUnreceivedPacketsResponseSDKType, QueryUnreceivedAcksRequest, QueryUnreceivedAcksResponseSDKType, QueryNextSequenceReceiveRequest, QueryNextSequenceReceiveResponseSDKType } from "./query"; +import { QueryChannelRequest, QueryChannelResponseSDKType, QueryChannelsRequest, QueryChannelsResponseSDKType, QueryConnectionChannelsRequest, QueryConnectionChannelsResponseSDKType, QueryChannelClientStateRequest, QueryChannelClientStateResponseSDKType, QueryChannelConsensusStateRequest, QueryChannelConsensusStateResponseSDKType, QueryPacketCommitmentRequest, QueryPacketCommitmentResponseSDKType, QueryPacketCommitmentsRequest, QueryPacketCommitmentsResponseSDKType, QueryPacketReceiptRequest, QueryPacketReceiptResponseSDKType, QueryPacketAcknowledgementRequest, QueryPacketAcknowledgementResponseSDKType, QueryPacketAcknowledgementsRequest, QueryPacketAcknowledgementsResponseSDKType, QueryUnreceivedPacketsRequest, QueryUnreceivedPacketsResponseSDKType, QueryUnreceivedAcksRequest, QueryUnreceivedAcksResponseSDKType, QueryNextSequenceReceiveRequest, QueryNextSequenceReceiveResponseSDKType, QueryNextSequenceSendRequest, QueryNextSequenceSendResponseSDKType, QueryUpgradeErrorRequest, QueryUpgradeErrorResponseSDKType, QueryUpgradeRequest, QueryUpgradeResponseSDKType, QueryChannelParamsRequest, QueryChannelParamsResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -22,6 +22,10 @@ export class LCDQueryClient { this.unreceivedPackets = this.unreceivedPackets.bind(this); this.unreceivedAcks = this.unreceivedAcks.bind(this); this.nextSequenceReceive = this.nextSequenceReceive.bind(this); + this.nextSequenceSend = this.nextSequenceSend.bind(this); + this.upgradeError = this.upgradeError.bind(this); + this.upgrade = this.upgrade.bind(this); + this.channelParams = this.channelParams.bind(this); } /* Channel queries an IBC Channel. */ async channel(params: QueryChannelRequest): Promise { @@ -125,4 +129,24 @@ export class LCDQueryClient { const endpoint = `ibc/core/channel/v1/channels/${params.channelId}/ports/${params.portId}/next_sequence`; return await this.req.get(endpoint); } + /* NextSequenceSend returns the next send sequence for a given channel. */ + async nextSequenceSend(params: QueryNextSequenceSendRequest): Promise { + const endpoint = `ibc/core/channel/v1/channels/${params.channelId}/ports/${params.portId}/next_sequence_send`; + return await this.req.get(endpoint); + } + /* UpgradeError returns the error receipt if the upgrade handshake failed. */ + async upgradeError(params: QueryUpgradeErrorRequest): Promise { + const endpoint = `ibc/core/channel/v1/channels/${params.channelId}/ports/${params.portId}/upgrade_error`; + return await this.req.get(endpoint); + } + /* Upgrade returns the upgrade for a given port and channel id. */ + async upgrade(params: QueryUpgradeRequest): Promise { + const endpoint = `ibc/core/channel/v1/channels/${params.channelId}/ports/${params.portId}/upgrade`; + return await this.req.get(endpoint); + } + /* ChannelParams queries all parameters of the ibc channel submodule. */ + async channelParams(_params: QueryChannelParamsRequest = {}): Promise { + const endpoint = `ibc/core/channel/v1/params`; + return await this.req.get(endpoint); + } } \ No newline at end of file diff --git a/src/codegen/ibc/core/channel/v1/query.rpc.Query.ts b/src/codegen/ibc/core/channel/v1/query.rpc.Query.ts index 72075c5..2c3b5e6 100644 --- a/src/codegen/ibc/core/channel/v1/query.rpc.Query.ts +++ b/src/codegen/ibc/core/channel/v1/query.rpc.Query.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../../../helpers"; import { BinaryReader } from "../../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryChannelRequest, QueryChannelResponse, QueryChannelsRequest, QueryChannelsResponse, QueryConnectionChannelsRequest, QueryConnectionChannelsResponse, QueryChannelClientStateRequest, QueryChannelClientStateResponse, QueryChannelConsensusStateRequest, QueryChannelConsensusStateResponse, QueryPacketCommitmentRequest, QueryPacketCommitmentResponse, QueryPacketCommitmentsRequest, QueryPacketCommitmentsResponse, QueryPacketReceiptRequest, QueryPacketReceiptResponse, QueryPacketAcknowledgementRequest, QueryPacketAcknowledgementResponse, QueryPacketAcknowledgementsRequest, QueryPacketAcknowledgementsResponse, QueryUnreceivedPacketsRequest, QueryUnreceivedPacketsResponse, QueryUnreceivedAcksRequest, QueryUnreceivedAcksResponse, QueryNextSequenceReceiveRequest, QueryNextSequenceReceiveResponse } from "./query"; +import { QueryChannelRequest, QueryChannelResponse, QueryChannelsRequest, QueryChannelsResponse, QueryConnectionChannelsRequest, QueryConnectionChannelsResponse, QueryChannelClientStateRequest, QueryChannelClientStateResponse, QueryChannelConsensusStateRequest, QueryChannelConsensusStateResponse, QueryPacketCommitmentRequest, QueryPacketCommitmentResponse, QueryPacketCommitmentsRequest, QueryPacketCommitmentsResponse, QueryPacketReceiptRequest, QueryPacketReceiptResponse, QueryPacketAcknowledgementRequest, QueryPacketAcknowledgementResponse, QueryPacketAcknowledgementsRequest, QueryPacketAcknowledgementsResponse, QueryUnreceivedPacketsRequest, QueryUnreceivedPacketsResponse, QueryUnreceivedAcksRequest, QueryUnreceivedAcksResponse, QueryNextSequenceReceiveRequest, QueryNextSequenceReceiveResponse, QueryNextSequenceSendRequest, QueryNextSequenceSendResponse, QueryUpgradeErrorRequest, QueryUpgradeErrorResponse, QueryUpgradeRequest, QueryUpgradeResponse, QueryChannelParamsRequest, QueryChannelParamsResponse } from "./query"; /** Query provides defines the gRPC querier service */ export interface Query { /** Channel queries an IBC Channel. */ @@ -54,6 +54,14 @@ export interface Query { unreceivedAcks(request: QueryUnreceivedAcksRequest): Promise; /** NextSequenceReceive returns the next receive sequence for a given channel. */ nextSequenceReceive(request: QueryNextSequenceReceiveRequest): Promise; + /** NextSequenceSend returns the next send sequence for a given channel. */ + nextSequenceSend(request: QueryNextSequenceSendRequest): Promise; + /** UpgradeError returns the error receipt if the upgrade handshake failed. */ + upgradeError(request: QueryUpgradeErrorRequest): Promise; + /** Upgrade returns the upgrade for a given port and channel id. */ + upgrade(request: QueryUpgradeRequest): Promise; + /** ChannelParams queries all parameters of the ibc channel submodule. */ + channelParams(request?: QueryChannelParamsRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -72,6 +80,10 @@ export class QueryClientImpl implements Query { this.unreceivedPackets = this.unreceivedPackets.bind(this); this.unreceivedAcks = this.unreceivedAcks.bind(this); this.nextSequenceReceive = this.nextSequenceReceive.bind(this); + this.nextSequenceSend = this.nextSequenceSend.bind(this); + this.upgradeError = this.upgradeError.bind(this); + this.upgrade = this.upgrade.bind(this); + this.channelParams = this.channelParams.bind(this); } channel(request: QueryChannelRequest): Promise { const data = QueryChannelRequest.encode(request).finish(); @@ -140,6 +152,26 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("ibc.core.channel.v1.Query", "NextSequenceReceive", data); return promise.then(data => QueryNextSequenceReceiveResponse.decode(new BinaryReader(data))); } + nextSequenceSend(request: QueryNextSequenceSendRequest): Promise { + const data = QueryNextSequenceSendRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "NextSequenceSend", data); + return promise.then(data => QueryNextSequenceSendResponse.decode(new BinaryReader(data))); + } + upgradeError(request: QueryUpgradeErrorRequest): Promise { + const data = QueryUpgradeErrorRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "UpgradeError", data); + return promise.then(data => QueryUpgradeErrorResponse.decode(new BinaryReader(data))); + } + upgrade(request: QueryUpgradeRequest): Promise { + const data = QueryUpgradeRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "Upgrade", data); + return promise.then(data => QueryUpgradeResponse.decode(new BinaryReader(data))); + } + channelParams(request: QueryChannelParamsRequest = {}): Promise { + const data = QueryChannelParamsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Query", "ChannelParams", data); + return promise.then(data => QueryChannelParamsResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -183,6 +215,18 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, nextSequenceReceive(request: QueryNextSequenceReceiveRequest): Promise { return queryService.nextSequenceReceive(request); + }, + nextSequenceSend(request: QueryNextSequenceSendRequest): Promise { + return queryService.nextSequenceSend(request); + }, + upgradeError(request: QueryUpgradeErrorRequest): Promise { + return queryService.upgradeError(request); + }, + upgrade(request: QueryUpgradeRequest): Promise { + return queryService.upgrade(request); + }, + channelParams(request?: QueryChannelParamsRequest): Promise { + return queryService.channelParams(request); } }; }; \ No newline at end of file diff --git a/src/codegen/ibc/core/channel/v1/query.ts b/src/codegen/ibc/core/channel/v1/query.ts index 93f0936..8dc7343 100644 --- a/src/codegen/ibc/core/channel/v1/query.ts +++ b/src/codegen/ibc/core/channel/v1/query.ts @@ -1,7 +1,8 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../../cosmos/base/query/v1beta1/pagination"; import { Channel, ChannelAmino, ChannelSDKType, IdentifiedChannel, IdentifiedChannelAmino, IdentifiedChannelSDKType, PacketState, PacketStateAmino, PacketStateSDKType } from "./channel"; -import { Height, HeightAmino, HeightSDKType, IdentifiedClientState, IdentifiedClientStateAmino, IdentifiedClientStateSDKType } from "../../client/v1/client"; +import { Height, HeightAmino, HeightSDKType, IdentifiedClientState, IdentifiedClientStateAmino, IdentifiedClientStateSDKType, Params, ParamsAmino, ParamsSDKType } from "../../client/v1/client"; import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { ErrorReceipt, ErrorReceiptAmino, ErrorReceiptSDKType, Upgrade, UpgradeAmino, UpgradeSDKType } from "./upgrade"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** QueryChannelRequest is the request type for the Query/Channel RPC method */ @@ -986,7 +987,7 @@ export interface QueryNextSequenceReceiveRequestSDKType { channel_id: string; } /** - * QuerySequenceResponse is the request type for the + * QuerySequenceResponse is the response type for the * Query/QueryNextSequenceReceiveResponse RPC method */ export interface QueryNextSequenceReceiveResponse { @@ -1002,7 +1003,7 @@ export interface QueryNextSequenceReceiveResponseProtoMsg { value: Uint8Array; } /** - * QuerySequenceResponse is the request type for the + * QuerySequenceResponse is the response type for the * Query/QueryNextSequenceReceiveResponse RPC method */ export interface QueryNextSequenceReceiveResponseAmino { @@ -1018,7 +1019,7 @@ export interface QueryNextSequenceReceiveResponseAminoMsg { value: QueryNextSequenceReceiveResponseAmino; } /** - * QuerySequenceResponse is the request type for the + * QuerySequenceResponse is the response type for the * Query/QueryNextSequenceReceiveResponse RPC method */ export interface QueryNextSequenceReceiveResponseSDKType { @@ -1026,6 +1027,225 @@ export interface QueryNextSequenceReceiveResponseSDKType { proof: Uint8Array; proof_height: HeightSDKType; } +/** + * QueryNextSequenceSendRequest is the request type for the + * Query/QueryNextSequenceSend RPC method + */ +export interface QueryNextSequenceSendRequest { + /** port unique identifier */ + portId: string; + /** channel unique identifier */ + channelId: string; +} +export interface QueryNextSequenceSendRequestProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryNextSequenceSendRequest"; + value: Uint8Array; +} +/** + * QueryNextSequenceSendRequest is the request type for the + * Query/QueryNextSequenceSend RPC method + */ +export interface QueryNextSequenceSendRequestAmino { + /** port unique identifier */ + port_id?: string; + /** channel unique identifier */ + channel_id?: string; +} +export interface QueryNextSequenceSendRequestAminoMsg { + type: "cosmos-sdk/QueryNextSequenceSendRequest"; + value: QueryNextSequenceSendRequestAmino; +} +/** + * QueryNextSequenceSendRequest is the request type for the + * Query/QueryNextSequenceSend RPC method + */ +export interface QueryNextSequenceSendRequestSDKType { + port_id: string; + channel_id: string; +} +/** + * QueryNextSequenceSendResponse is the request type for the + * Query/QueryNextSequenceSend RPC method + */ +export interface QueryNextSequenceSendResponse { + /** next sequence send number */ + nextSequenceSend: bigint; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height; +} +export interface QueryNextSequenceSendResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryNextSequenceSendResponse"; + value: Uint8Array; +} +/** + * QueryNextSequenceSendResponse is the request type for the + * Query/QueryNextSequenceSend RPC method + */ +export interface QueryNextSequenceSendResponseAmino { + /** next sequence send number */ + next_sequence_send?: string; + /** merkle proof of existence */ + proof?: string; + /** height at which the proof was retrieved */ + proof_height?: HeightAmino; +} +export interface QueryNextSequenceSendResponseAminoMsg { + type: "cosmos-sdk/QueryNextSequenceSendResponse"; + value: QueryNextSequenceSendResponseAmino; +} +/** + * QueryNextSequenceSendResponse is the request type for the + * Query/QueryNextSequenceSend RPC method + */ +export interface QueryNextSequenceSendResponseSDKType { + next_sequence_send: bigint; + proof: Uint8Array; + proof_height: HeightSDKType; +} +/** QueryUpgradeErrorRequest is the request type for the Query/QueryUpgradeError RPC method */ +export interface QueryUpgradeErrorRequest { + portId: string; + channelId: string; +} +export interface QueryUpgradeErrorRequestProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeErrorRequest"; + value: Uint8Array; +} +/** QueryUpgradeErrorRequest is the request type for the Query/QueryUpgradeError RPC method */ +export interface QueryUpgradeErrorRequestAmino { + port_id?: string; + channel_id?: string; +} +export interface QueryUpgradeErrorRequestAminoMsg { + type: "cosmos-sdk/QueryUpgradeErrorRequest"; + value: QueryUpgradeErrorRequestAmino; +} +/** QueryUpgradeErrorRequest is the request type for the Query/QueryUpgradeError RPC method */ +export interface QueryUpgradeErrorRequestSDKType { + port_id: string; + channel_id: string; +} +/** QueryUpgradeErrorResponse is the response type for the Query/QueryUpgradeError RPC method */ +export interface QueryUpgradeErrorResponse { + errorReceipt: ErrorReceipt; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height; +} +export interface QueryUpgradeErrorResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeErrorResponse"; + value: Uint8Array; +} +/** QueryUpgradeErrorResponse is the response type for the Query/QueryUpgradeError RPC method */ +export interface QueryUpgradeErrorResponseAmino { + error_receipt?: ErrorReceiptAmino; + /** merkle proof of existence */ + proof?: string; + /** height at which the proof was retrieved */ + proof_height?: HeightAmino; +} +export interface QueryUpgradeErrorResponseAminoMsg { + type: "cosmos-sdk/QueryUpgradeErrorResponse"; + value: QueryUpgradeErrorResponseAmino; +} +/** QueryUpgradeErrorResponse is the response type for the Query/QueryUpgradeError RPC method */ +export interface QueryUpgradeErrorResponseSDKType { + error_receipt: ErrorReceiptSDKType; + proof: Uint8Array; + proof_height: HeightSDKType; +} +/** QueryUpgradeRequest is the request type for the QueryUpgradeRequest RPC method */ +export interface QueryUpgradeRequest { + portId: string; + channelId: string; +} +export interface QueryUpgradeRequestProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeRequest"; + value: Uint8Array; +} +/** QueryUpgradeRequest is the request type for the QueryUpgradeRequest RPC method */ +export interface QueryUpgradeRequestAmino { + port_id?: string; + channel_id?: string; +} +export interface QueryUpgradeRequestAminoMsg { + type: "cosmos-sdk/QueryUpgradeRequest"; + value: QueryUpgradeRequestAmino; +} +/** QueryUpgradeRequest is the request type for the QueryUpgradeRequest RPC method */ +export interface QueryUpgradeRequestSDKType { + port_id: string; + channel_id: string; +} +/** QueryUpgradeResponse is the response type for the QueryUpgradeResponse RPC method */ +export interface QueryUpgradeResponse { + upgrade: Upgrade; + /** merkle proof of existence */ + proof: Uint8Array; + /** height at which the proof was retrieved */ + proofHeight: Height; +} +export interface QueryUpgradeResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeResponse"; + value: Uint8Array; +} +/** QueryUpgradeResponse is the response type for the QueryUpgradeResponse RPC method */ +export interface QueryUpgradeResponseAmino { + upgrade?: UpgradeAmino; + /** merkle proof of existence */ + proof?: string; + /** height at which the proof was retrieved */ + proof_height?: HeightAmino; +} +export interface QueryUpgradeResponseAminoMsg { + type: "cosmos-sdk/QueryUpgradeResponse"; + value: QueryUpgradeResponseAmino; +} +/** QueryUpgradeResponse is the response type for the QueryUpgradeResponse RPC method */ +export interface QueryUpgradeResponseSDKType { + upgrade: UpgradeSDKType; + proof: Uint8Array; + proof_height: HeightSDKType; +} +/** QueryChannelParamsRequest is the request type for the Query/ChannelParams RPC method. */ +export interface QueryChannelParamsRequest {} +export interface QueryChannelParamsRequestProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryChannelParamsRequest"; + value: Uint8Array; +} +/** QueryChannelParamsRequest is the request type for the Query/ChannelParams RPC method. */ +export interface QueryChannelParamsRequestAmino {} +export interface QueryChannelParamsRequestAminoMsg { + type: "cosmos-sdk/QueryChannelParamsRequest"; + value: QueryChannelParamsRequestAmino; +} +/** QueryChannelParamsRequest is the request type for the Query/ChannelParams RPC method. */ +export interface QueryChannelParamsRequestSDKType {} +/** QueryChannelParamsResponse is the response type for the Query/ChannelParams RPC method. */ +export interface QueryChannelParamsResponse { + /** params defines the parameters of the module. */ + params?: Params; +} +export interface QueryChannelParamsResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.QueryChannelParamsResponse"; + value: Uint8Array; +} +/** QueryChannelParamsResponse is the response type for the Query/ChannelParams RPC method. */ +export interface QueryChannelParamsResponseAmino { + /** params defines the parameters of the module. */ + params?: ParamsAmino; +} +export interface QueryChannelParamsResponseAminoMsg { + type: "cosmos-sdk/QueryChannelParamsResponse"; + value: QueryChannelParamsResponseAmino; +} +/** QueryChannelParamsResponse is the response type for the Query/ChannelParams RPC method. */ +export interface QueryChannelParamsResponseSDKType { + params?: ParamsSDKType; +} function createBaseQueryChannelRequest(): QueryChannelRequest { return { portId: "", @@ -3446,4 +3666,651 @@ export const QueryNextSequenceReceiveResponse = { value: QueryNextSequenceReceiveResponse.encode(message).finish() }; } +}; +function createBaseQueryNextSequenceSendRequest(): QueryNextSequenceSendRequest { + return { + portId: "", + channelId: "" + }; +} +export const QueryNextSequenceSendRequest = { + typeUrl: "/ibc.core.channel.v1.QueryNextSequenceSendRequest", + encode(message: QueryNextSequenceSendRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryNextSequenceSendRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNextSequenceSendRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryNextSequenceSendRequest { + const message = createBaseQueryNextSequenceSendRequest(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + return message; + }, + fromAmino(object: QueryNextSequenceSendRequestAmino): QueryNextSequenceSendRequest { + const message = createBaseQueryNextSequenceSendRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + return message; + }, + toAmino(message: QueryNextSequenceSendRequest): QueryNextSequenceSendRequestAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + return obj; + }, + fromAminoMsg(object: QueryNextSequenceSendRequestAminoMsg): QueryNextSequenceSendRequest { + return QueryNextSequenceSendRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryNextSequenceSendRequest): QueryNextSequenceSendRequestAminoMsg { + return { + type: "cosmos-sdk/QueryNextSequenceSendRequest", + value: QueryNextSequenceSendRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryNextSequenceSendRequestProtoMsg): QueryNextSequenceSendRequest { + return QueryNextSequenceSendRequest.decode(message.value); + }, + toProto(message: QueryNextSequenceSendRequest): Uint8Array { + return QueryNextSequenceSendRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryNextSequenceSendRequest): QueryNextSequenceSendRequestProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryNextSequenceSendRequest", + value: QueryNextSequenceSendRequest.encode(message).finish() + }; + } +}; +function createBaseQueryNextSequenceSendResponse(): QueryNextSequenceSendResponse { + return { + nextSequenceSend: BigInt(0), + proof: new Uint8Array(), + proofHeight: Height.fromPartial({}) + }; +} +export const QueryNextSequenceSendResponse = { + typeUrl: "/ibc.core.channel.v1.QueryNextSequenceSendResponse", + encode(message: QueryNextSequenceSendResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.nextSequenceSend !== BigInt(0)) { + writer.uint32(8).uint64(message.nextSequenceSend); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryNextSequenceSendResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryNextSequenceSendResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nextSequenceSend = reader.uint64(); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryNextSequenceSendResponse { + const message = createBaseQueryNextSequenceSendResponse(); + message.nextSequenceSend = object.nextSequenceSend !== undefined && object.nextSequenceSend !== null ? BigInt(object.nextSequenceSend.toString()) : BigInt(0); + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + return message; + }, + fromAmino(object: QueryNextSequenceSendResponseAmino): QueryNextSequenceSendResponse { + const message = createBaseQueryNextSequenceSendResponse(); + if (object.next_sequence_send !== undefined && object.next_sequence_send !== null) { + message.nextSequenceSend = BigInt(object.next_sequence_send); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; + }, + toAmino(message: QueryNextSequenceSendResponse): QueryNextSequenceSendResponseAmino { + const obj: any = {}; + obj.next_sequence_send = message.nextSequenceSend !== BigInt(0) ? message.nextSequenceSend.toString() : undefined; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + return obj; + }, + fromAminoMsg(object: QueryNextSequenceSendResponseAminoMsg): QueryNextSequenceSendResponse { + return QueryNextSequenceSendResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryNextSequenceSendResponse): QueryNextSequenceSendResponseAminoMsg { + return { + type: "cosmos-sdk/QueryNextSequenceSendResponse", + value: QueryNextSequenceSendResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryNextSequenceSendResponseProtoMsg): QueryNextSequenceSendResponse { + return QueryNextSequenceSendResponse.decode(message.value); + }, + toProto(message: QueryNextSequenceSendResponse): Uint8Array { + return QueryNextSequenceSendResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryNextSequenceSendResponse): QueryNextSequenceSendResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryNextSequenceSendResponse", + value: QueryNextSequenceSendResponse.encode(message).finish() + }; + } +}; +function createBaseQueryUpgradeErrorRequest(): QueryUpgradeErrorRequest { + return { + portId: "", + channelId: "" + }; +} +export const QueryUpgradeErrorRequest = { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeErrorRequest", + encode(message: QueryUpgradeErrorRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUpgradeErrorRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUpgradeErrorRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUpgradeErrorRequest { + const message = createBaseQueryUpgradeErrorRequest(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + return message; + }, + fromAmino(object: QueryUpgradeErrorRequestAmino): QueryUpgradeErrorRequest { + const message = createBaseQueryUpgradeErrorRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + return message; + }, + toAmino(message: QueryUpgradeErrorRequest): QueryUpgradeErrorRequestAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + return obj; + }, + fromAminoMsg(object: QueryUpgradeErrorRequestAminoMsg): QueryUpgradeErrorRequest { + return QueryUpgradeErrorRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryUpgradeErrorRequest): QueryUpgradeErrorRequestAminoMsg { + return { + type: "cosmos-sdk/QueryUpgradeErrorRequest", + value: QueryUpgradeErrorRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryUpgradeErrorRequestProtoMsg): QueryUpgradeErrorRequest { + return QueryUpgradeErrorRequest.decode(message.value); + }, + toProto(message: QueryUpgradeErrorRequest): Uint8Array { + return QueryUpgradeErrorRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryUpgradeErrorRequest): QueryUpgradeErrorRequestProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeErrorRequest", + value: QueryUpgradeErrorRequest.encode(message).finish() + }; + } +}; +function createBaseQueryUpgradeErrorResponse(): QueryUpgradeErrorResponse { + return { + errorReceipt: ErrorReceipt.fromPartial({}), + proof: new Uint8Array(), + proofHeight: Height.fromPartial({}) + }; +} +export const QueryUpgradeErrorResponse = { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeErrorResponse", + encode(message: QueryUpgradeErrorResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.errorReceipt !== undefined) { + ErrorReceipt.encode(message.errorReceipt, writer.uint32(10).fork()).ldelim(); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUpgradeErrorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUpgradeErrorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.errorReceipt = ErrorReceipt.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUpgradeErrorResponse { + const message = createBaseQueryUpgradeErrorResponse(); + message.errorReceipt = object.errorReceipt !== undefined && object.errorReceipt !== null ? ErrorReceipt.fromPartial(object.errorReceipt) : undefined; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + return message; + }, + fromAmino(object: QueryUpgradeErrorResponseAmino): QueryUpgradeErrorResponse { + const message = createBaseQueryUpgradeErrorResponse(); + if (object.error_receipt !== undefined && object.error_receipt !== null) { + message.errorReceipt = ErrorReceipt.fromAmino(object.error_receipt); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; + }, + toAmino(message: QueryUpgradeErrorResponse): QueryUpgradeErrorResponseAmino { + const obj: any = {}; + obj.error_receipt = message.errorReceipt ? ErrorReceipt.toAmino(message.errorReceipt) : undefined; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + return obj; + }, + fromAminoMsg(object: QueryUpgradeErrorResponseAminoMsg): QueryUpgradeErrorResponse { + return QueryUpgradeErrorResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryUpgradeErrorResponse): QueryUpgradeErrorResponseAminoMsg { + return { + type: "cosmos-sdk/QueryUpgradeErrorResponse", + value: QueryUpgradeErrorResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryUpgradeErrorResponseProtoMsg): QueryUpgradeErrorResponse { + return QueryUpgradeErrorResponse.decode(message.value); + }, + toProto(message: QueryUpgradeErrorResponse): Uint8Array { + return QueryUpgradeErrorResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryUpgradeErrorResponse): QueryUpgradeErrorResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeErrorResponse", + value: QueryUpgradeErrorResponse.encode(message).finish() + }; + } +}; +function createBaseQueryUpgradeRequest(): QueryUpgradeRequest { + return { + portId: "", + channelId: "" + }; +} +export const QueryUpgradeRequest = { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeRequest", + encode(message: QueryUpgradeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUpgradeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUpgradeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUpgradeRequest { + const message = createBaseQueryUpgradeRequest(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + return message; + }, + fromAmino(object: QueryUpgradeRequestAmino): QueryUpgradeRequest { + const message = createBaseQueryUpgradeRequest(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + return message; + }, + toAmino(message: QueryUpgradeRequest): QueryUpgradeRequestAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + return obj; + }, + fromAminoMsg(object: QueryUpgradeRequestAminoMsg): QueryUpgradeRequest { + return QueryUpgradeRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryUpgradeRequest): QueryUpgradeRequestAminoMsg { + return { + type: "cosmos-sdk/QueryUpgradeRequest", + value: QueryUpgradeRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryUpgradeRequestProtoMsg): QueryUpgradeRequest { + return QueryUpgradeRequest.decode(message.value); + }, + toProto(message: QueryUpgradeRequest): Uint8Array { + return QueryUpgradeRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryUpgradeRequest): QueryUpgradeRequestProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeRequest", + value: QueryUpgradeRequest.encode(message).finish() + }; + } +}; +function createBaseQueryUpgradeResponse(): QueryUpgradeResponse { + return { + upgrade: Upgrade.fromPartial({}), + proof: new Uint8Array(), + proofHeight: Height.fromPartial({}) + }; +} +export const QueryUpgradeResponse = { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeResponse", + encode(message: QueryUpgradeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.upgrade !== undefined) { + Upgrade.encode(message.upgrade, writer.uint32(10).fork()).ldelim(); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryUpgradeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUpgradeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.upgrade = Upgrade.decode(reader, reader.uint32()); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryUpgradeResponse { + const message = createBaseQueryUpgradeResponse(); + message.upgrade = object.upgrade !== undefined && object.upgrade !== null ? Upgrade.fromPartial(object.upgrade) : undefined; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + return message; + }, + fromAmino(object: QueryUpgradeResponseAmino): QueryUpgradeResponse { + const message = createBaseQueryUpgradeResponse(); + if (object.upgrade !== undefined && object.upgrade !== null) { + message.upgrade = Upgrade.fromAmino(object.upgrade); + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + return message; + }, + toAmino(message: QueryUpgradeResponse): QueryUpgradeResponseAmino { + const obj: any = {}; + obj.upgrade = message.upgrade ? Upgrade.toAmino(message.upgrade) : undefined; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + return obj; + }, + fromAminoMsg(object: QueryUpgradeResponseAminoMsg): QueryUpgradeResponse { + return QueryUpgradeResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryUpgradeResponse): QueryUpgradeResponseAminoMsg { + return { + type: "cosmos-sdk/QueryUpgradeResponse", + value: QueryUpgradeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryUpgradeResponseProtoMsg): QueryUpgradeResponse { + return QueryUpgradeResponse.decode(message.value); + }, + toProto(message: QueryUpgradeResponse): Uint8Array { + return QueryUpgradeResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryUpgradeResponse): QueryUpgradeResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryUpgradeResponse", + value: QueryUpgradeResponse.encode(message).finish() + }; + } +}; +function createBaseQueryChannelParamsRequest(): QueryChannelParamsRequest { + return {}; +} +export const QueryChannelParamsRequest = { + typeUrl: "/ibc.core.channel.v1.QueryChannelParamsRequest", + encode(_: QueryChannelParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryChannelParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryChannelParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryChannelParamsRequest { + const message = createBaseQueryChannelParamsRequest(); + return message; + }, + fromAmino(_: QueryChannelParamsRequestAmino): QueryChannelParamsRequest { + const message = createBaseQueryChannelParamsRequest(); + return message; + }, + toAmino(_: QueryChannelParamsRequest): QueryChannelParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryChannelParamsRequestAminoMsg): QueryChannelParamsRequest { + return QueryChannelParamsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryChannelParamsRequest): QueryChannelParamsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryChannelParamsRequest", + value: QueryChannelParamsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryChannelParamsRequestProtoMsg): QueryChannelParamsRequest { + return QueryChannelParamsRequest.decode(message.value); + }, + toProto(message: QueryChannelParamsRequest): Uint8Array { + return QueryChannelParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryChannelParamsRequest): QueryChannelParamsRequestProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryChannelParamsRequest", + value: QueryChannelParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryChannelParamsResponse(): QueryChannelParamsResponse { + return { + params: undefined + }; +} +export const QueryChannelParamsResponse = { + typeUrl: "/ibc.core.channel.v1.QueryChannelParamsResponse", + encode(message: QueryChannelParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryChannelParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryChannelParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryChannelParamsResponse { + const message = createBaseQueryChannelParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryChannelParamsResponseAmino): QueryChannelParamsResponse { + const message = createBaseQueryChannelParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryChannelParamsResponse): QueryChannelParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryChannelParamsResponseAminoMsg): QueryChannelParamsResponse { + return QueryChannelParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryChannelParamsResponse): QueryChannelParamsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryChannelParamsResponse", + value: QueryChannelParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryChannelParamsResponseProtoMsg): QueryChannelParamsResponse { + return QueryChannelParamsResponse.decode(message.value); + }, + toProto(message: QueryChannelParamsResponse): Uint8Array { + return QueryChannelParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryChannelParamsResponse): QueryChannelParamsResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.QueryChannelParamsResponse", + value: QueryChannelParamsResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/src/codegen/ibc/core/channel/v1/tx.amino.ts b/src/codegen/ibc/core/channel/v1/tx.amino.ts index 0884ce7..fb58cb0 100644 --- a/src/codegen/ibc/core/channel/v1/tx.amino.ts +++ b/src/codegen/ibc/core/channel/v1/tx.amino.ts @@ -1,4 +1,4 @@ -import { MsgChannelOpenInit, MsgChannelOpenTry, MsgChannelOpenAck, MsgChannelOpenConfirm, MsgChannelCloseInit, MsgChannelCloseConfirm, MsgRecvPacket, MsgTimeout, MsgTimeoutOnClose, MsgAcknowledgement } from "./tx"; +import { MsgChannelOpenInit, MsgChannelOpenTry, MsgChannelOpenAck, MsgChannelOpenConfirm, MsgChannelCloseInit, MsgChannelCloseConfirm, MsgRecvPacket, MsgTimeout, MsgTimeoutOnClose, MsgAcknowledgement, MsgChannelUpgradeInit, MsgChannelUpgradeTry, MsgChannelUpgradeAck, MsgChannelUpgradeConfirm, MsgChannelUpgradeOpen, MsgChannelUpgradeTimeout, MsgChannelUpgradeCancel, MsgUpdateParams, MsgPruneAcknowledgements } from "./tx"; export const AminoConverter = { "/ibc.core.channel.v1.MsgChannelOpenInit": { aminoType: "cosmos-sdk/MsgChannelOpenInit", @@ -49,5 +49,50 @@ export const AminoConverter = { aminoType: "cosmos-sdk/MsgAcknowledgement", toAmino: MsgAcknowledgement.toAmino, fromAmino: MsgAcknowledgement.fromAmino + }, + "/ibc.core.channel.v1.MsgChannelUpgradeInit": { + aminoType: "cosmos-sdk/MsgChannelUpgradeInit", + toAmino: MsgChannelUpgradeInit.toAmino, + fromAmino: MsgChannelUpgradeInit.fromAmino + }, + "/ibc.core.channel.v1.MsgChannelUpgradeTry": { + aminoType: "cosmos-sdk/MsgChannelUpgradeTry", + toAmino: MsgChannelUpgradeTry.toAmino, + fromAmino: MsgChannelUpgradeTry.fromAmino + }, + "/ibc.core.channel.v1.MsgChannelUpgradeAck": { + aminoType: "cosmos-sdk/MsgChannelUpgradeAck", + toAmino: MsgChannelUpgradeAck.toAmino, + fromAmino: MsgChannelUpgradeAck.fromAmino + }, + "/ibc.core.channel.v1.MsgChannelUpgradeConfirm": { + aminoType: "cosmos-sdk/MsgChannelUpgradeConfirm", + toAmino: MsgChannelUpgradeConfirm.toAmino, + fromAmino: MsgChannelUpgradeConfirm.fromAmino + }, + "/ibc.core.channel.v1.MsgChannelUpgradeOpen": { + aminoType: "cosmos-sdk/MsgChannelUpgradeOpen", + toAmino: MsgChannelUpgradeOpen.toAmino, + fromAmino: MsgChannelUpgradeOpen.fromAmino + }, + "/ibc.core.channel.v1.MsgChannelUpgradeTimeout": { + aminoType: "cosmos-sdk/MsgChannelUpgradeTimeout", + toAmino: MsgChannelUpgradeTimeout.toAmino, + fromAmino: MsgChannelUpgradeTimeout.fromAmino + }, + "/ibc.core.channel.v1.MsgChannelUpgradeCancel": { + aminoType: "cosmos-sdk/MsgChannelUpgradeCancel", + toAmino: MsgChannelUpgradeCancel.toAmino, + fromAmino: MsgChannelUpgradeCancel.fromAmino + }, + "/ibc.core.channel.v1.MsgUpdateParams": { + aminoType: "cosmos-sdk/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino + }, + "/ibc.core.channel.v1.MsgPruneAcknowledgements": { + aminoType: "cosmos-sdk/MsgPruneAcknowledgements", + toAmino: MsgPruneAcknowledgements.toAmino, + fromAmino: MsgPruneAcknowledgements.fromAmino } }; \ No newline at end of file diff --git a/src/codegen/ibc/core/channel/v1/tx.registry.ts b/src/codegen/ibc/core/channel/v1/tx.registry.ts index a71445b..cec57e9 100644 --- a/src/codegen/ibc/core/channel/v1/tx.registry.ts +++ b/src/codegen/ibc/core/channel/v1/tx.registry.ts @@ -1,6 +1,6 @@ import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgChannelOpenInit, MsgChannelOpenTry, MsgChannelOpenAck, MsgChannelOpenConfirm, MsgChannelCloseInit, MsgChannelCloseConfirm, MsgRecvPacket, MsgTimeout, MsgTimeoutOnClose, MsgAcknowledgement } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.core.channel.v1.MsgChannelOpenInit", MsgChannelOpenInit], ["/ibc.core.channel.v1.MsgChannelOpenTry", MsgChannelOpenTry], ["/ibc.core.channel.v1.MsgChannelOpenAck", MsgChannelOpenAck], ["/ibc.core.channel.v1.MsgChannelOpenConfirm", MsgChannelOpenConfirm], ["/ibc.core.channel.v1.MsgChannelCloseInit", MsgChannelCloseInit], ["/ibc.core.channel.v1.MsgChannelCloseConfirm", MsgChannelCloseConfirm], ["/ibc.core.channel.v1.MsgRecvPacket", MsgRecvPacket], ["/ibc.core.channel.v1.MsgTimeout", MsgTimeout], ["/ibc.core.channel.v1.MsgTimeoutOnClose", MsgTimeoutOnClose], ["/ibc.core.channel.v1.MsgAcknowledgement", MsgAcknowledgement]]; +import { MsgChannelOpenInit, MsgChannelOpenTry, MsgChannelOpenAck, MsgChannelOpenConfirm, MsgChannelCloseInit, MsgChannelCloseConfirm, MsgRecvPacket, MsgTimeout, MsgTimeoutOnClose, MsgAcknowledgement, MsgChannelUpgradeInit, MsgChannelUpgradeTry, MsgChannelUpgradeAck, MsgChannelUpgradeConfirm, MsgChannelUpgradeOpen, MsgChannelUpgradeTimeout, MsgChannelUpgradeCancel, MsgUpdateParams, MsgPruneAcknowledgements } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.core.channel.v1.MsgChannelOpenInit", MsgChannelOpenInit], ["/ibc.core.channel.v1.MsgChannelOpenTry", MsgChannelOpenTry], ["/ibc.core.channel.v1.MsgChannelOpenAck", MsgChannelOpenAck], ["/ibc.core.channel.v1.MsgChannelOpenConfirm", MsgChannelOpenConfirm], ["/ibc.core.channel.v1.MsgChannelCloseInit", MsgChannelCloseInit], ["/ibc.core.channel.v1.MsgChannelCloseConfirm", MsgChannelCloseConfirm], ["/ibc.core.channel.v1.MsgRecvPacket", MsgRecvPacket], ["/ibc.core.channel.v1.MsgTimeout", MsgTimeout], ["/ibc.core.channel.v1.MsgTimeoutOnClose", MsgTimeoutOnClose], ["/ibc.core.channel.v1.MsgAcknowledgement", MsgAcknowledgement], ["/ibc.core.channel.v1.MsgChannelUpgradeInit", MsgChannelUpgradeInit], ["/ibc.core.channel.v1.MsgChannelUpgradeTry", MsgChannelUpgradeTry], ["/ibc.core.channel.v1.MsgChannelUpgradeAck", MsgChannelUpgradeAck], ["/ibc.core.channel.v1.MsgChannelUpgradeConfirm", MsgChannelUpgradeConfirm], ["/ibc.core.channel.v1.MsgChannelUpgradeOpen", MsgChannelUpgradeOpen], ["/ibc.core.channel.v1.MsgChannelUpgradeTimeout", MsgChannelUpgradeTimeout], ["/ibc.core.channel.v1.MsgChannelUpgradeCancel", MsgChannelUpgradeCancel], ["/ibc.core.channel.v1.MsgUpdateParams", MsgUpdateParams], ["/ibc.core.channel.v1.MsgPruneAcknowledgements", MsgPruneAcknowledgements]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -67,6 +67,60 @@ export const MessageComposer = { typeUrl: "/ibc.core.channel.v1.MsgAcknowledgement", value: MsgAcknowledgement.encode(value).finish() }; + }, + channelUpgradeInit(value: MsgChannelUpgradeInit) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInit", + value: MsgChannelUpgradeInit.encode(value).finish() + }; + }, + channelUpgradeTry(value: MsgChannelUpgradeTry) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTry", + value: MsgChannelUpgradeTry.encode(value).finish() + }; + }, + channelUpgradeAck(value: MsgChannelUpgradeAck) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAck", + value: MsgChannelUpgradeAck.encode(value).finish() + }; + }, + channelUpgradeConfirm(value: MsgChannelUpgradeConfirm) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirm", + value: MsgChannelUpgradeConfirm.encode(value).finish() + }; + }, + channelUpgradeOpen(value: MsgChannelUpgradeOpen) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpen", + value: MsgChannelUpgradeOpen.encode(value).finish() + }; + }, + channelUpgradeTimeout(value: MsgChannelUpgradeTimeout) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeout", + value: MsgChannelUpgradeTimeout.encode(value).finish() + }; + }, + channelUpgradeCancel(value: MsgChannelUpgradeCancel) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancel", + value: MsgChannelUpgradeCancel.encode(value).finish() + }; + }, + updateChannelParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.channel.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; + }, + pruneAcknowledgements(value: MsgPruneAcknowledgements) { + return { + typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgements", + value: MsgPruneAcknowledgements.encode(value).finish() + }; } }, withTypeUrl: { @@ -129,6 +183,60 @@ export const MessageComposer = { typeUrl: "/ibc.core.channel.v1.MsgAcknowledgement", value }; + }, + channelUpgradeInit(value: MsgChannelUpgradeInit) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInit", + value + }; + }, + channelUpgradeTry(value: MsgChannelUpgradeTry) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTry", + value + }; + }, + channelUpgradeAck(value: MsgChannelUpgradeAck) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAck", + value + }; + }, + channelUpgradeConfirm(value: MsgChannelUpgradeConfirm) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirm", + value + }; + }, + channelUpgradeOpen(value: MsgChannelUpgradeOpen) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpen", + value + }; + }, + channelUpgradeTimeout(value: MsgChannelUpgradeTimeout) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeout", + value + }; + }, + channelUpgradeCancel(value: MsgChannelUpgradeCancel) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancel", + value + }; + }, + updateChannelParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.channel.v1.MsgUpdateParams", + value + }; + }, + pruneAcknowledgements(value: MsgPruneAcknowledgements) { + return { + typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgements", + value + }; } }, fromPartial: { @@ -191,6 +299,60 @@ export const MessageComposer = { typeUrl: "/ibc.core.channel.v1.MsgAcknowledgement", value: MsgAcknowledgement.fromPartial(value) }; + }, + channelUpgradeInit(value: MsgChannelUpgradeInit) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInit", + value: MsgChannelUpgradeInit.fromPartial(value) + }; + }, + channelUpgradeTry(value: MsgChannelUpgradeTry) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTry", + value: MsgChannelUpgradeTry.fromPartial(value) + }; + }, + channelUpgradeAck(value: MsgChannelUpgradeAck) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAck", + value: MsgChannelUpgradeAck.fromPartial(value) + }; + }, + channelUpgradeConfirm(value: MsgChannelUpgradeConfirm) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirm", + value: MsgChannelUpgradeConfirm.fromPartial(value) + }; + }, + channelUpgradeOpen(value: MsgChannelUpgradeOpen) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpen", + value: MsgChannelUpgradeOpen.fromPartial(value) + }; + }, + channelUpgradeTimeout(value: MsgChannelUpgradeTimeout) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeout", + value: MsgChannelUpgradeTimeout.fromPartial(value) + }; + }, + channelUpgradeCancel(value: MsgChannelUpgradeCancel) { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancel", + value: MsgChannelUpgradeCancel.fromPartial(value) + }; + }, + updateChannelParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.channel.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; + }, + pruneAcknowledgements(value: MsgPruneAcknowledgements) { + return { + typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgements", + value: MsgPruneAcknowledgements.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/src/codegen/ibc/core/channel/v1/tx.rpc.msg.ts b/src/codegen/ibc/core/channel/v1/tx.rpc.msg.ts index 1429bd6..f014ed5 100644 --- a/src/codegen/ibc/core/channel/v1/tx.rpc.msg.ts +++ b/src/codegen/ibc/core/channel/v1/tx.rpc.msg.ts @@ -1,6 +1,6 @@ import { Rpc } from "../../../../helpers"; import { BinaryReader } from "../../../../binary"; -import { MsgChannelOpenInit, MsgChannelOpenInitResponse, MsgChannelOpenTry, MsgChannelOpenTryResponse, MsgChannelOpenAck, MsgChannelOpenAckResponse, MsgChannelOpenConfirm, MsgChannelOpenConfirmResponse, MsgChannelCloseInit, MsgChannelCloseInitResponse, MsgChannelCloseConfirm, MsgChannelCloseConfirmResponse, MsgRecvPacket, MsgRecvPacketResponse, MsgTimeout, MsgTimeoutResponse, MsgTimeoutOnClose, MsgTimeoutOnCloseResponse, MsgAcknowledgement, MsgAcknowledgementResponse } from "./tx"; +import { MsgChannelOpenInit, MsgChannelOpenInitResponse, MsgChannelOpenTry, MsgChannelOpenTryResponse, MsgChannelOpenAck, MsgChannelOpenAckResponse, MsgChannelOpenConfirm, MsgChannelOpenConfirmResponse, MsgChannelCloseInit, MsgChannelCloseInitResponse, MsgChannelCloseConfirm, MsgChannelCloseConfirmResponse, MsgRecvPacket, MsgRecvPacketResponse, MsgTimeout, MsgTimeoutResponse, MsgTimeoutOnClose, MsgTimeoutOnCloseResponse, MsgAcknowledgement, MsgAcknowledgementResponse, MsgChannelUpgradeInit, MsgChannelUpgradeInitResponse, MsgChannelUpgradeTry, MsgChannelUpgradeTryResponse, MsgChannelUpgradeAck, MsgChannelUpgradeAckResponse, MsgChannelUpgradeConfirm, MsgChannelUpgradeConfirmResponse, MsgChannelUpgradeOpen, MsgChannelUpgradeOpenResponse, MsgChannelUpgradeTimeout, MsgChannelUpgradeTimeoutResponse, MsgChannelUpgradeCancel, MsgChannelUpgradeCancelResponse, MsgUpdateParams, MsgUpdateParamsResponse, MsgPruneAcknowledgements, MsgPruneAcknowledgementsResponse } from "./tx"; /** Msg defines the ibc/channel Msg service. */ export interface Msg { /** ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. */ @@ -26,6 +26,24 @@ export interface Msg { timeoutOnClose(request: MsgTimeoutOnClose): Promise; /** Acknowledgement defines a rpc handler method for MsgAcknowledgement. */ acknowledgement(request: MsgAcknowledgement): Promise; + /** ChannelUpgradeInit defines a rpc handler method for MsgChannelUpgradeInit. */ + channelUpgradeInit(request: MsgChannelUpgradeInit): Promise; + /** ChannelUpgradeTry defines a rpc handler method for MsgChannelUpgradeTry. */ + channelUpgradeTry(request: MsgChannelUpgradeTry): Promise; + /** ChannelUpgradeAck defines a rpc handler method for MsgChannelUpgradeAck. */ + channelUpgradeAck(request: MsgChannelUpgradeAck): Promise; + /** ChannelUpgradeConfirm defines a rpc handler method for MsgChannelUpgradeConfirm. */ + channelUpgradeConfirm(request: MsgChannelUpgradeConfirm): Promise; + /** ChannelUpgradeOpen defines a rpc handler method for MsgChannelUpgradeOpen. */ + channelUpgradeOpen(request: MsgChannelUpgradeOpen): Promise; + /** ChannelUpgradeTimeout defines a rpc handler method for MsgChannelUpgradeTimeout. */ + channelUpgradeTimeout(request: MsgChannelUpgradeTimeout): Promise; + /** ChannelUpgradeCancel defines a rpc handler method for MsgChannelUpgradeCancel. */ + channelUpgradeCancel(request: MsgChannelUpgradeCancel): Promise; + /** UpdateChannelParams defines a rpc handler method for MsgUpdateParams. */ + updateChannelParams(request: MsgUpdateParams): Promise; + /** PruneAcknowledgements defines a rpc handler method for MsgPruneAcknowledgements. */ + pruneAcknowledgements(request: MsgPruneAcknowledgements): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -41,6 +59,15 @@ export class MsgClientImpl implements Msg { this.timeout = this.timeout.bind(this); this.timeoutOnClose = this.timeoutOnClose.bind(this); this.acknowledgement = this.acknowledgement.bind(this); + this.channelUpgradeInit = this.channelUpgradeInit.bind(this); + this.channelUpgradeTry = this.channelUpgradeTry.bind(this); + this.channelUpgradeAck = this.channelUpgradeAck.bind(this); + this.channelUpgradeConfirm = this.channelUpgradeConfirm.bind(this); + this.channelUpgradeOpen = this.channelUpgradeOpen.bind(this); + this.channelUpgradeTimeout = this.channelUpgradeTimeout.bind(this); + this.channelUpgradeCancel = this.channelUpgradeCancel.bind(this); + this.updateChannelParams = this.updateChannelParams.bind(this); + this.pruneAcknowledgements = this.pruneAcknowledgements.bind(this); } channelOpenInit(request: MsgChannelOpenInit): Promise { const data = MsgChannelOpenInit.encode(request).finish(); @@ -92,4 +119,49 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("ibc.core.channel.v1.Msg", "Acknowledgement", data); return promise.then(data => MsgAcknowledgementResponse.decode(new BinaryReader(data))); } + channelUpgradeInit(request: MsgChannelUpgradeInit): Promise { + const data = MsgChannelUpgradeInit.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeInit", data); + return promise.then(data => MsgChannelUpgradeInitResponse.decode(new BinaryReader(data))); + } + channelUpgradeTry(request: MsgChannelUpgradeTry): Promise { + const data = MsgChannelUpgradeTry.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeTry", data); + return promise.then(data => MsgChannelUpgradeTryResponse.decode(new BinaryReader(data))); + } + channelUpgradeAck(request: MsgChannelUpgradeAck): Promise { + const data = MsgChannelUpgradeAck.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeAck", data); + return promise.then(data => MsgChannelUpgradeAckResponse.decode(new BinaryReader(data))); + } + channelUpgradeConfirm(request: MsgChannelUpgradeConfirm): Promise { + const data = MsgChannelUpgradeConfirm.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeConfirm", data); + return promise.then(data => MsgChannelUpgradeConfirmResponse.decode(new BinaryReader(data))); + } + channelUpgradeOpen(request: MsgChannelUpgradeOpen): Promise { + const data = MsgChannelUpgradeOpen.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeOpen", data); + return promise.then(data => MsgChannelUpgradeOpenResponse.decode(new BinaryReader(data))); + } + channelUpgradeTimeout(request: MsgChannelUpgradeTimeout): Promise { + const data = MsgChannelUpgradeTimeout.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeTimeout", data); + return promise.then(data => MsgChannelUpgradeTimeoutResponse.decode(new BinaryReader(data))); + } + channelUpgradeCancel(request: MsgChannelUpgradeCancel): Promise { + const data = MsgChannelUpgradeCancel.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "ChannelUpgradeCancel", data); + return promise.then(data => MsgChannelUpgradeCancelResponse.decode(new BinaryReader(data))); + } + updateChannelParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "UpdateChannelParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } + pruneAcknowledgements(request: MsgPruneAcknowledgements): Promise { + const data = MsgPruneAcknowledgements.encode(request).finish(); + const promise = this.rpc.request("ibc.core.channel.v1.Msg", "PruneAcknowledgements", data); + return promise.then(data => MsgPruneAcknowledgementsResponse.decode(new BinaryReader(data))); + } } \ No newline at end of file diff --git a/src/codegen/ibc/core/channel/v1/tx.ts b/src/codegen/ibc/core/channel/v1/tx.ts index f3509af..8e31067 100644 --- a/src/codegen/ibc/core/channel/v1/tx.ts +++ b/src/codegen/ibc/core/channel/v1/tx.ts @@ -1,5 +1,6 @@ -import { Channel, ChannelAmino, ChannelSDKType, Packet, PacketAmino, PacketSDKType } from "./channel"; -import { Height, HeightAmino, HeightSDKType } from "../../client/v1/client"; +import { Channel, ChannelAmino, ChannelSDKType, Packet, PacketAmino, PacketSDKType, State } from "./channel"; +import { Height, HeightAmino, HeightSDKType, Params, ParamsAmino, ParamsSDKType } from "../../client/v1/client"; +import { UpgradeFields, UpgradeFieldsAmino, UpgradeFieldsSDKType, Upgrade, UpgradeAmino, UpgradeSDKType, ErrorReceipt, ErrorReceiptAmino, ErrorReceiptSDKType } from "./upgrade"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** ResponseResultType defines the possible outcomes of the execution of a message */ @@ -10,6 +11,8 @@ export enum ResponseResultType { RESPONSE_RESULT_TYPE_NOOP = 1, /** RESPONSE_RESULT_TYPE_SUCCESS - The message was executed successfully */ RESPONSE_RESULT_TYPE_SUCCESS = 2, + /** RESPONSE_RESULT_TYPE_FAILURE - The message was executed unsuccessfully */ + RESPONSE_RESULT_TYPE_FAILURE = 3, UNRECOGNIZED = -1, } export const ResponseResultTypeSDKType = ResponseResultType; @@ -25,6 +28,9 @@ export function responseResultTypeFromJSON(object: any): ResponseResultType { case 2: case "RESPONSE_RESULT_TYPE_SUCCESS": return ResponseResultType.RESPONSE_RESULT_TYPE_SUCCESS; + case 3: + case "RESPONSE_RESULT_TYPE_FAILURE": + return ResponseResultType.RESPONSE_RESULT_TYPE_FAILURE; case -1: case "UNRECOGNIZED": default: @@ -39,6 +45,8 @@ export function responseResultTypeToJSON(object: ResponseResultType): string { return "RESPONSE_RESULT_TYPE_NOOP"; case ResponseResultType.RESPONSE_RESULT_TYPE_SUCCESS: return "RESPONSE_RESULT_TYPE_SUCCESS"; + case ResponseResultType.RESPONSE_RESULT_TYPE_FAILURE: + return "RESPONSE_RESULT_TYPE_FAILURE"; case ResponseResultType.UNRECOGNIZED: default: return "UNRECOGNIZED"; @@ -162,6 +170,7 @@ export interface MsgChannelOpenTrySDKType { /** MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. */ export interface MsgChannelOpenTryResponse { version: string; + channelId: string; } export interface MsgChannelOpenTryResponseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelOpenTryResponse"; @@ -170,6 +179,7 @@ export interface MsgChannelOpenTryResponseProtoMsg { /** MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. */ export interface MsgChannelOpenTryResponseAmino { version?: string; + channel_id?: string; } export interface MsgChannelOpenTryResponseAminoMsg { type: "cosmos-sdk/MsgChannelOpenTryResponse"; @@ -178,10 +188,14 @@ export interface MsgChannelOpenTryResponseAminoMsg { /** MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. */ export interface MsgChannelOpenTryResponseSDKType { version: string; + channel_id: string; } /** * MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge * the change of channel state to TRYOPEN on Chain B. + * WARNING: a channel upgrade MUST NOT initialize an upgrade for this channel + * in the same block as executing this message otherwise the counterparty will + * be incapable of opening. */ export interface MsgChannelOpenAck { portId: string; @@ -199,6 +213,9 @@ export interface MsgChannelOpenAckProtoMsg { /** * MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge * the change of channel state to TRYOPEN on Chain B. + * WARNING: a channel upgrade MUST NOT initialize an upgrade for this channel + * in the same block as executing this message otherwise the counterparty will + * be incapable of opening. */ export interface MsgChannelOpenAckAmino { port_id?: string; @@ -216,6 +233,9 @@ export interface MsgChannelOpenAckAminoMsg { /** * MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge * the change of channel state to TRYOPEN on Chain B. + * WARNING: a channel upgrade MUST NOT initialize an upgrade for this channel + * in the same block as executing this message otherwise the counterparty will + * be incapable of opening. */ export interface MsgChannelOpenAckSDKType { port_id: string; @@ -363,6 +383,7 @@ export interface MsgChannelCloseConfirm { proofInit: Uint8Array; proofHeight: Height; signer: string; + counterpartyUpgradeSequence: bigint; } export interface MsgChannelCloseConfirmProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgChannelCloseConfirm"; @@ -378,6 +399,7 @@ export interface MsgChannelCloseConfirmAmino { proof_init?: string; proof_height?: HeightAmino; signer?: string; + counterparty_upgrade_sequence?: string; } export interface MsgChannelCloseConfirmAminoMsg { type: "cosmos-sdk/MsgChannelCloseConfirm"; @@ -393,6 +415,7 @@ export interface MsgChannelCloseConfirmSDKType { proof_init: Uint8Array; proof_height: HeightSDKType; signer: string; + counterparty_upgrade_sequence: bigint; } /** * MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response @@ -526,6 +549,7 @@ export interface MsgTimeoutOnClose { proofHeight: Height; nextSequenceRecv: bigint; signer: string; + counterpartyUpgradeSequence: bigint; } export interface MsgTimeoutOnCloseProtoMsg { typeUrl: "/ibc.core.channel.v1.MsgTimeoutOnClose"; @@ -539,6 +563,7 @@ export interface MsgTimeoutOnCloseAmino { proof_height?: HeightAmino; next_sequence_recv?: string; signer?: string; + counterparty_upgrade_sequence?: string; } export interface MsgTimeoutOnCloseAminoMsg { type: "cosmos-sdk/MsgTimeoutOnClose"; @@ -552,6 +577,7 @@ export interface MsgTimeoutOnCloseSDKType { proof_height: HeightSDKType; next_sequence_recv: bigint; signer: string; + counterparty_upgrade_sequence: bigint; } /** MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. */ export interface MsgTimeoutOnCloseResponse { @@ -625,6 +651,514 @@ export interface MsgAcknowledgementResponseAminoMsg { export interface MsgAcknowledgementResponseSDKType { result: ResponseResultType; } +/** + * MsgChannelUpgradeInit defines the request type for the ChannelUpgradeInit rpc + * WARNING: Initializing a channel upgrade in the same block as opening the channel + * may result in the counterparty being incapable of opening. + */ +export interface MsgChannelUpgradeInit { + portId: string; + channelId: string; + fields: UpgradeFields; + signer: string; +} +export interface MsgChannelUpgradeInitProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInit"; + value: Uint8Array; +} +/** + * MsgChannelUpgradeInit defines the request type for the ChannelUpgradeInit rpc + * WARNING: Initializing a channel upgrade in the same block as opening the channel + * may result in the counterparty being incapable of opening. + */ +export interface MsgChannelUpgradeInitAmino { + port_id?: string; + channel_id?: string; + fields?: UpgradeFieldsAmino; + signer?: string; +} +export interface MsgChannelUpgradeInitAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeInit"; + value: MsgChannelUpgradeInitAmino; +} +/** + * MsgChannelUpgradeInit defines the request type for the ChannelUpgradeInit rpc + * WARNING: Initializing a channel upgrade in the same block as opening the channel + * may result in the counterparty being incapable of opening. + */ +export interface MsgChannelUpgradeInitSDKType { + port_id: string; + channel_id: string; + fields: UpgradeFieldsSDKType; + signer: string; +} +/** MsgChannelUpgradeInitResponse defines the MsgChannelUpgradeInit response type */ +export interface MsgChannelUpgradeInitResponse { + upgrade: Upgrade; + upgradeSequence: bigint; +} +export interface MsgChannelUpgradeInitResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInitResponse"; + value: Uint8Array; +} +/** MsgChannelUpgradeInitResponse defines the MsgChannelUpgradeInit response type */ +export interface MsgChannelUpgradeInitResponseAmino { + upgrade?: UpgradeAmino; + upgrade_sequence?: string; +} +export interface MsgChannelUpgradeInitResponseAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeInitResponse"; + value: MsgChannelUpgradeInitResponseAmino; +} +/** MsgChannelUpgradeInitResponse defines the MsgChannelUpgradeInit response type */ +export interface MsgChannelUpgradeInitResponseSDKType { + upgrade: UpgradeSDKType; + upgrade_sequence: bigint; +} +/** MsgChannelUpgradeTry defines the request type for the ChannelUpgradeTry rpc */ +export interface MsgChannelUpgradeTry { + portId: string; + channelId: string; + proposedUpgradeConnectionHops: string[]; + counterpartyUpgradeFields: UpgradeFields; + counterpartyUpgradeSequence: bigint; + proofChannel: Uint8Array; + proofUpgrade: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgChannelUpgradeTryProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTry"; + value: Uint8Array; +} +/** MsgChannelUpgradeTry defines the request type for the ChannelUpgradeTry rpc */ +export interface MsgChannelUpgradeTryAmino { + port_id?: string; + channel_id?: string; + proposed_upgrade_connection_hops?: string[]; + counterparty_upgrade_fields?: UpgradeFieldsAmino; + counterparty_upgrade_sequence?: string; + proof_channel?: string; + proof_upgrade?: string; + proof_height?: HeightAmino; + signer?: string; +} +export interface MsgChannelUpgradeTryAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeTry"; + value: MsgChannelUpgradeTryAmino; +} +/** MsgChannelUpgradeTry defines the request type for the ChannelUpgradeTry rpc */ +export interface MsgChannelUpgradeTrySDKType { + port_id: string; + channel_id: string; + proposed_upgrade_connection_hops: string[]; + counterparty_upgrade_fields: UpgradeFieldsSDKType; + counterparty_upgrade_sequence: bigint; + proof_channel: Uint8Array; + proof_upgrade: Uint8Array; + proof_height: HeightSDKType; + signer: string; +} +/** MsgChannelUpgradeTryResponse defines the MsgChannelUpgradeTry response type */ +export interface MsgChannelUpgradeTryResponse { + upgrade: Upgrade; + upgradeSequence: bigint; + result: ResponseResultType; +} +export interface MsgChannelUpgradeTryResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTryResponse"; + value: Uint8Array; +} +/** MsgChannelUpgradeTryResponse defines the MsgChannelUpgradeTry response type */ +export interface MsgChannelUpgradeTryResponseAmino { + upgrade?: UpgradeAmino; + upgrade_sequence?: string; + result?: ResponseResultType; +} +export interface MsgChannelUpgradeTryResponseAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeTryResponse"; + value: MsgChannelUpgradeTryResponseAmino; +} +/** MsgChannelUpgradeTryResponse defines the MsgChannelUpgradeTry response type */ +export interface MsgChannelUpgradeTryResponseSDKType { + upgrade: UpgradeSDKType; + upgrade_sequence: bigint; + result: ResponseResultType; +} +/** MsgChannelUpgradeAck defines the request type for the ChannelUpgradeAck rpc */ +export interface MsgChannelUpgradeAck { + portId: string; + channelId: string; + counterpartyUpgrade: Upgrade; + proofChannel: Uint8Array; + proofUpgrade: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgChannelUpgradeAckProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAck"; + value: Uint8Array; +} +/** MsgChannelUpgradeAck defines the request type for the ChannelUpgradeAck rpc */ +export interface MsgChannelUpgradeAckAmino { + port_id?: string; + channel_id?: string; + counterparty_upgrade?: UpgradeAmino; + proof_channel?: string; + proof_upgrade?: string; + proof_height?: HeightAmino; + signer?: string; +} +export interface MsgChannelUpgradeAckAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeAck"; + value: MsgChannelUpgradeAckAmino; +} +/** MsgChannelUpgradeAck defines the request type for the ChannelUpgradeAck rpc */ +export interface MsgChannelUpgradeAckSDKType { + port_id: string; + channel_id: string; + counterparty_upgrade: UpgradeSDKType; + proof_channel: Uint8Array; + proof_upgrade: Uint8Array; + proof_height: HeightSDKType; + signer: string; +} +/** MsgChannelUpgradeAckResponse defines MsgChannelUpgradeAck response type */ +export interface MsgChannelUpgradeAckResponse { + result: ResponseResultType; +} +export interface MsgChannelUpgradeAckResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAckResponse"; + value: Uint8Array; +} +/** MsgChannelUpgradeAckResponse defines MsgChannelUpgradeAck response type */ +export interface MsgChannelUpgradeAckResponseAmino { + result?: ResponseResultType; +} +export interface MsgChannelUpgradeAckResponseAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeAckResponse"; + value: MsgChannelUpgradeAckResponseAmino; +} +/** MsgChannelUpgradeAckResponse defines MsgChannelUpgradeAck response type */ +export interface MsgChannelUpgradeAckResponseSDKType { + result: ResponseResultType; +} +/** MsgChannelUpgradeConfirm defines the request type for the ChannelUpgradeConfirm rpc */ +export interface MsgChannelUpgradeConfirm { + portId: string; + channelId: string; + counterpartyChannelState: State; + counterpartyUpgrade: Upgrade; + proofChannel: Uint8Array; + proofUpgrade: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgChannelUpgradeConfirmProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirm"; + value: Uint8Array; +} +/** MsgChannelUpgradeConfirm defines the request type for the ChannelUpgradeConfirm rpc */ +export interface MsgChannelUpgradeConfirmAmino { + port_id?: string; + channel_id?: string; + counterparty_channel_state?: State; + counterparty_upgrade?: UpgradeAmino; + proof_channel?: string; + proof_upgrade?: string; + proof_height?: HeightAmino; + signer?: string; +} +export interface MsgChannelUpgradeConfirmAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeConfirm"; + value: MsgChannelUpgradeConfirmAmino; +} +/** MsgChannelUpgradeConfirm defines the request type for the ChannelUpgradeConfirm rpc */ +export interface MsgChannelUpgradeConfirmSDKType { + port_id: string; + channel_id: string; + counterparty_channel_state: State; + counterparty_upgrade: UpgradeSDKType; + proof_channel: Uint8Array; + proof_upgrade: Uint8Array; + proof_height: HeightSDKType; + signer: string; +} +/** MsgChannelUpgradeConfirmResponse defines MsgChannelUpgradeConfirm response type */ +export interface MsgChannelUpgradeConfirmResponse { + result: ResponseResultType; +} +export interface MsgChannelUpgradeConfirmResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirmResponse"; + value: Uint8Array; +} +/** MsgChannelUpgradeConfirmResponse defines MsgChannelUpgradeConfirm response type */ +export interface MsgChannelUpgradeConfirmResponseAmino { + result?: ResponseResultType; +} +export interface MsgChannelUpgradeConfirmResponseAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeConfirmResponse"; + value: MsgChannelUpgradeConfirmResponseAmino; +} +/** MsgChannelUpgradeConfirmResponse defines MsgChannelUpgradeConfirm response type */ +export interface MsgChannelUpgradeConfirmResponseSDKType { + result: ResponseResultType; +} +/** MsgChannelUpgradeOpen defines the request type for the ChannelUpgradeOpen rpc */ +export interface MsgChannelUpgradeOpen { + portId: string; + channelId: string; + counterpartyChannelState: State; + counterpartyUpgradeSequence: bigint; + proofChannel: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgChannelUpgradeOpenProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpen"; + value: Uint8Array; +} +/** MsgChannelUpgradeOpen defines the request type for the ChannelUpgradeOpen rpc */ +export interface MsgChannelUpgradeOpenAmino { + port_id?: string; + channel_id?: string; + counterparty_channel_state?: State; + counterparty_upgrade_sequence?: string; + proof_channel?: string; + proof_height?: HeightAmino; + signer?: string; +} +export interface MsgChannelUpgradeOpenAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeOpen"; + value: MsgChannelUpgradeOpenAmino; +} +/** MsgChannelUpgradeOpen defines the request type for the ChannelUpgradeOpen rpc */ +export interface MsgChannelUpgradeOpenSDKType { + port_id: string; + channel_id: string; + counterparty_channel_state: State; + counterparty_upgrade_sequence: bigint; + proof_channel: Uint8Array; + proof_height: HeightSDKType; + signer: string; +} +/** MsgChannelUpgradeOpenResponse defines the MsgChannelUpgradeOpen response type */ +export interface MsgChannelUpgradeOpenResponse {} +export interface MsgChannelUpgradeOpenResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpenResponse"; + value: Uint8Array; +} +/** MsgChannelUpgradeOpenResponse defines the MsgChannelUpgradeOpen response type */ +export interface MsgChannelUpgradeOpenResponseAmino {} +export interface MsgChannelUpgradeOpenResponseAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeOpenResponse"; + value: MsgChannelUpgradeOpenResponseAmino; +} +/** MsgChannelUpgradeOpenResponse defines the MsgChannelUpgradeOpen response type */ +export interface MsgChannelUpgradeOpenResponseSDKType {} +/** MsgChannelUpgradeTimeout defines the request type for the ChannelUpgradeTimeout rpc */ +export interface MsgChannelUpgradeTimeout { + portId: string; + channelId: string; + counterpartyChannel: Channel; + proofChannel: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgChannelUpgradeTimeoutProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeout"; + value: Uint8Array; +} +/** MsgChannelUpgradeTimeout defines the request type for the ChannelUpgradeTimeout rpc */ +export interface MsgChannelUpgradeTimeoutAmino { + port_id?: string; + channel_id?: string; + counterparty_channel?: ChannelAmino; + proof_channel?: string; + proof_height?: HeightAmino; + signer?: string; +} +export interface MsgChannelUpgradeTimeoutAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeTimeout"; + value: MsgChannelUpgradeTimeoutAmino; +} +/** MsgChannelUpgradeTimeout defines the request type for the ChannelUpgradeTimeout rpc */ +export interface MsgChannelUpgradeTimeoutSDKType { + port_id: string; + channel_id: string; + counterparty_channel: ChannelSDKType; + proof_channel: Uint8Array; + proof_height: HeightSDKType; + signer: string; +} +/** MsgChannelUpgradeTimeoutRepsonse defines the MsgChannelUpgradeTimeout response type */ +export interface MsgChannelUpgradeTimeoutResponse {} +export interface MsgChannelUpgradeTimeoutResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeoutResponse"; + value: Uint8Array; +} +/** MsgChannelUpgradeTimeoutRepsonse defines the MsgChannelUpgradeTimeout response type */ +export interface MsgChannelUpgradeTimeoutResponseAmino {} +export interface MsgChannelUpgradeTimeoutResponseAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeTimeoutResponse"; + value: MsgChannelUpgradeTimeoutResponseAmino; +} +/** MsgChannelUpgradeTimeoutRepsonse defines the MsgChannelUpgradeTimeout response type */ +export interface MsgChannelUpgradeTimeoutResponseSDKType {} +/** MsgChannelUpgradeCancel defines the request type for the ChannelUpgradeCancel rpc */ +export interface MsgChannelUpgradeCancel { + portId: string; + channelId: string; + errorReceipt: ErrorReceipt; + proofErrorReceipt: Uint8Array; + proofHeight: Height; + signer: string; +} +export interface MsgChannelUpgradeCancelProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancel"; + value: Uint8Array; +} +/** MsgChannelUpgradeCancel defines the request type for the ChannelUpgradeCancel rpc */ +export interface MsgChannelUpgradeCancelAmino { + port_id?: string; + channel_id?: string; + error_receipt?: ErrorReceiptAmino; + proof_error_receipt?: string; + proof_height?: HeightAmino; + signer?: string; +} +export interface MsgChannelUpgradeCancelAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeCancel"; + value: MsgChannelUpgradeCancelAmino; +} +/** MsgChannelUpgradeCancel defines the request type for the ChannelUpgradeCancel rpc */ +export interface MsgChannelUpgradeCancelSDKType { + port_id: string; + channel_id: string; + error_receipt: ErrorReceiptSDKType; + proof_error_receipt: Uint8Array; + proof_height: HeightSDKType; + signer: string; +} +/** MsgChannelUpgradeCancelResponse defines the MsgChannelUpgradeCancel response type */ +export interface MsgChannelUpgradeCancelResponse {} +export interface MsgChannelUpgradeCancelResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancelResponse"; + value: Uint8Array; +} +/** MsgChannelUpgradeCancelResponse defines the MsgChannelUpgradeCancel response type */ +export interface MsgChannelUpgradeCancelResponseAmino {} +export interface MsgChannelUpgradeCancelResponseAminoMsg { + type: "cosmos-sdk/MsgChannelUpgradeCancelResponse"; + value: MsgChannelUpgradeCancelResponseAmino; +} +/** MsgChannelUpgradeCancelResponse defines the MsgChannelUpgradeCancel response type */ +export interface MsgChannelUpgradeCancelResponseSDKType {} +/** MsgUpdateParams is the MsgUpdateParams request type. */ +export interface MsgUpdateParams { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority: string; + /** + * params defines the channel parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** MsgUpdateParams is the MsgUpdateParams request type. */ +export interface MsgUpdateParamsAmino { + /** authority is the address that controls the module (defaults to x/gov unless overwritten). */ + authority?: string; + /** + * params defines the channel parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params?: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** MsgUpdateParams is the MsgUpdateParams request type. */ +export interface MsgUpdateParamsSDKType { + authority: string; + params: ParamsSDKType; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponseSDKType {} +/** MsgPruneAcknowledgements defines the request type for the PruneAcknowledgements rpc. */ +export interface MsgPruneAcknowledgements { + portId: string; + channelId: string; + limit: bigint; + signer: string; +} +export interface MsgPruneAcknowledgementsProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgements"; + value: Uint8Array; +} +/** MsgPruneAcknowledgements defines the request type for the PruneAcknowledgements rpc. */ +export interface MsgPruneAcknowledgementsAmino { + port_id?: string; + channel_id?: string; + limit?: string; + signer?: string; +} +export interface MsgPruneAcknowledgementsAminoMsg { + type: "cosmos-sdk/MsgPruneAcknowledgements"; + value: MsgPruneAcknowledgementsAmino; +} +/** MsgPruneAcknowledgements defines the request type for the PruneAcknowledgements rpc. */ +export interface MsgPruneAcknowledgementsSDKType { + port_id: string; + channel_id: string; + limit: bigint; + signer: string; +} +/** MsgPruneAcknowledgementsResponse defines the response type for the PruneAcknowledgements rpc. */ +export interface MsgPruneAcknowledgementsResponse { + /** Number of sequences pruned (includes both packet acknowledgements and packet receipts where appropriate). */ + totalPrunedSequences: bigint; + /** Number of sequences left after pruning. */ + totalRemainingSequences: bigint; +} +export interface MsgPruneAcknowledgementsResponseProtoMsg { + typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgementsResponse"; + value: Uint8Array; +} +/** MsgPruneAcknowledgementsResponse defines the response type for the PruneAcknowledgements rpc. */ +export interface MsgPruneAcknowledgementsResponseAmino { + /** Number of sequences pruned (includes both packet acknowledgements and packet receipts where appropriate). */ + total_pruned_sequences?: string; + /** Number of sequences left after pruning. */ + total_remaining_sequences?: string; +} +export interface MsgPruneAcknowledgementsResponseAminoMsg { + type: "cosmos-sdk/MsgPruneAcknowledgementsResponse"; + value: MsgPruneAcknowledgementsResponseAmino; +} +/** MsgPruneAcknowledgementsResponse defines the response type for the PruneAcknowledgements rpc. */ +export interface MsgPruneAcknowledgementsResponseSDKType { + total_pruned_sequences: bigint; + total_remaining_sequences: bigint; +} function createBaseMsgChannelOpenInit(): MsgChannelOpenInit { return { portId: "", @@ -942,7 +1476,8 @@ export const MsgChannelOpenTry = { }; function createBaseMsgChannelOpenTryResponse(): MsgChannelOpenTryResponse { return { - version: "" + version: "", + channelId: "" }; } export const MsgChannelOpenTryResponse = { @@ -951,6 +1486,9 @@ export const MsgChannelOpenTryResponse = { if (message.version !== "") { writer.uint32(10).string(message.version); } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelOpenTryResponse { @@ -963,6 +1501,9 @@ export const MsgChannelOpenTryResponse = { case 1: message.version = reader.string(); break; + case 2: + message.channelId = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -973,6 +1514,7 @@ export const MsgChannelOpenTryResponse = { fromPartial(object: Partial): MsgChannelOpenTryResponse { const message = createBaseMsgChannelOpenTryResponse(); message.version = object.version ?? ""; + message.channelId = object.channelId ?? ""; return message; }, fromAmino(object: MsgChannelOpenTryResponseAmino): MsgChannelOpenTryResponse { @@ -980,11 +1522,15 @@ export const MsgChannelOpenTryResponse = { if (object.version !== undefined && object.version !== null) { message.version = object.version; } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } return message; }, toAmino(message: MsgChannelOpenTryResponse): MsgChannelOpenTryResponseAmino { const obj: any = {}; obj.version = message.version === "" ? undefined : message.version; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; return obj; }, fromAminoMsg(object: MsgChannelOpenTryResponseAminoMsg): MsgChannelOpenTryResponse { @@ -1534,7 +2080,8 @@ function createBaseMsgChannelCloseConfirm(): MsgChannelCloseConfirm { channelId: "", proofInit: new Uint8Array(), proofHeight: Height.fromPartial({}), - signer: "" + signer: "", + counterpartyUpgradeSequence: BigInt(0) }; } export const MsgChannelCloseConfirm = { @@ -1555,6 +2102,9 @@ export const MsgChannelCloseConfirm = { if (message.signer !== "") { writer.uint32(42).string(message.signer); } + if (message.counterpartyUpgradeSequence !== BigInt(0)) { + writer.uint32(48).uint64(message.counterpartyUpgradeSequence); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelCloseConfirm { @@ -1579,6 +2129,9 @@ export const MsgChannelCloseConfirm = { case 5: message.signer = reader.string(); break; + case 6: + message.counterpartyUpgradeSequence = reader.uint64(); + break; default: reader.skipType(tag & 7); break; @@ -1593,6 +2146,7 @@ export const MsgChannelCloseConfirm = { message.proofInit = object.proofInit ?? new Uint8Array(); message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; message.signer = object.signer ?? ""; + message.counterpartyUpgradeSequence = object.counterpartyUpgradeSequence !== undefined && object.counterpartyUpgradeSequence !== null ? BigInt(object.counterpartyUpgradeSequence.toString()) : BigInt(0); return message; }, fromAmino(object: MsgChannelCloseConfirmAmino): MsgChannelCloseConfirm { @@ -1612,6 +2166,9 @@ export const MsgChannelCloseConfirm = { if (object.signer !== undefined && object.signer !== null) { message.signer = object.signer; } + if (object.counterparty_upgrade_sequence !== undefined && object.counterparty_upgrade_sequence !== null) { + message.counterpartyUpgradeSequence = BigInt(object.counterparty_upgrade_sequence); + } return message; }, toAmino(message: MsgChannelCloseConfirm): MsgChannelCloseConfirmAmino { @@ -1621,6 +2178,7 @@ export const MsgChannelCloseConfirm = { obj.proof_init = message.proofInit ? base64FromBytes(message.proofInit) : undefined; obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; obj.signer = message.signer === "" ? undefined : message.signer; + obj.counterparty_upgrade_sequence = message.counterpartyUpgradeSequence !== BigInt(0) ? message.counterpartyUpgradeSequence.toString() : undefined; return obj; }, fromAminoMsg(object: MsgChannelCloseConfirmAminoMsg): MsgChannelCloseConfirm { @@ -2068,7 +2626,8 @@ function createBaseMsgTimeoutOnClose(): MsgTimeoutOnClose { proofClose: new Uint8Array(), proofHeight: Height.fromPartial({}), nextSequenceRecv: BigInt(0), - signer: "" + signer: "", + counterpartyUpgradeSequence: BigInt(0) }; } export const MsgTimeoutOnClose = { @@ -2092,6 +2651,9 @@ export const MsgTimeoutOnClose = { if (message.signer !== "") { writer.uint32(50).string(message.signer); } + if (message.counterpartyUpgradeSequence !== BigInt(0)) { + writer.uint32(56).uint64(message.counterpartyUpgradeSequence); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): MsgTimeoutOnClose { @@ -2119,6 +2681,9 @@ export const MsgTimeoutOnClose = { case 6: message.signer = reader.string(); break; + case 7: + message.counterpartyUpgradeSequence = reader.uint64(); + break; default: reader.skipType(tag & 7); break; @@ -2134,6 +2699,7 @@ export const MsgTimeoutOnClose = { message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; message.nextSequenceRecv = object.nextSequenceRecv !== undefined && object.nextSequenceRecv !== null ? BigInt(object.nextSequenceRecv.toString()) : BigInt(0); message.signer = object.signer ?? ""; + message.counterpartyUpgradeSequence = object.counterpartyUpgradeSequence !== undefined && object.counterpartyUpgradeSequence !== null ? BigInt(object.counterpartyUpgradeSequence.toString()) : BigInt(0); return message; }, fromAmino(object: MsgTimeoutOnCloseAmino): MsgTimeoutOnClose { @@ -2156,6 +2722,9 @@ export const MsgTimeoutOnClose = { if (object.signer !== undefined && object.signer !== null) { message.signer = object.signer; } + if (object.counterparty_upgrade_sequence !== undefined && object.counterparty_upgrade_sequence !== null) { + message.counterpartyUpgradeSequence = BigInt(object.counterparty_upgrade_sequence); + } return message; }, toAmino(message: MsgTimeoutOnClose): MsgTimeoutOnCloseAmino { @@ -2166,6 +2735,7 @@ export const MsgTimeoutOnClose = { obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; obj.next_sequence_recv = message.nextSequenceRecv !== BigInt(0) ? message.nextSequenceRecv.toString() : undefined; obj.signer = message.signer === "" ? undefined : message.signer; + obj.counterparty_upgrade_sequence = message.counterpartyUpgradeSequence !== BigInt(0) ? message.counterpartyUpgradeSequence.toString() : undefined; return obj; }, fromAminoMsg(object: MsgTimeoutOnCloseAminoMsg): MsgTimeoutOnClose { @@ -2444,4 +3014,1772 @@ export const MsgAcknowledgementResponse = { value: MsgAcknowledgementResponse.encode(message).finish() }; } +}; +function createBaseMsgChannelUpgradeInit(): MsgChannelUpgradeInit { + return { + portId: "", + channelId: "", + fields: UpgradeFields.fromPartial({}), + signer: "" + }; +} +export const MsgChannelUpgradeInit = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInit", + encode(message: MsgChannelUpgradeInit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.fields !== undefined) { + UpgradeFields.encode(message.fields, writer.uint32(26).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(34).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeInit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeInit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.fields = UpgradeFields.decode(reader, reader.uint32()); + break; + case 4: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgChannelUpgradeInit { + const message = createBaseMsgChannelUpgradeInit(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.fields = object.fields !== undefined && object.fields !== null ? UpgradeFields.fromPartial(object.fields) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelUpgradeInitAmino): MsgChannelUpgradeInit { + const message = createBaseMsgChannelUpgradeInit(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.fields !== undefined && object.fields !== null) { + message.fields = UpgradeFields.fromAmino(object.fields); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgChannelUpgradeInit): MsgChannelUpgradeInitAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.fields = message.fields ? UpgradeFields.toAmino(message.fields) : undefined; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeInitAminoMsg): MsgChannelUpgradeInit { + return MsgChannelUpgradeInit.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeInit): MsgChannelUpgradeInitAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeInit", + value: MsgChannelUpgradeInit.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeInitProtoMsg): MsgChannelUpgradeInit { + return MsgChannelUpgradeInit.decode(message.value); + }, + toProto(message: MsgChannelUpgradeInit): Uint8Array { + return MsgChannelUpgradeInit.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeInit): MsgChannelUpgradeInitProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInit", + value: MsgChannelUpgradeInit.encode(message).finish() + }; + } +}; +function createBaseMsgChannelUpgradeInitResponse(): MsgChannelUpgradeInitResponse { + return { + upgrade: Upgrade.fromPartial({}), + upgradeSequence: BigInt(0) + }; +} +export const MsgChannelUpgradeInitResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInitResponse", + encode(message: MsgChannelUpgradeInitResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.upgrade !== undefined) { + Upgrade.encode(message.upgrade, writer.uint32(10).fork()).ldelim(); + } + if (message.upgradeSequence !== BigInt(0)) { + writer.uint32(16).uint64(message.upgradeSequence); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeInitResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeInitResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.upgrade = Upgrade.decode(reader, reader.uint32()); + break; + case 2: + message.upgradeSequence = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgChannelUpgradeInitResponse { + const message = createBaseMsgChannelUpgradeInitResponse(); + message.upgrade = object.upgrade !== undefined && object.upgrade !== null ? Upgrade.fromPartial(object.upgrade) : undefined; + message.upgradeSequence = object.upgradeSequence !== undefined && object.upgradeSequence !== null ? BigInt(object.upgradeSequence.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgChannelUpgradeInitResponseAmino): MsgChannelUpgradeInitResponse { + const message = createBaseMsgChannelUpgradeInitResponse(); + if (object.upgrade !== undefined && object.upgrade !== null) { + message.upgrade = Upgrade.fromAmino(object.upgrade); + } + if (object.upgrade_sequence !== undefined && object.upgrade_sequence !== null) { + message.upgradeSequence = BigInt(object.upgrade_sequence); + } + return message; + }, + toAmino(message: MsgChannelUpgradeInitResponse): MsgChannelUpgradeInitResponseAmino { + const obj: any = {}; + obj.upgrade = message.upgrade ? Upgrade.toAmino(message.upgrade) : undefined; + obj.upgrade_sequence = message.upgradeSequence !== BigInt(0) ? message.upgradeSequence.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeInitResponseAminoMsg): MsgChannelUpgradeInitResponse { + return MsgChannelUpgradeInitResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeInitResponse): MsgChannelUpgradeInitResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeInitResponse", + value: MsgChannelUpgradeInitResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeInitResponseProtoMsg): MsgChannelUpgradeInitResponse { + return MsgChannelUpgradeInitResponse.decode(message.value); + }, + toProto(message: MsgChannelUpgradeInitResponse): Uint8Array { + return MsgChannelUpgradeInitResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeInitResponse): MsgChannelUpgradeInitResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeInitResponse", + value: MsgChannelUpgradeInitResponse.encode(message).finish() + }; + } +}; +function createBaseMsgChannelUpgradeTry(): MsgChannelUpgradeTry { + return { + portId: "", + channelId: "", + proposedUpgradeConnectionHops: [], + counterpartyUpgradeFields: UpgradeFields.fromPartial({}), + counterpartyUpgradeSequence: BigInt(0), + proofChannel: new Uint8Array(), + proofUpgrade: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgChannelUpgradeTry = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTry", + encode(message: MsgChannelUpgradeTry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + for (const v of message.proposedUpgradeConnectionHops) { + writer.uint32(26).string(v!); + } + if (message.counterpartyUpgradeFields !== undefined) { + UpgradeFields.encode(message.counterpartyUpgradeFields, writer.uint32(34).fork()).ldelim(); + } + if (message.counterpartyUpgradeSequence !== BigInt(0)) { + writer.uint32(40).uint64(message.counterpartyUpgradeSequence); + } + if (message.proofChannel.length !== 0) { + writer.uint32(50).bytes(message.proofChannel); + } + if (message.proofUpgrade.length !== 0) { + writer.uint32(58).bytes(message.proofUpgrade); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(66).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(74).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeTry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeTry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.proposedUpgradeConnectionHops.push(reader.string()); + break; + case 4: + message.counterpartyUpgradeFields = UpgradeFields.decode(reader, reader.uint32()); + break; + case 5: + message.counterpartyUpgradeSequence = reader.uint64(); + break; + case 6: + message.proofChannel = reader.bytes(); + break; + case 7: + message.proofUpgrade = reader.bytes(); + break; + case 8: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 9: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgChannelUpgradeTry { + const message = createBaseMsgChannelUpgradeTry(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.proposedUpgradeConnectionHops = object.proposedUpgradeConnectionHops?.map(e => e) || []; + message.counterpartyUpgradeFields = object.counterpartyUpgradeFields !== undefined && object.counterpartyUpgradeFields !== null ? UpgradeFields.fromPartial(object.counterpartyUpgradeFields) : undefined; + message.counterpartyUpgradeSequence = object.counterpartyUpgradeSequence !== undefined && object.counterpartyUpgradeSequence !== null ? BigInt(object.counterpartyUpgradeSequence.toString()) : BigInt(0); + message.proofChannel = object.proofChannel ?? new Uint8Array(); + message.proofUpgrade = object.proofUpgrade ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelUpgradeTryAmino): MsgChannelUpgradeTry { + const message = createBaseMsgChannelUpgradeTry(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + message.proposedUpgradeConnectionHops = object.proposed_upgrade_connection_hops?.map(e => e) || []; + if (object.counterparty_upgrade_fields !== undefined && object.counterparty_upgrade_fields !== null) { + message.counterpartyUpgradeFields = UpgradeFields.fromAmino(object.counterparty_upgrade_fields); + } + if (object.counterparty_upgrade_sequence !== undefined && object.counterparty_upgrade_sequence !== null) { + message.counterpartyUpgradeSequence = BigInt(object.counterparty_upgrade_sequence); + } + if (object.proof_channel !== undefined && object.proof_channel !== null) { + message.proofChannel = bytesFromBase64(object.proof_channel); + } + if (object.proof_upgrade !== undefined && object.proof_upgrade !== null) { + message.proofUpgrade = bytesFromBase64(object.proof_upgrade); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgChannelUpgradeTry): MsgChannelUpgradeTryAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + if (message.proposedUpgradeConnectionHops) { + obj.proposed_upgrade_connection_hops = message.proposedUpgradeConnectionHops.map(e => e); + } else { + obj.proposed_upgrade_connection_hops = message.proposedUpgradeConnectionHops; + } + obj.counterparty_upgrade_fields = message.counterpartyUpgradeFields ? UpgradeFields.toAmino(message.counterpartyUpgradeFields) : undefined; + obj.counterparty_upgrade_sequence = message.counterpartyUpgradeSequence !== BigInt(0) ? message.counterpartyUpgradeSequence.toString() : undefined; + obj.proof_channel = message.proofChannel ? base64FromBytes(message.proofChannel) : undefined; + obj.proof_upgrade = message.proofUpgrade ? base64FromBytes(message.proofUpgrade) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeTryAminoMsg): MsgChannelUpgradeTry { + return MsgChannelUpgradeTry.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeTry): MsgChannelUpgradeTryAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeTry", + value: MsgChannelUpgradeTry.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeTryProtoMsg): MsgChannelUpgradeTry { + return MsgChannelUpgradeTry.decode(message.value); + }, + toProto(message: MsgChannelUpgradeTry): Uint8Array { + return MsgChannelUpgradeTry.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeTry): MsgChannelUpgradeTryProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTry", + value: MsgChannelUpgradeTry.encode(message).finish() + }; + } +}; +function createBaseMsgChannelUpgradeTryResponse(): MsgChannelUpgradeTryResponse { + return { + upgrade: Upgrade.fromPartial({}), + upgradeSequence: BigInt(0), + result: 0 + }; +} +export const MsgChannelUpgradeTryResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTryResponse", + encode(message: MsgChannelUpgradeTryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.upgrade !== undefined) { + Upgrade.encode(message.upgrade, writer.uint32(10).fork()).ldelim(); + } + if (message.upgradeSequence !== BigInt(0)) { + writer.uint32(16).uint64(message.upgradeSequence); + } + if (message.result !== 0) { + writer.uint32(24).int32(message.result); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeTryResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeTryResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.upgrade = Upgrade.decode(reader, reader.uint32()); + break; + case 2: + message.upgradeSequence = reader.uint64(); + break; + case 3: + message.result = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgChannelUpgradeTryResponse { + const message = createBaseMsgChannelUpgradeTryResponse(); + message.upgrade = object.upgrade !== undefined && object.upgrade !== null ? Upgrade.fromPartial(object.upgrade) : undefined; + message.upgradeSequence = object.upgradeSequence !== undefined && object.upgradeSequence !== null ? BigInt(object.upgradeSequence.toString()) : BigInt(0); + message.result = object.result ?? 0; + return message; + }, + fromAmino(object: MsgChannelUpgradeTryResponseAmino): MsgChannelUpgradeTryResponse { + const message = createBaseMsgChannelUpgradeTryResponse(); + if (object.upgrade !== undefined && object.upgrade !== null) { + message.upgrade = Upgrade.fromAmino(object.upgrade); + } + if (object.upgrade_sequence !== undefined && object.upgrade_sequence !== null) { + message.upgradeSequence = BigInt(object.upgrade_sequence); + } + if (object.result !== undefined && object.result !== null) { + message.result = object.result; + } + return message; + }, + toAmino(message: MsgChannelUpgradeTryResponse): MsgChannelUpgradeTryResponseAmino { + const obj: any = {}; + obj.upgrade = message.upgrade ? Upgrade.toAmino(message.upgrade) : undefined; + obj.upgrade_sequence = message.upgradeSequence !== BigInt(0) ? message.upgradeSequence.toString() : undefined; + obj.result = message.result === 0 ? undefined : message.result; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeTryResponseAminoMsg): MsgChannelUpgradeTryResponse { + return MsgChannelUpgradeTryResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeTryResponse): MsgChannelUpgradeTryResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeTryResponse", + value: MsgChannelUpgradeTryResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeTryResponseProtoMsg): MsgChannelUpgradeTryResponse { + return MsgChannelUpgradeTryResponse.decode(message.value); + }, + toProto(message: MsgChannelUpgradeTryResponse): Uint8Array { + return MsgChannelUpgradeTryResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeTryResponse): MsgChannelUpgradeTryResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTryResponse", + value: MsgChannelUpgradeTryResponse.encode(message).finish() + }; + } +}; +function createBaseMsgChannelUpgradeAck(): MsgChannelUpgradeAck { + return { + portId: "", + channelId: "", + counterpartyUpgrade: Upgrade.fromPartial({}), + proofChannel: new Uint8Array(), + proofUpgrade: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgChannelUpgradeAck = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAck", + encode(message: MsgChannelUpgradeAck, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.counterpartyUpgrade !== undefined) { + Upgrade.encode(message.counterpartyUpgrade, writer.uint32(26).fork()).ldelim(); + } + if (message.proofChannel.length !== 0) { + writer.uint32(34).bytes(message.proofChannel); + } + if (message.proofUpgrade.length !== 0) { + writer.uint32(42).bytes(message.proofUpgrade); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(50).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(58).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeAck { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeAck(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.counterpartyUpgrade = Upgrade.decode(reader, reader.uint32()); + break; + case 4: + message.proofChannel = reader.bytes(); + break; + case 5: + message.proofUpgrade = reader.bytes(); + break; + case 6: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 7: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgChannelUpgradeAck { + const message = createBaseMsgChannelUpgradeAck(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.counterpartyUpgrade = object.counterpartyUpgrade !== undefined && object.counterpartyUpgrade !== null ? Upgrade.fromPartial(object.counterpartyUpgrade) : undefined; + message.proofChannel = object.proofChannel ?? new Uint8Array(); + message.proofUpgrade = object.proofUpgrade ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelUpgradeAckAmino): MsgChannelUpgradeAck { + const message = createBaseMsgChannelUpgradeAck(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.counterparty_upgrade !== undefined && object.counterparty_upgrade !== null) { + message.counterpartyUpgrade = Upgrade.fromAmino(object.counterparty_upgrade); + } + if (object.proof_channel !== undefined && object.proof_channel !== null) { + message.proofChannel = bytesFromBase64(object.proof_channel); + } + if (object.proof_upgrade !== undefined && object.proof_upgrade !== null) { + message.proofUpgrade = bytesFromBase64(object.proof_upgrade); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgChannelUpgradeAck): MsgChannelUpgradeAckAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.counterparty_upgrade = message.counterpartyUpgrade ? Upgrade.toAmino(message.counterpartyUpgrade) : undefined; + obj.proof_channel = message.proofChannel ? base64FromBytes(message.proofChannel) : undefined; + obj.proof_upgrade = message.proofUpgrade ? base64FromBytes(message.proofUpgrade) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeAckAminoMsg): MsgChannelUpgradeAck { + return MsgChannelUpgradeAck.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeAck): MsgChannelUpgradeAckAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeAck", + value: MsgChannelUpgradeAck.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeAckProtoMsg): MsgChannelUpgradeAck { + return MsgChannelUpgradeAck.decode(message.value); + }, + toProto(message: MsgChannelUpgradeAck): Uint8Array { + return MsgChannelUpgradeAck.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeAck): MsgChannelUpgradeAckProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAck", + value: MsgChannelUpgradeAck.encode(message).finish() + }; + } +}; +function createBaseMsgChannelUpgradeAckResponse(): MsgChannelUpgradeAckResponse { + return { + result: 0 + }; +} +export const MsgChannelUpgradeAckResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAckResponse", + encode(message: MsgChannelUpgradeAckResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.result !== 0) { + writer.uint32(8).int32(message.result); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeAckResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeAckResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.result = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgChannelUpgradeAckResponse { + const message = createBaseMsgChannelUpgradeAckResponse(); + message.result = object.result ?? 0; + return message; + }, + fromAmino(object: MsgChannelUpgradeAckResponseAmino): MsgChannelUpgradeAckResponse { + const message = createBaseMsgChannelUpgradeAckResponse(); + if (object.result !== undefined && object.result !== null) { + message.result = object.result; + } + return message; + }, + toAmino(message: MsgChannelUpgradeAckResponse): MsgChannelUpgradeAckResponseAmino { + const obj: any = {}; + obj.result = message.result === 0 ? undefined : message.result; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeAckResponseAminoMsg): MsgChannelUpgradeAckResponse { + return MsgChannelUpgradeAckResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeAckResponse): MsgChannelUpgradeAckResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeAckResponse", + value: MsgChannelUpgradeAckResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeAckResponseProtoMsg): MsgChannelUpgradeAckResponse { + return MsgChannelUpgradeAckResponse.decode(message.value); + }, + toProto(message: MsgChannelUpgradeAckResponse): Uint8Array { + return MsgChannelUpgradeAckResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeAckResponse): MsgChannelUpgradeAckResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeAckResponse", + value: MsgChannelUpgradeAckResponse.encode(message).finish() + }; + } +}; +function createBaseMsgChannelUpgradeConfirm(): MsgChannelUpgradeConfirm { + return { + portId: "", + channelId: "", + counterpartyChannelState: 0, + counterpartyUpgrade: Upgrade.fromPartial({}), + proofChannel: new Uint8Array(), + proofUpgrade: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgChannelUpgradeConfirm = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirm", + encode(message: MsgChannelUpgradeConfirm, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.counterpartyChannelState !== 0) { + writer.uint32(24).int32(message.counterpartyChannelState); + } + if (message.counterpartyUpgrade !== undefined) { + Upgrade.encode(message.counterpartyUpgrade, writer.uint32(34).fork()).ldelim(); + } + if (message.proofChannel.length !== 0) { + writer.uint32(42).bytes(message.proofChannel); + } + if (message.proofUpgrade.length !== 0) { + writer.uint32(50).bytes(message.proofUpgrade); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(58).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(66).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeConfirm { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeConfirm(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.counterpartyChannelState = (reader.int32() as any); + break; + case 4: + message.counterpartyUpgrade = Upgrade.decode(reader, reader.uint32()); + break; + case 5: + message.proofChannel = reader.bytes(); + break; + case 6: + message.proofUpgrade = reader.bytes(); + break; + case 7: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 8: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgChannelUpgradeConfirm { + const message = createBaseMsgChannelUpgradeConfirm(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.counterpartyChannelState = object.counterpartyChannelState ?? 0; + message.counterpartyUpgrade = object.counterpartyUpgrade !== undefined && object.counterpartyUpgrade !== null ? Upgrade.fromPartial(object.counterpartyUpgrade) : undefined; + message.proofChannel = object.proofChannel ?? new Uint8Array(); + message.proofUpgrade = object.proofUpgrade ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelUpgradeConfirmAmino): MsgChannelUpgradeConfirm { + const message = createBaseMsgChannelUpgradeConfirm(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.counterparty_channel_state !== undefined && object.counterparty_channel_state !== null) { + message.counterpartyChannelState = object.counterparty_channel_state; + } + if (object.counterparty_upgrade !== undefined && object.counterparty_upgrade !== null) { + message.counterpartyUpgrade = Upgrade.fromAmino(object.counterparty_upgrade); + } + if (object.proof_channel !== undefined && object.proof_channel !== null) { + message.proofChannel = bytesFromBase64(object.proof_channel); + } + if (object.proof_upgrade !== undefined && object.proof_upgrade !== null) { + message.proofUpgrade = bytesFromBase64(object.proof_upgrade); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgChannelUpgradeConfirm): MsgChannelUpgradeConfirmAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.counterparty_channel_state = message.counterpartyChannelState === 0 ? undefined : message.counterpartyChannelState; + obj.counterparty_upgrade = message.counterpartyUpgrade ? Upgrade.toAmino(message.counterpartyUpgrade) : undefined; + obj.proof_channel = message.proofChannel ? base64FromBytes(message.proofChannel) : undefined; + obj.proof_upgrade = message.proofUpgrade ? base64FromBytes(message.proofUpgrade) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeConfirmAminoMsg): MsgChannelUpgradeConfirm { + return MsgChannelUpgradeConfirm.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeConfirm): MsgChannelUpgradeConfirmAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeConfirm", + value: MsgChannelUpgradeConfirm.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeConfirmProtoMsg): MsgChannelUpgradeConfirm { + return MsgChannelUpgradeConfirm.decode(message.value); + }, + toProto(message: MsgChannelUpgradeConfirm): Uint8Array { + return MsgChannelUpgradeConfirm.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeConfirm): MsgChannelUpgradeConfirmProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirm", + value: MsgChannelUpgradeConfirm.encode(message).finish() + }; + } +}; +function createBaseMsgChannelUpgradeConfirmResponse(): MsgChannelUpgradeConfirmResponse { + return { + result: 0 + }; +} +export const MsgChannelUpgradeConfirmResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirmResponse", + encode(message: MsgChannelUpgradeConfirmResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.result !== 0) { + writer.uint32(8).int32(message.result); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeConfirmResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeConfirmResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.result = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgChannelUpgradeConfirmResponse { + const message = createBaseMsgChannelUpgradeConfirmResponse(); + message.result = object.result ?? 0; + return message; + }, + fromAmino(object: MsgChannelUpgradeConfirmResponseAmino): MsgChannelUpgradeConfirmResponse { + const message = createBaseMsgChannelUpgradeConfirmResponse(); + if (object.result !== undefined && object.result !== null) { + message.result = object.result; + } + return message; + }, + toAmino(message: MsgChannelUpgradeConfirmResponse): MsgChannelUpgradeConfirmResponseAmino { + const obj: any = {}; + obj.result = message.result === 0 ? undefined : message.result; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeConfirmResponseAminoMsg): MsgChannelUpgradeConfirmResponse { + return MsgChannelUpgradeConfirmResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeConfirmResponse): MsgChannelUpgradeConfirmResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeConfirmResponse", + value: MsgChannelUpgradeConfirmResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeConfirmResponseProtoMsg): MsgChannelUpgradeConfirmResponse { + return MsgChannelUpgradeConfirmResponse.decode(message.value); + }, + toProto(message: MsgChannelUpgradeConfirmResponse): Uint8Array { + return MsgChannelUpgradeConfirmResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeConfirmResponse): MsgChannelUpgradeConfirmResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeConfirmResponse", + value: MsgChannelUpgradeConfirmResponse.encode(message).finish() + }; + } +}; +function createBaseMsgChannelUpgradeOpen(): MsgChannelUpgradeOpen { + return { + portId: "", + channelId: "", + counterpartyChannelState: 0, + counterpartyUpgradeSequence: BigInt(0), + proofChannel: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgChannelUpgradeOpen = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpen", + encode(message: MsgChannelUpgradeOpen, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.counterpartyChannelState !== 0) { + writer.uint32(24).int32(message.counterpartyChannelState); + } + if (message.counterpartyUpgradeSequence !== BigInt(0)) { + writer.uint32(32).uint64(message.counterpartyUpgradeSequence); + } + if (message.proofChannel.length !== 0) { + writer.uint32(42).bytes(message.proofChannel); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(50).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(58).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeOpen { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeOpen(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.counterpartyChannelState = (reader.int32() as any); + break; + case 4: + message.counterpartyUpgradeSequence = reader.uint64(); + break; + case 5: + message.proofChannel = reader.bytes(); + break; + case 6: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 7: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgChannelUpgradeOpen { + const message = createBaseMsgChannelUpgradeOpen(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.counterpartyChannelState = object.counterpartyChannelState ?? 0; + message.counterpartyUpgradeSequence = object.counterpartyUpgradeSequence !== undefined && object.counterpartyUpgradeSequence !== null ? BigInt(object.counterpartyUpgradeSequence.toString()) : BigInt(0); + message.proofChannel = object.proofChannel ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelUpgradeOpenAmino): MsgChannelUpgradeOpen { + const message = createBaseMsgChannelUpgradeOpen(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.counterparty_channel_state !== undefined && object.counterparty_channel_state !== null) { + message.counterpartyChannelState = object.counterparty_channel_state; + } + if (object.counterparty_upgrade_sequence !== undefined && object.counterparty_upgrade_sequence !== null) { + message.counterpartyUpgradeSequence = BigInt(object.counterparty_upgrade_sequence); + } + if (object.proof_channel !== undefined && object.proof_channel !== null) { + message.proofChannel = bytesFromBase64(object.proof_channel); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgChannelUpgradeOpen): MsgChannelUpgradeOpenAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.counterparty_channel_state = message.counterpartyChannelState === 0 ? undefined : message.counterpartyChannelState; + obj.counterparty_upgrade_sequence = message.counterpartyUpgradeSequence !== BigInt(0) ? message.counterpartyUpgradeSequence.toString() : undefined; + obj.proof_channel = message.proofChannel ? base64FromBytes(message.proofChannel) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeOpenAminoMsg): MsgChannelUpgradeOpen { + return MsgChannelUpgradeOpen.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeOpen): MsgChannelUpgradeOpenAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeOpen", + value: MsgChannelUpgradeOpen.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeOpenProtoMsg): MsgChannelUpgradeOpen { + return MsgChannelUpgradeOpen.decode(message.value); + }, + toProto(message: MsgChannelUpgradeOpen): Uint8Array { + return MsgChannelUpgradeOpen.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeOpen): MsgChannelUpgradeOpenProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpen", + value: MsgChannelUpgradeOpen.encode(message).finish() + }; + } +}; +function createBaseMsgChannelUpgradeOpenResponse(): MsgChannelUpgradeOpenResponse { + return {}; +} +export const MsgChannelUpgradeOpenResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpenResponse", + encode(_: MsgChannelUpgradeOpenResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeOpenResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeOpenResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgChannelUpgradeOpenResponse { + const message = createBaseMsgChannelUpgradeOpenResponse(); + return message; + }, + fromAmino(_: MsgChannelUpgradeOpenResponseAmino): MsgChannelUpgradeOpenResponse { + const message = createBaseMsgChannelUpgradeOpenResponse(); + return message; + }, + toAmino(_: MsgChannelUpgradeOpenResponse): MsgChannelUpgradeOpenResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeOpenResponseAminoMsg): MsgChannelUpgradeOpenResponse { + return MsgChannelUpgradeOpenResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeOpenResponse): MsgChannelUpgradeOpenResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeOpenResponse", + value: MsgChannelUpgradeOpenResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeOpenResponseProtoMsg): MsgChannelUpgradeOpenResponse { + return MsgChannelUpgradeOpenResponse.decode(message.value); + }, + toProto(message: MsgChannelUpgradeOpenResponse): Uint8Array { + return MsgChannelUpgradeOpenResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeOpenResponse): MsgChannelUpgradeOpenResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeOpenResponse", + value: MsgChannelUpgradeOpenResponse.encode(message).finish() + }; + } +}; +function createBaseMsgChannelUpgradeTimeout(): MsgChannelUpgradeTimeout { + return { + portId: "", + channelId: "", + counterpartyChannel: Channel.fromPartial({}), + proofChannel: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgChannelUpgradeTimeout = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeout", + encode(message: MsgChannelUpgradeTimeout, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.counterpartyChannel !== undefined) { + Channel.encode(message.counterpartyChannel, writer.uint32(26).fork()).ldelim(); + } + if (message.proofChannel.length !== 0) { + writer.uint32(34).bytes(message.proofChannel); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(42).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(50).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeTimeout { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeTimeout(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.counterpartyChannel = Channel.decode(reader, reader.uint32()); + break; + case 4: + message.proofChannel = reader.bytes(); + break; + case 5: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 6: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgChannelUpgradeTimeout { + const message = createBaseMsgChannelUpgradeTimeout(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.counterpartyChannel = object.counterpartyChannel !== undefined && object.counterpartyChannel !== null ? Channel.fromPartial(object.counterpartyChannel) : undefined; + message.proofChannel = object.proofChannel ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelUpgradeTimeoutAmino): MsgChannelUpgradeTimeout { + const message = createBaseMsgChannelUpgradeTimeout(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.counterparty_channel !== undefined && object.counterparty_channel !== null) { + message.counterpartyChannel = Channel.fromAmino(object.counterparty_channel); + } + if (object.proof_channel !== undefined && object.proof_channel !== null) { + message.proofChannel = bytesFromBase64(object.proof_channel); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgChannelUpgradeTimeout): MsgChannelUpgradeTimeoutAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.counterparty_channel = message.counterpartyChannel ? Channel.toAmino(message.counterpartyChannel) : undefined; + obj.proof_channel = message.proofChannel ? base64FromBytes(message.proofChannel) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeTimeoutAminoMsg): MsgChannelUpgradeTimeout { + return MsgChannelUpgradeTimeout.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeTimeout): MsgChannelUpgradeTimeoutAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeTimeout", + value: MsgChannelUpgradeTimeout.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeTimeoutProtoMsg): MsgChannelUpgradeTimeout { + return MsgChannelUpgradeTimeout.decode(message.value); + }, + toProto(message: MsgChannelUpgradeTimeout): Uint8Array { + return MsgChannelUpgradeTimeout.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeTimeout): MsgChannelUpgradeTimeoutProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeout", + value: MsgChannelUpgradeTimeout.encode(message).finish() + }; + } +}; +function createBaseMsgChannelUpgradeTimeoutResponse(): MsgChannelUpgradeTimeoutResponse { + return {}; +} +export const MsgChannelUpgradeTimeoutResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeoutResponse", + encode(_: MsgChannelUpgradeTimeoutResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeTimeoutResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeTimeoutResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgChannelUpgradeTimeoutResponse { + const message = createBaseMsgChannelUpgradeTimeoutResponse(); + return message; + }, + fromAmino(_: MsgChannelUpgradeTimeoutResponseAmino): MsgChannelUpgradeTimeoutResponse { + const message = createBaseMsgChannelUpgradeTimeoutResponse(); + return message; + }, + toAmino(_: MsgChannelUpgradeTimeoutResponse): MsgChannelUpgradeTimeoutResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeTimeoutResponseAminoMsg): MsgChannelUpgradeTimeoutResponse { + return MsgChannelUpgradeTimeoutResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeTimeoutResponse): MsgChannelUpgradeTimeoutResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeTimeoutResponse", + value: MsgChannelUpgradeTimeoutResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeTimeoutResponseProtoMsg): MsgChannelUpgradeTimeoutResponse { + return MsgChannelUpgradeTimeoutResponse.decode(message.value); + }, + toProto(message: MsgChannelUpgradeTimeoutResponse): Uint8Array { + return MsgChannelUpgradeTimeoutResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeTimeoutResponse): MsgChannelUpgradeTimeoutResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeTimeoutResponse", + value: MsgChannelUpgradeTimeoutResponse.encode(message).finish() + }; + } +}; +function createBaseMsgChannelUpgradeCancel(): MsgChannelUpgradeCancel { + return { + portId: "", + channelId: "", + errorReceipt: ErrorReceipt.fromPartial({}), + proofErrorReceipt: new Uint8Array(), + proofHeight: Height.fromPartial({}), + signer: "" + }; +} +export const MsgChannelUpgradeCancel = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancel", + encode(message: MsgChannelUpgradeCancel, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.errorReceipt !== undefined) { + ErrorReceipt.encode(message.errorReceipt, writer.uint32(26).fork()).ldelim(); + } + if (message.proofErrorReceipt.length !== 0) { + writer.uint32(34).bytes(message.proofErrorReceipt); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(42).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(50).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeCancel { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeCancel(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.errorReceipt = ErrorReceipt.decode(reader, reader.uint32()); + break; + case 4: + message.proofErrorReceipt = reader.bytes(); + break; + case 5: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 6: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgChannelUpgradeCancel { + const message = createBaseMsgChannelUpgradeCancel(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.errorReceipt = object.errorReceipt !== undefined && object.errorReceipt !== null ? ErrorReceipt.fromPartial(object.errorReceipt) : undefined; + message.proofErrorReceipt = object.proofErrorReceipt ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgChannelUpgradeCancelAmino): MsgChannelUpgradeCancel { + const message = createBaseMsgChannelUpgradeCancel(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.error_receipt !== undefined && object.error_receipt !== null) { + message.errorReceipt = ErrorReceipt.fromAmino(object.error_receipt); + } + if (object.proof_error_receipt !== undefined && object.proof_error_receipt !== null) { + message.proofErrorReceipt = bytesFromBase64(object.proof_error_receipt); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgChannelUpgradeCancel): MsgChannelUpgradeCancelAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.error_receipt = message.errorReceipt ? ErrorReceipt.toAmino(message.errorReceipt) : undefined; + obj.proof_error_receipt = message.proofErrorReceipt ? base64FromBytes(message.proofErrorReceipt) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeCancelAminoMsg): MsgChannelUpgradeCancel { + return MsgChannelUpgradeCancel.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeCancel): MsgChannelUpgradeCancelAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeCancel", + value: MsgChannelUpgradeCancel.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeCancelProtoMsg): MsgChannelUpgradeCancel { + return MsgChannelUpgradeCancel.decode(message.value); + }, + toProto(message: MsgChannelUpgradeCancel): Uint8Array { + return MsgChannelUpgradeCancel.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeCancel): MsgChannelUpgradeCancelProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancel", + value: MsgChannelUpgradeCancel.encode(message).finish() + }; + } +}; +function createBaseMsgChannelUpgradeCancelResponse(): MsgChannelUpgradeCancelResponse { + return {}; +} +export const MsgChannelUpgradeCancelResponse = { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancelResponse", + encode(_: MsgChannelUpgradeCancelResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgChannelUpgradeCancelResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChannelUpgradeCancelResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgChannelUpgradeCancelResponse { + const message = createBaseMsgChannelUpgradeCancelResponse(); + return message; + }, + fromAmino(_: MsgChannelUpgradeCancelResponseAmino): MsgChannelUpgradeCancelResponse { + const message = createBaseMsgChannelUpgradeCancelResponse(); + return message; + }, + toAmino(_: MsgChannelUpgradeCancelResponse): MsgChannelUpgradeCancelResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgChannelUpgradeCancelResponseAminoMsg): MsgChannelUpgradeCancelResponse { + return MsgChannelUpgradeCancelResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgChannelUpgradeCancelResponse): MsgChannelUpgradeCancelResponseAminoMsg { + return { + type: "cosmos-sdk/MsgChannelUpgradeCancelResponse", + value: MsgChannelUpgradeCancelResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgChannelUpgradeCancelResponseProtoMsg): MsgChannelUpgradeCancelResponse { + return MsgChannelUpgradeCancelResponse.decode(message.value); + }, + toProto(message: MsgChannelUpgradeCancelResponse): Uint8Array { + return MsgChannelUpgradeCancelResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgChannelUpgradeCancelResponse): MsgChannelUpgradeCancelResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgChannelUpgradeCancelResponse", + value: MsgChannelUpgradeCancelResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + authority: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/ibc.core.channel.v1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.authority !== "") { + writer.uint32(10).string(message.authority); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.authority = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.authority = object.authority ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.authority !== undefined && object.authority !== null) { + message.authority = object.authority; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.authority = message.authority === "" ? undefined : message.authority; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/ibc.core.channel.v1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } +}; +function createBaseMsgPruneAcknowledgements(): MsgPruneAcknowledgements { + return { + portId: "", + channelId: "", + limit: BigInt(0), + signer: "" + }; +} +export const MsgPruneAcknowledgements = { + typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgements", + encode(message: MsgPruneAcknowledgements, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.portId !== "") { + writer.uint32(10).string(message.portId); + } + if (message.channelId !== "") { + writer.uint32(18).string(message.channelId); + } + if (message.limit !== BigInt(0)) { + writer.uint32(24).uint64(message.limit); + } + if (message.signer !== "") { + writer.uint32(34).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgPruneAcknowledgements { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPruneAcknowledgements(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.portId = reader.string(); + break; + case 2: + message.channelId = reader.string(); + break; + case 3: + message.limit = reader.uint64(); + break; + case 4: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgPruneAcknowledgements { + const message = createBaseMsgPruneAcknowledgements(); + message.portId = object.portId ?? ""; + message.channelId = object.channelId ?? ""; + message.limit = object.limit !== undefined && object.limit !== null ? BigInt(object.limit.toString()) : BigInt(0); + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgPruneAcknowledgementsAmino): MsgPruneAcknowledgements { + const message = createBaseMsgPruneAcknowledgements(); + if (object.port_id !== undefined && object.port_id !== null) { + message.portId = object.port_id; + } + if (object.channel_id !== undefined && object.channel_id !== null) { + message.channelId = object.channel_id; + } + if (object.limit !== undefined && object.limit !== null) { + message.limit = BigInt(object.limit); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgPruneAcknowledgements): MsgPruneAcknowledgementsAmino { + const obj: any = {}; + obj.port_id = message.portId === "" ? undefined : message.portId; + obj.channel_id = message.channelId === "" ? undefined : message.channelId; + obj.limit = message.limit !== BigInt(0) ? message.limit.toString() : undefined; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgPruneAcknowledgementsAminoMsg): MsgPruneAcknowledgements { + return MsgPruneAcknowledgements.fromAmino(object.value); + }, + toAminoMsg(message: MsgPruneAcknowledgements): MsgPruneAcknowledgementsAminoMsg { + return { + type: "cosmos-sdk/MsgPruneAcknowledgements", + value: MsgPruneAcknowledgements.toAmino(message) + }; + }, + fromProtoMsg(message: MsgPruneAcknowledgementsProtoMsg): MsgPruneAcknowledgements { + return MsgPruneAcknowledgements.decode(message.value); + }, + toProto(message: MsgPruneAcknowledgements): Uint8Array { + return MsgPruneAcknowledgements.encode(message).finish(); + }, + toProtoMsg(message: MsgPruneAcknowledgements): MsgPruneAcknowledgementsProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgements", + value: MsgPruneAcknowledgements.encode(message).finish() + }; + } +}; +function createBaseMsgPruneAcknowledgementsResponse(): MsgPruneAcknowledgementsResponse { + return { + totalPrunedSequences: BigInt(0), + totalRemainingSequences: BigInt(0) + }; +} +export const MsgPruneAcknowledgementsResponse = { + typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgementsResponse", + encode(message: MsgPruneAcknowledgementsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.totalPrunedSequences !== BigInt(0)) { + writer.uint32(8).uint64(message.totalPrunedSequences); + } + if (message.totalRemainingSequences !== BigInt(0)) { + writer.uint32(16).uint64(message.totalRemainingSequences); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgPruneAcknowledgementsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgPruneAcknowledgementsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.totalPrunedSequences = reader.uint64(); + break; + case 2: + message.totalRemainingSequences = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgPruneAcknowledgementsResponse { + const message = createBaseMsgPruneAcknowledgementsResponse(); + message.totalPrunedSequences = object.totalPrunedSequences !== undefined && object.totalPrunedSequences !== null ? BigInt(object.totalPrunedSequences.toString()) : BigInt(0); + message.totalRemainingSequences = object.totalRemainingSequences !== undefined && object.totalRemainingSequences !== null ? BigInt(object.totalRemainingSequences.toString()) : BigInt(0); + return message; + }, + fromAmino(object: MsgPruneAcknowledgementsResponseAmino): MsgPruneAcknowledgementsResponse { + const message = createBaseMsgPruneAcknowledgementsResponse(); + if (object.total_pruned_sequences !== undefined && object.total_pruned_sequences !== null) { + message.totalPrunedSequences = BigInt(object.total_pruned_sequences); + } + if (object.total_remaining_sequences !== undefined && object.total_remaining_sequences !== null) { + message.totalRemainingSequences = BigInt(object.total_remaining_sequences); + } + return message; + }, + toAmino(message: MsgPruneAcknowledgementsResponse): MsgPruneAcknowledgementsResponseAmino { + const obj: any = {}; + obj.total_pruned_sequences = message.totalPrunedSequences !== BigInt(0) ? message.totalPrunedSequences.toString() : undefined; + obj.total_remaining_sequences = message.totalRemainingSequences !== BigInt(0) ? message.totalRemainingSequences.toString() : undefined; + return obj; + }, + fromAminoMsg(object: MsgPruneAcknowledgementsResponseAminoMsg): MsgPruneAcknowledgementsResponse { + return MsgPruneAcknowledgementsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgPruneAcknowledgementsResponse): MsgPruneAcknowledgementsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgPruneAcknowledgementsResponse", + value: MsgPruneAcknowledgementsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgPruneAcknowledgementsResponseProtoMsg): MsgPruneAcknowledgementsResponse { + return MsgPruneAcknowledgementsResponse.decode(message.value); + }, + toProto(message: MsgPruneAcknowledgementsResponse): Uint8Array { + return MsgPruneAcknowledgementsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgPruneAcknowledgementsResponse): MsgPruneAcknowledgementsResponseProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.MsgPruneAcknowledgementsResponse", + value: MsgPruneAcknowledgementsResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/src/codegen/ibc/core/channel/v1/upgrade.ts b/src/codegen/ibc/core/channel/v1/upgrade.ts new file mode 100644 index 0000000..1ae108a --- /dev/null +++ b/src/codegen/ibc/core/channel/v1/upgrade.ts @@ -0,0 +1,389 @@ +import { Timeout, TimeoutAmino, TimeoutSDKType, Order } from "./channel"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +/** + * Upgrade is a verifiable type which contains the relevant information + * for an attempted upgrade. It provides the proposed changes to the channel + * end, the timeout for this upgrade attempt and the next packet sequence + * which allows the counterparty to efficiently know the highest sequence it has received. + * The next sequence send is used for pruning and upgrading from unordered to ordered channels. + */ +export interface Upgrade { + fields: UpgradeFields; + timeout: Timeout; + nextSequenceSend: bigint; +} +export interface UpgradeProtoMsg { + typeUrl: "/ibc.core.channel.v1.Upgrade"; + value: Uint8Array; +} +/** + * Upgrade is a verifiable type which contains the relevant information + * for an attempted upgrade. It provides the proposed changes to the channel + * end, the timeout for this upgrade attempt and the next packet sequence + * which allows the counterparty to efficiently know the highest sequence it has received. + * The next sequence send is used for pruning and upgrading from unordered to ordered channels. + */ +export interface UpgradeAmino { + fields?: UpgradeFieldsAmino; + timeout?: TimeoutAmino; + next_sequence_send?: string; +} +export interface UpgradeAminoMsg { + type: "cosmos-sdk/Upgrade"; + value: UpgradeAmino; +} +/** + * Upgrade is a verifiable type which contains the relevant information + * for an attempted upgrade. It provides the proposed changes to the channel + * end, the timeout for this upgrade attempt and the next packet sequence + * which allows the counterparty to efficiently know the highest sequence it has received. + * The next sequence send is used for pruning and upgrading from unordered to ordered channels. + */ +export interface UpgradeSDKType { + fields: UpgradeFieldsSDKType; + timeout: TimeoutSDKType; + next_sequence_send: bigint; +} +/** + * UpgradeFields are the fields in a channel end which may be changed + * during a channel upgrade. + */ +export interface UpgradeFields { + ordering: Order; + connectionHops: string[]; + version: string; +} +export interface UpgradeFieldsProtoMsg { + typeUrl: "/ibc.core.channel.v1.UpgradeFields"; + value: Uint8Array; +} +/** + * UpgradeFields are the fields in a channel end which may be changed + * during a channel upgrade. + */ +export interface UpgradeFieldsAmino { + ordering?: Order; + connection_hops?: string[]; + version?: string; +} +export interface UpgradeFieldsAminoMsg { + type: "cosmos-sdk/UpgradeFields"; + value: UpgradeFieldsAmino; +} +/** + * UpgradeFields are the fields in a channel end which may be changed + * during a channel upgrade. + */ +export interface UpgradeFieldsSDKType { + ordering: Order; + connection_hops: string[]; + version: string; +} +/** + * ErrorReceipt defines a type which encapsulates the upgrade sequence and error associated with the + * upgrade handshake failure. When a channel upgrade handshake is aborted both chains are expected to increment to the + * next sequence. + */ +export interface ErrorReceipt { + /** the channel upgrade sequence */ + sequence: bigint; + /** the error message detailing the cause of failure */ + message: string; +} +export interface ErrorReceiptProtoMsg { + typeUrl: "/ibc.core.channel.v1.ErrorReceipt"; + value: Uint8Array; +} +/** + * ErrorReceipt defines a type which encapsulates the upgrade sequence and error associated with the + * upgrade handshake failure. When a channel upgrade handshake is aborted both chains are expected to increment to the + * next sequence. + */ +export interface ErrorReceiptAmino { + /** the channel upgrade sequence */ + sequence?: string; + /** the error message detailing the cause of failure */ + message?: string; +} +export interface ErrorReceiptAminoMsg { + type: "cosmos-sdk/ErrorReceipt"; + value: ErrorReceiptAmino; +} +/** + * ErrorReceipt defines a type which encapsulates the upgrade sequence and error associated with the + * upgrade handshake failure. When a channel upgrade handshake is aborted both chains are expected to increment to the + * next sequence. + */ +export interface ErrorReceiptSDKType { + sequence: bigint; + message: string; +} +function createBaseUpgrade(): Upgrade { + return { + fields: UpgradeFields.fromPartial({}), + timeout: Timeout.fromPartial({}), + nextSequenceSend: BigInt(0) + }; +} +export const Upgrade = { + typeUrl: "/ibc.core.channel.v1.Upgrade", + encode(message: Upgrade, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.fields !== undefined) { + UpgradeFields.encode(message.fields, writer.uint32(10).fork()).ldelim(); + } + if (message.timeout !== undefined) { + Timeout.encode(message.timeout, writer.uint32(18).fork()).ldelim(); + } + if (message.nextSequenceSend !== BigInt(0)) { + writer.uint32(24).uint64(message.nextSequenceSend); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Upgrade { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpgrade(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fields = UpgradeFields.decode(reader, reader.uint32()); + break; + case 2: + message.timeout = Timeout.decode(reader, reader.uint32()); + break; + case 3: + message.nextSequenceSend = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Upgrade { + const message = createBaseUpgrade(); + message.fields = object.fields !== undefined && object.fields !== null ? UpgradeFields.fromPartial(object.fields) : undefined; + message.timeout = object.timeout !== undefined && object.timeout !== null ? Timeout.fromPartial(object.timeout) : undefined; + message.nextSequenceSend = object.nextSequenceSend !== undefined && object.nextSequenceSend !== null ? BigInt(object.nextSequenceSend.toString()) : BigInt(0); + return message; + }, + fromAmino(object: UpgradeAmino): Upgrade { + const message = createBaseUpgrade(); + if (object.fields !== undefined && object.fields !== null) { + message.fields = UpgradeFields.fromAmino(object.fields); + } + if (object.timeout !== undefined && object.timeout !== null) { + message.timeout = Timeout.fromAmino(object.timeout); + } + if (object.next_sequence_send !== undefined && object.next_sequence_send !== null) { + message.nextSequenceSend = BigInt(object.next_sequence_send); + } + return message; + }, + toAmino(message: Upgrade): UpgradeAmino { + const obj: any = {}; + obj.fields = message.fields ? UpgradeFields.toAmino(message.fields) : undefined; + obj.timeout = message.timeout ? Timeout.toAmino(message.timeout) : undefined; + obj.next_sequence_send = message.nextSequenceSend !== BigInt(0) ? message.nextSequenceSend.toString() : undefined; + return obj; + }, + fromAminoMsg(object: UpgradeAminoMsg): Upgrade { + return Upgrade.fromAmino(object.value); + }, + toAminoMsg(message: Upgrade): UpgradeAminoMsg { + return { + type: "cosmos-sdk/Upgrade", + value: Upgrade.toAmino(message) + }; + }, + fromProtoMsg(message: UpgradeProtoMsg): Upgrade { + return Upgrade.decode(message.value); + }, + toProto(message: Upgrade): Uint8Array { + return Upgrade.encode(message).finish(); + }, + toProtoMsg(message: Upgrade): UpgradeProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.Upgrade", + value: Upgrade.encode(message).finish() + }; + } +}; +function createBaseUpgradeFields(): UpgradeFields { + return { + ordering: 0, + connectionHops: [], + version: "" + }; +} +export const UpgradeFields = { + typeUrl: "/ibc.core.channel.v1.UpgradeFields", + encode(message: UpgradeFields, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.ordering !== 0) { + writer.uint32(8).int32(message.ordering); + } + for (const v of message.connectionHops) { + writer.uint32(18).string(v!); + } + if (message.version !== "") { + writer.uint32(26).string(message.version); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): UpgradeFields { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpgradeFields(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ordering = (reader.int32() as any); + break; + case 2: + message.connectionHops.push(reader.string()); + break; + case 3: + message.version = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): UpgradeFields { + const message = createBaseUpgradeFields(); + message.ordering = object.ordering ?? 0; + message.connectionHops = object.connectionHops?.map(e => e) || []; + message.version = object.version ?? ""; + return message; + }, + fromAmino(object: UpgradeFieldsAmino): UpgradeFields { + const message = createBaseUpgradeFields(); + if (object.ordering !== undefined && object.ordering !== null) { + message.ordering = object.ordering; + } + message.connectionHops = object.connection_hops?.map(e => e) || []; + if (object.version !== undefined && object.version !== null) { + message.version = object.version; + } + return message; + }, + toAmino(message: UpgradeFields): UpgradeFieldsAmino { + const obj: any = {}; + obj.ordering = message.ordering === 0 ? undefined : message.ordering; + if (message.connectionHops) { + obj.connection_hops = message.connectionHops.map(e => e); + } else { + obj.connection_hops = message.connectionHops; + } + obj.version = message.version === "" ? undefined : message.version; + return obj; + }, + fromAminoMsg(object: UpgradeFieldsAminoMsg): UpgradeFields { + return UpgradeFields.fromAmino(object.value); + }, + toAminoMsg(message: UpgradeFields): UpgradeFieldsAminoMsg { + return { + type: "cosmos-sdk/UpgradeFields", + value: UpgradeFields.toAmino(message) + }; + }, + fromProtoMsg(message: UpgradeFieldsProtoMsg): UpgradeFields { + return UpgradeFields.decode(message.value); + }, + toProto(message: UpgradeFields): Uint8Array { + return UpgradeFields.encode(message).finish(); + }, + toProtoMsg(message: UpgradeFields): UpgradeFieldsProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.UpgradeFields", + value: UpgradeFields.encode(message).finish() + }; + } +}; +function createBaseErrorReceipt(): ErrorReceipt { + return { + sequence: BigInt(0), + message: "" + }; +} +export const ErrorReceipt = { + typeUrl: "/ibc.core.channel.v1.ErrorReceipt", + encode(message: ErrorReceipt, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sequence !== BigInt(0)) { + writer.uint32(8).uint64(message.sequence); + } + if (message.message !== "") { + writer.uint32(18).string(message.message); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ErrorReceipt { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseErrorReceipt(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequence = reader.uint64(); + break; + case 2: + message.message = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ErrorReceipt { + const message = createBaseErrorReceipt(); + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + message.message = object.message ?? ""; + return message; + }, + fromAmino(object: ErrorReceiptAmino): ErrorReceipt { + const message = createBaseErrorReceipt(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.message !== undefined && object.message !== null) { + message.message = object.message; + } + return message; + }, + toAmino(message: ErrorReceipt): ErrorReceiptAmino { + const obj: any = {}; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; + obj.message = message.message === "" ? undefined : message.message; + return obj; + }, + fromAminoMsg(object: ErrorReceiptAminoMsg): ErrorReceipt { + return ErrorReceipt.fromAmino(object.value); + }, + toAminoMsg(message: ErrorReceipt): ErrorReceiptAminoMsg { + return { + type: "cosmos-sdk/ErrorReceipt", + value: ErrorReceipt.toAmino(message) + }; + }, + fromProtoMsg(message: ErrorReceiptProtoMsg): ErrorReceipt { + return ErrorReceipt.decode(message.value); + }, + toProto(message: ErrorReceipt): Uint8Array { + return ErrorReceipt.encode(message).finish(); + }, + toProtoMsg(message: ErrorReceipt): ErrorReceiptProtoMsg { + return { + typeUrl: "/ibc.core.channel.v1.ErrorReceipt", + value: ErrorReceipt.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/ibc/core/client/v1/client.ts b/src/codegen/ibc/core/client/v1/client.ts index 10f6341..681fd2a 100644 --- a/src/codegen/ibc/core/client/v1/client.ts +++ b/src/codegen/ibc/core/client/v1/client.ts @@ -110,11 +110,104 @@ export interface ClientConsensusStatesSDKType { consensus_states: ConsensusStateWithHeightSDKType[]; } /** - * ClientUpdateProposal is a governance proposal. If it passes, the substitute + * Height is a monotonically increasing data type + * that can be compared against another Height for the purposes of updating and + * freezing clients + * + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ +export interface Height { + /** the revision that the client is currently on */ + revisionNumber: bigint; + /** the height within the given revision */ + revisionHeight: bigint; +} +export interface HeightProtoMsg { + typeUrl: "/ibc.core.client.v1.Height"; + value: Uint8Array; +} +/** + * Height is a monotonically increasing data type + * that can be compared against another Height for the purposes of updating and + * freezing clients + * + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ +export interface HeightAmino { + /** the revision that the client is currently on */ + revision_number?: string; + /** the height within the given revision */ + revision_height?: string; +} +export interface HeightAminoMsg { + type: "cosmos-sdk/Height"; + value: HeightAmino; +} +/** + * Height is a monotonically increasing data type + * that can be compared against another Height for the purposes of updating and + * freezing clients + * + * Normally the RevisionHeight is incremented at each height while keeping + * RevisionNumber the same. However some consensus algorithms may choose to + * reset the height in certain conditions e.g. hard forks, state-machine + * breaking changes In these cases, the RevisionNumber is incremented so that + * height continues to be monitonically increasing even as the RevisionHeight + * gets reset + */ +export interface HeightSDKType { + revision_number: bigint; + revision_height: bigint; +} +/** Params defines the set of IBC light client parameters. */ +export interface Params { + /** + * allowed_clients defines the list of allowed client state types which can be created + * and interacted with. If a client type is removed from the allowed clients list, usage + * of this client will be disabled until it is added again to the list. + */ + allowedClients: string[]; +} +export interface ParamsProtoMsg { + typeUrl: "/ibc.core.client.v1.Params"; + value: Uint8Array; +} +/** Params defines the set of IBC light client parameters. */ +export interface ParamsAmino { + /** + * allowed_clients defines the list of allowed client state types which can be created + * and interacted with. If a client type is removed from the allowed clients list, usage + * of this client will be disabled until it is added again to the list. + */ + allowed_clients?: string[]; +} +export interface ParamsAminoMsg { + type: "cosmos-sdk/Params"; + value: ParamsAmino; +} +/** Params defines the set of IBC light client parameters. */ +export interface ParamsSDKType { + allowed_clients: string[]; +} +/** + * ClientUpdateProposal is a legacy governance proposal. If it passes, the substitute * client's latest consensus state is copied over to the subject client. The proposal * handler may fail if the subject and the substitute do not match in client and * chain parameters (with exception to latest height, frozen height, and chain-id). + * + * Deprecated: Please use MsgRecoverClient in favour of this message type. */ +/** @deprecated */ export interface ClientUpdateProposal { /** the title of the update proposal */ title: string; @@ -133,11 +226,14 @@ export interface ClientUpdateProposalProtoMsg { value: Uint8Array; } /** - * ClientUpdateProposal is a governance proposal. If it passes, the substitute + * ClientUpdateProposal is a legacy governance proposal. If it passes, the substitute * client's latest consensus state is copied over to the subject client. The proposal * handler may fail if the subject and the substitute do not match in client and * chain parameters (with exception to latest height, frozen height, and chain-id). + * + * Deprecated: Please use MsgRecoverClient in favour of this message type. */ +/** @deprecated */ export interface ClientUpdateProposalAmino { /** the title of the update proposal */ title?: string; @@ -156,11 +252,14 @@ export interface ClientUpdateProposalAminoMsg { value: ClientUpdateProposalAmino; } /** - * ClientUpdateProposal is a governance proposal. If it passes, the substitute + * ClientUpdateProposal is a legacy governance proposal. If it passes, the substitute * client's latest consensus state is copied over to the subject client. The proposal * handler may fail if the subject and the substitute do not match in client and * chain parameters (with exception to latest height, frozen height, and chain-id). + * + * Deprecated: Please use MsgRecoverClient in favour of this message type. */ +/** @deprecated */ export interface ClientUpdateProposalSDKType { title: string; description: string; @@ -170,7 +269,10 @@ export interface ClientUpdateProposalSDKType { /** * UpgradeProposal is a gov Content type for initiating an IBC breaking * upgrade. + * + * Deprecated: Please use MsgIBCSoftwareUpgrade in favour of this message type. */ +/** @deprecated */ export interface UpgradeProposal { title: string; description: string; @@ -192,7 +294,10 @@ export interface UpgradeProposalProtoMsg { /** * UpgradeProposal is a gov Content type for initiating an IBC breaking * upgrade. + * + * Deprecated: Please use MsgIBCSoftwareUpgrade in favour of this message type. */ +/** @deprecated */ export interface UpgradeProposalAmino { title?: string; description?: string; @@ -214,95 +319,16 @@ export interface UpgradeProposalAminoMsg { /** * UpgradeProposal is a gov Content type for initiating an IBC breaking * upgrade. + * + * Deprecated: Please use MsgIBCSoftwareUpgrade in favour of this message type. */ +/** @deprecated */ export interface UpgradeProposalSDKType { title: string; description: string; plan: PlanSDKType; upgraded_client_state?: AnySDKType; } -/** - * Height is a monotonically increasing data type - * that can be compared against another Height for the purposes of updating and - * freezing clients - * - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ -export interface Height { - /** the revision that the client is currently on */ - revisionNumber: bigint; - /** the height within the given revision */ - revisionHeight: bigint; -} -export interface HeightProtoMsg { - typeUrl: "/ibc.core.client.v1.Height"; - value: Uint8Array; -} -/** - * Height is a monotonically increasing data type - * that can be compared against another Height for the purposes of updating and - * freezing clients - * - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ -export interface HeightAmino { - /** the revision that the client is currently on */ - revision_number?: string; - /** the height within the given revision */ - revision_height?: string; -} -export interface HeightAminoMsg { - type: "cosmos-sdk/Height"; - value: HeightAmino; -} -/** - * Height is a monotonically increasing data type - * that can be compared against another Height for the purposes of updating and - * freezing clients - * - * Normally the RevisionHeight is incremented at each height while keeping - * RevisionNumber the same. However some consensus algorithms may choose to - * reset the height in certain conditions e.g. hard forks, state-machine - * breaking changes In these cases, the RevisionNumber is incremented so that - * height continues to be monitonically increasing even as the RevisionHeight - * gets reset - */ -export interface HeightSDKType { - revision_number: bigint; - revision_height: bigint; -} -/** Params defines the set of IBC light client parameters. */ -export interface Params { - /** allowed_clients defines the list of allowed client state types. */ - allowedClients: string[]; -} -export interface ParamsProtoMsg { - typeUrl: "/ibc.core.client.v1.Params"; - value: Uint8Array; -} -/** Params defines the set of IBC light client parameters. */ -export interface ParamsAmino { - /** allowed_clients defines the list of allowed client state types. */ - allowed_clients?: string[]; -} -export interface ParamsAminoMsg { - type: "cosmos-sdk/Params"; - value: ParamsAmino; -} -/** Params defines the set of IBC light client parameters. */ -export interface ParamsSDKType { - allowed_clients: string[]; -} function createBaseIdentifiedClientState(): IdentifiedClientState { return { clientId: "", @@ -548,6 +574,154 @@ export const ClientConsensusStates = { }; } }; +function createBaseHeight(): Height { + return { + revisionNumber: BigInt(0), + revisionHeight: BigInt(0) + }; +} +export const Height = { + typeUrl: "/ibc.core.client.v1.Height", + encode(message: Height, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.revisionNumber !== BigInt(0)) { + writer.uint32(8).uint64(message.revisionNumber); + } + if (message.revisionHeight !== BigInt(0)) { + writer.uint32(16).uint64(message.revisionHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Height { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHeight(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.revisionNumber = reader.uint64(); + break; + case 2: + message.revisionHeight = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Height { + const message = createBaseHeight(); + message.revisionNumber = object.revisionNumber !== undefined && object.revisionNumber !== null ? BigInt(object.revisionNumber.toString()) : BigInt(0); + message.revisionHeight = object.revisionHeight !== undefined && object.revisionHeight !== null ? BigInt(object.revisionHeight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: HeightAmino): Height { + return { + revisionNumber: BigInt(object.revision_number || "0"), + revisionHeight: BigInt(object.revision_height || "0") + }; + }, + toAmino(message: Height): HeightAmino { + const obj: any = {}; + obj.revision_number = message.revisionNumber !== BigInt(0) ? message.revisionNumber.toString() : undefined; + obj.revision_height = message.revisionHeight !== BigInt(0) ? message.revisionHeight.toString() : undefined; + return obj; + }, + fromAminoMsg(object: HeightAminoMsg): Height { + return Height.fromAmino(object.value); + }, + toAminoMsg(message: Height): HeightAminoMsg { + return { + type: "cosmos-sdk/Height", + value: Height.toAmino(message) + }; + }, + fromProtoMsg(message: HeightProtoMsg): Height { + return Height.decode(message.value); + }, + toProto(message: Height): Uint8Array { + return Height.encode(message).finish(); + }, + toProtoMsg(message: Height): HeightProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.Height", + value: Height.encode(message).finish() + }; + } +}; +function createBaseParams(): Params { + return { + allowedClients: [] + }; +} +export const Params = { + typeUrl: "/ibc.core.client.v1.Params", + encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.allowedClients) { + writer.uint32(10).string(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Params { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.allowedClients.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Params { + const message = createBaseParams(); + message.allowedClients = object.allowedClients?.map(e => e) || []; + return message; + }, + fromAmino(object: ParamsAmino): Params { + const message = createBaseParams(); + message.allowedClients = object.allowed_clients?.map(e => e) || []; + return message; + }, + toAmino(message: Params): ParamsAmino { + const obj: any = {}; + if (message.allowedClients) { + obj.allowed_clients = message.allowedClients.map(e => e); + } else { + obj.allowed_clients = message.allowedClients; + } + return obj; + }, + fromAminoMsg(object: ParamsAminoMsg): Params { + return Params.fromAmino(object.value); + }, + toAminoMsg(message: Params): ParamsAminoMsg { + return { + type: "cosmos-sdk/Params", + value: Params.toAmino(message) + }; + }, + fromProtoMsg(message: ParamsProtoMsg): Params { + return Params.decode(message.value); + }, + toProto(message: Params): Uint8Array { + return Params.encode(message).finish(); + }, + toProtoMsg(message: Params): ParamsProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.Params", + value: Params.encode(message).finish() + }; + } +}; function createBaseClientUpdateProposal(): ClientUpdateProposal { return { title: "", @@ -757,152 +931,4 @@ export const UpgradeProposal = { value: UpgradeProposal.encode(message).finish() }; } -}; -function createBaseHeight(): Height { - return { - revisionNumber: BigInt(0), - revisionHeight: BigInt(0) - }; -} -export const Height = { - typeUrl: "/ibc.core.client.v1.Height", - encode(message: Height, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.revisionNumber !== BigInt(0)) { - writer.uint32(8).uint64(message.revisionNumber); - } - if (message.revisionHeight !== BigInt(0)) { - writer.uint32(16).uint64(message.revisionHeight); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): Height { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseHeight(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.revisionNumber = reader.uint64(); - break; - case 2: - message.revisionHeight = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): Height { - const message = createBaseHeight(); - message.revisionNumber = object.revisionNumber !== undefined && object.revisionNumber !== null ? BigInt(object.revisionNumber.toString()) : BigInt(0); - message.revisionHeight = object.revisionHeight !== undefined && object.revisionHeight !== null ? BigInt(object.revisionHeight.toString()) : BigInt(0); - return message; - }, - fromAmino(object: HeightAmino): Height { - return { - revisionNumber: BigInt(object.revision_number || "0"), - revisionHeight: BigInt(object.revision_height || "0") - }; - }, - toAmino(message: Height): HeightAmino { - const obj: any = {}; - obj.revision_number = message.revisionNumber !== BigInt(0) ? message.revisionNumber.toString() : undefined; - obj.revision_height = message.revisionHeight !== BigInt(0) ? message.revisionHeight.toString() : undefined; - return obj; - }, - fromAminoMsg(object: HeightAminoMsg): Height { - return Height.fromAmino(object.value); - }, - toAminoMsg(message: Height): HeightAminoMsg { - return { - type: "cosmos-sdk/Height", - value: Height.toAmino(message) - }; - }, - fromProtoMsg(message: HeightProtoMsg): Height { - return Height.decode(message.value); - }, - toProto(message: Height): Uint8Array { - return Height.encode(message).finish(); - }, - toProtoMsg(message: Height): HeightProtoMsg { - return { - typeUrl: "/ibc.core.client.v1.Height", - value: Height.encode(message).finish() - }; - } -}; -function createBaseParams(): Params { - return { - allowedClients: [] - }; -} -export const Params = { - typeUrl: "/ibc.core.client.v1.Params", - encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - for (const v of message.allowedClients) { - writer.uint32(10).string(v!); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): Params { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseParams(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.allowedClients.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): Params { - const message = createBaseParams(); - message.allowedClients = object.allowedClients?.map(e => e) || []; - return message; - }, - fromAmino(object: ParamsAmino): Params { - const message = createBaseParams(); - message.allowedClients = object.allowed_clients?.map(e => e) || []; - return message; - }, - toAmino(message: Params): ParamsAmino { - const obj: any = {}; - if (message.allowedClients) { - obj.allowed_clients = message.allowedClients.map(e => e); - } else { - obj.allowed_clients = message.allowedClients; - } - return obj; - }, - fromAminoMsg(object: ParamsAminoMsg): Params { - return Params.fromAmino(object.value); - }, - toAminoMsg(message: Params): ParamsAminoMsg { - return { - type: "cosmos-sdk/Params", - value: Params.toAmino(message) - }; - }, - fromProtoMsg(message: ParamsProtoMsg): Params { - return Params.decode(message.value); - }, - toProto(message: Params): Uint8Array { - return Params.encode(message).finish(); - }, - toProtoMsg(message: Params): ParamsProtoMsg { - return { - typeUrl: "/ibc.core.client.v1.Params", - value: Params.encode(message).finish() - }; - } }; \ No newline at end of file diff --git a/src/codegen/ibc/core/client/v1/genesis.ts b/src/codegen/ibc/core/client/v1/genesis.ts index 8cb171c..eb7cf30 100644 --- a/src/codegen/ibc/core/client/v1/genesis.ts +++ b/src/codegen/ibc/core/client/v1/genesis.ts @@ -10,7 +10,11 @@ export interface GenesisState { /** metadata from each client */ clientsMetadata: IdentifiedGenesisMetadata[]; params: Params; - /** create localhost on initialization */ + /** + * Deprecated: create_localhost has been deprecated. + * The localhost client is automatically created at genesis. + */ + /** @deprecated */ createLocalhost: boolean; /** the sequence for the next generated client identifier */ nextClientSequence: bigint; @@ -28,7 +32,11 @@ export interface GenesisStateAmino { /** metadata from each client */ clients_metadata?: IdentifiedGenesisMetadataAmino[]; params?: ParamsAmino; - /** create localhost on initialization */ + /** + * Deprecated: create_localhost has been deprecated. + * The localhost client is automatically created at genesis. + */ + /** @deprecated */ create_localhost?: boolean; /** the sequence for the next generated client identifier */ next_client_sequence?: string; @@ -43,6 +51,7 @@ export interface GenesisStateSDKType { clients_consensus: ClientConsensusStatesSDKType[]; clients_metadata: IdentifiedGenesisMetadataSDKType[]; params: ParamsSDKType; + /** @deprecated */ create_localhost: boolean; next_client_sequence: bigint; } diff --git a/src/codegen/ibc/core/client/v1/query.lcd.ts b/src/codegen/ibc/core/client/v1/query.lcd.ts index bdd5fd8..72ae5ef 100644 --- a/src/codegen/ibc/core/client/v1/query.lcd.ts +++ b/src/codegen/ibc/core/client/v1/query.lcd.ts @@ -77,9 +77,9 @@ export class LCDQueryClient { const endpoint = `ibc/core/client/v1/client_status/${params.clientId}`; return await this.req.get(endpoint); } - /* ClientParams queries all parameters of the ibc client. */ + /* ClientParams queries all parameters of the ibc client submodule. */ async clientParams(_params: QueryClientParamsRequest = {}): Promise { - const endpoint = `ibc/client/v1/params`; + const endpoint = `ibc/core/client/v1/params`; return await this.req.get(endpoint); } /* UpgradedClientState queries an Upgraded IBC light client. */ diff --git a/src/codegen/ibc/core/client/v1/query.rpc.Query.ts b/src/codegen/ibc/core/client/v1/query.rpc.Query.ts index b859352..fc1a616 100644 --- a/src/codegen/ibc/core/client/v1/query.rpc.Query.ts +++ b/src/codegen/ibc/core/client/v1/query.rpc.Query.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../../../helpers"; import { BinaryReader } from "../../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryClientStateRequest, QueryClientStateResponse, QueryClientStatesRequest, QueryClientStatesResponse, QueryConsensusStateRequest, QueryConsensusStateResponse, QueryConsensusStatesRequest, QueryConsensusStatesResponse, QueryConsensusStateHeightsRequest, QueryConsensusStateHeightsResponse, QueryClientStatusRequest, QueryClientStatusResponse, QueryClientParamsRequest, QueryClientParamsResponse, QueryUpgradedClientStateRequest, QueryUpgradedClientStateResponse, QueryUpgradedConsensusStateRequest, QueryUpgradedConsensusStateResponse } from "./query"; +import { QueryClientStateRequest, QueryClientStateResponse, QueryClientStatesRequest, QueryClientStatesResponse, QueryConsensusStateRequest, QueryConsensusStateResponse, QueryConsensusStatesRequest, QueryConsensusStatesResponse, QueryConsensusStateHeightsRequest, QueryConsensusStateHeightsResponse, QueryClientStatusRequest, QueryClientStatusResponse, QueryClientParamsRequest, QueryClientParamsResponse, QueryUpgradedClientStateRequest, QueryUpgradedClientStateResponse, QueryUpgradedConsensusStateRequest, QueryUpgradedConsensusStateResponse, QueryVerifyMembershipRequest, QueryVerifyMembershipResponse } from "./query"; /** Query provides defines the gRPC querier service */ export interface Query { /** ClientState queries an IBC light client. */ @@ -22,12 +22,14 @@ export interface Query { consensusStateHeights(request: QueryConsensusStateHeightsRequest): Promise; /** Status queries the status of an IBC client. */ clientStatus(request: QueryClientStatusRequest): Promise; - /** ClientParams queries all parameters of the ibc client. */ + /** ClientParams queries all parameters of the ibc client submodule. */ clientParams(request?: QueryClientParamsRequest): Promise; /** UpgradedClientState queries an Upgraded IBC light client. */ upgradedClientState(request?: QueryUpgradedClientStateRequest): Promise; /** UpgradedConsensusState queries an Upgraded IBC consensus state. */ upgradedConsensusState(request?: QueryUpgradedConsensusStateRequest): Promise; + /** VerifyMembership queries an IBC light client for proof verification of a value at a given key path. */ + verifyMembership(request: QueryVerifyMembershipRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -42,6 +44,7 @@ export class QueryClientImpl implements Query { this.clientParams = this.clientParams.bind(this); this.upgradedClientState = this.upgradedClientState.bind(this); this.upgradedConsensusState = this.upgradedConsensusState.bind(this); + this.verifyMembership = this.verifyMembership.bind(this); } clientState(request: QueryClientStateRequest): Promise { const data = QueryClientStateRequest.encode(request).finish(); @@ -90,6 +93,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("ibc.core.client.v1.Query", "UpgradedConsensusState", data); return promise.then(data => QueryUpgradedConsensusStateResponse.decode(new BinaryReader(data))); } + verifyMembership(request: QueryVerifyMembershipRequest): Promise { + const data = QueryVerifyMembershipRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Query", "VerifyMembership", data); + return promise.then(data => QueryVerifyMembershipResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -121,6 +129,9 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, upgradedConsensusState(request?: QueryUpgradedConsensusStateRequest): Promise { return queryService.upgradedConsensusState(request); + }, + verifyMembership(request: QueryVerifyMembershipRequest): Promise { + return queryService.verifyMembership(request); } }; }; \ No newline at end of file diff --git a/src/codegen/ibc/core/client/v1/query.ts b/src/codegen/ibc/core/client/v1/query.ts index 9a23b80..ff1cb8f 100644 --- a/src/codegen/ibc/core/client/v1/query.ts +++ b/src/codegen/ibc/core/client/v1/query.ts @@ -1,6 +1,7 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../../cosmos/base/query/v1beta1/pagination"; -import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; import { Height, HeightAmino, HeightSDKType, IdentifiedClientState, IdentifiedClientStateAmino, IdentifiedClientStateSDKType, ConsensusStateWithHeight, ConsensusStateWithHeightAmino, ConsensusStateWithHeightSDKType, Params, ParamsAmino, ParamsSDKType } from "./client"; +import { MerklePath, MerklePathAmino, MerklePathSDKType } from "../../commitment/v1/commitment"; +import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** @@ -607,6 +608,80 @@ export interface QueryUpgradedConsensusStateResponseAminoMsg { export interface QueryUpgradedConsensusStateResponseSDKType { upgraded_consensus_state?: AnySDKType; } +/** QueryVerifyMembershipRequest is the request type for the Query/VerifyMembership RPC method */ +export interface QueryVerifyMembershipRequest { + /** client unique identifier. */ + clientId: string; + /** the proof to be verified by the client. */ + proof: Uint8Array; + /** the height of the commitment root at which the proof is verified. */ + proofHeight: Height; + /** the commitment key path. */ + merklePath: MerklePath; + /** the value which is proven. */ + value: Uint8Array; + /** optional time delay */ + timeDelay: bigint; + /** optional block delay */ + blockDelay: bigint; +} +export interface QueryVerifyMembershipRequestProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryVerifyMembershipRequest"; + value: Uint8Array; +} +/** QueryVerifyMembershipRequest is the request type for the Query/VerifyMembership RPC method */ +export interface QueryVerifyMembershipRequestAmino { + /** client unique identifier. */ + client_id?: string; + /** the proof to be verified by the client. */ + proof?: string; + /** the height of the commitment root at which the proof is verified. */ + proof_height?: HeightAmino; + /** the commitment key path. */ + merkle_path?: MerklePathAmino; + /** the value which is proven. */ + value?: string; + /** optional time delay */ + time_delay?: string; + /** optional block delay */ + block_delay?: string; +} +export interface QueryVerifyMembershipRequestAminoMsg { + type: "cosmos-sdk/QueryVerifyMembershipRequest"; + value: QueryVerifyMembershipRequestAmino; +} +/** QueryVerifyMembershipRequest is the request type for the Query/VerifyMembership RPC method */ +export interface QueryVerifyMembershipRequestSDKType { + client_id: string; + proof: Uint8Array; + proof_height: HeightSDKType; + merkle_path: MerklePathSDKType; + value: Uint8Array; + time_delay: bigint; + block_delay: bigint; +} +/** QueryVerifyMembershipResponse is the response type for the Query/VerifyMembership RPC method */ +export interface QueryVerifyMembershipResponse { + /** boolean indicating success or failure of proof verification. */ + success: boolean; +} +export interface QueryVerifyMembershipResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.QueryVerifyMembershipResponse"; + value: Uint8Array; +} +/** QueryVerifyMembershipResponse is the response type for the Query/VerifyMembership RPC method */ +export interface QueryVerifyMembershipResponseAmino { + /** boolean indicating success or failure of proof verification. */ + success?: boolean; +} +export interface QueryVerifyMembershipResponseAminoMsg { + type: "cosmos-sdk/QueryVerifyMembershipResponse"; + value: QueryVerifyMembershipResponseAmino; +} +/** QueryVerifyMembershipResponse is the response type for the Query/VerifyMembership RPC method */ +export interface QueryVerifyMembershipResponseSDKType { + success: boolean; +} function createBaseQueryClientStateRequest(): QueryClientStateRequest { return { clientId: "" @@ -1959,4 +2034,214 @@ export const QueryUpgradedConsensusStateResponse = { value: QueryUpgradedConsensusStateResponse.encode(message).finish() }; } +}; +function createBaseQueryVerifyMembershipRequest(): QueryVerifyMembershipRequest { + return { + clientId: "", + proof: new Uint8Array(), + proofHeight: Height.fromPartial({}), + merklePath: MerklePath.fromPartial({}), + value: new Uint8Array(), + timeDelay: BigInt(0), + blockDelay: BigInt(0) + }; +} +export const QueryVerifyMembershipRequest = { + typeUrl: "/ibc.core.client.v1.QueryVerifyMembershipRequest", + encode(message: QueryVerifyMembershipRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.clientId !== "") { + writer.uint32(10).string(message.clientId); + } + if (message.proof.length !== 0) { + writer.uint32(18).bytes(message.proof); + } + if (message.proofHeight !== undefined) { + Height.encode(message.proofHeight, writer.uint32(26).fork()).ldelim(); + } + if (message.merklePath !== undefined) { + MerklePath.encode(message.merklePath, writer.uint32(34).fork()).ldelim(); + } + if (message.value.length !== 0) { + writer.uint32(42).bytes(message.value); + } + if (message.timeDelay !== BigInt(0)) { + writer.uint32(48).uint64(message.timeDelay); + } + if (message.blockDelay !== BigInt(0)) { + writer.uint32(56).uint64(message.blockDelay); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVerifyMembershipRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVerifyMembershipRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.clientId = reader.string(); + break; + case 2: + message.proof = reader.bytes(); + break; + case 3: + message.proofHeight = Height.decode(reader, reader.uint32()); + break; + case 4: + message.merklePath = MerklePath.decode(reader, reader.uint32()); + break; + case 5: + message.value = reader.bytes(); + break; + case 6: + message.timeDelay = reader.uint64(); + break; + case 7: + message.blockDelay = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryVerifyMembershipRequest { + const message = createBaseQueryVerifyMembershipRequest(); + message.clientId = object.clientId ?? ""; + message.proof = object.proof ?? new Uint8Array(); + message.proofHeight = object.proofHeight !== undefined && object.proofHeight !== null ? Height.fromPartial(object.proofHeight) : undefined; + message.merklePath = object.merklePath !== undefined && object.merklePath !== null ? MerklePath.fromPartial(object.merklePath) : undefined; + message.value = object.value ?? new Uint8Array(); + message.timeDelay = object.timeDelay !== undefined && object.timeDelay !== null ? BigInt(object.timeDelay.toString()) : BigInt(0); + message.blockDelay = object.blockDelay !== undefined && object.blockDelay !== null ? BigInt(object.blockDelay.toString()) : BigInt(0); + return message; + }, + fromAmino(object: QueryVerifyMembershipRequestAmino): QueryVerifyMembershipRequest { + const message = createBaseQueryVerifyMembershipRequest(); + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.proof !== undefined && object.proof !== null) { + message.proof = bytesFromBase64(object.proof); + } + if (object.proof_height !== undefined && object.proof_height !== null) { + message.proofHeight = Height.fromAmino(object.proof_height); + } + if (object.merkle_path !== undefined && object.merkle_path !== null) { + message.merklePath = MerklePath.fromAmino(object.merkle_path); + } + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); + } + if (object.time_delay !== undefined && object.time_delay !== null) { + message.timeDelay = BigInt(object.time_delay); + } + if (object.block_delay !== undefined && object.block_delay !== null) { + message.blockDelay = BigInt(object.block_delay); + } + return message; + }, + toAmino(message: QueryVerifyMembershipRequest): QueryVerifyMembershipRequestAmino { + const obj: any = {}; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + obj.proof = message.proof ? base64FromBytes(message.proof) : undefined; + obj.proof_height = message.proofHeight ? Height.toAmino(message.proofHeight) : {}; + obj.merkle_path = message.merklePath ? MerklePath.toAmino(message.merklePath) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; + obj.time_delay = message.timeDelay !== BigInt(0) ? message.timeDelay.toString() : undefined; + obj.block_delay = message.blockDelay !== BigInt(0) ? message.blockDelay.toString() : undefined; + return obj; + }, + fromAminoMsg(object: QueryVerifyMembershipRequestAminoMsg): QueryVerifyMembershipRequest { + return QueryVerifyMembershipRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryVerifyMembershipRequest): QueryVerifyMembershipRequestAminoMsg { + return { + type: "cosmos-sdk/QueryVerifyMembershipRequest", + value: QueryVerifyMembershipRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryVerifyMembershipRequestProtoMsg): QueryVerifyMembershipRequest { + return QueryVerifyMembershipRequest.decode(message.value); + }, + toProto(message: QueryVerifyMembershipRequest): Uint8Array { + return QueryVerifyMembershipRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryVerifyMembershipRequest): QueryVerifyMembershipRequestProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryVerifyMembershipRequest", + value: QueryVerifyMembershipRequest.encode(message).finish() + }; + } +}; +function createBaseQueryVerifyMembershipResponse(): QueryVerifyMembershipResponse { + return { + success: false + }; +} +export const QueryVerifyMembershipResponse = { + typeUrl: "/ibc.core.client.v1.QueryVerifyMembershipResponse", + encode(message: QueryVerifyMembershipResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.success === true) { + writer.uint32(8).bool(message.success); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryVerifyMembershipResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryVerifyMembershipResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.success = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryVerifyMembershipResponse { + const message = createBaseQueryVerifyMembershipResponse(); + message.success = object.success ?? false; + return message; + }, + fromAmino(object: QueryVerifyMembershipResponseAmino): QueryVerifyMembershipResponse { + const message = createBaseQueryVerifyMembershipResponse(); + if (object.success !== undefined && object.success !== null) { + message.success = object.success; + } + return message; + }, + toAmino(message: QueryVerifyMembershipResponse): QueryVerifyMembershipResponseAmino { + const obj: any = {}; + obj.success = message.success === false ? undefined : message.success; + return obj; + }, + fromAminoMsg(object: QueryVerifyMembershipResponseAminoMsg): QueryVerifyMembershipResponse { + return QueryVerifyMembershipResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryVerifyMembershipResponse): QueryVerifyMembershipResponseAminoMsg { + return { + type: "cosmos-sdk/QueryVerifyMembershipResponse", + value: QueryVerifyMembershipResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryVerifyMembershipResponseProtoMsg): QueryVerifyMembershipResponse { + return QueryVerifyMembershipResponse.decode(message.value); + }, + toProto(message: QueryVerifyMembershipResponse): Uint8Array { + return QueryVerifyMembershipResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryVerifyMembershipResponse): QueryVerifyMembershipResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.QueryVerifyMembershipResponse", + value: QueryVerifyMembershipResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/src/codegen/ibc/core/client/v1/tx.amino.ts b/src/codegen/ibc/core/client/v1/tx.amino.ts index a3cd386..dc80a57 100644 --- a/src/codegen/ibc/core/client/v1/tx.amino.ts +++ b/src/codegen/ibc/core/client/v1/tx.amino.ts @@ -1,4 +1,4 @@ -import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour } from "./tx"; +import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour, MsgRecoverClient, MsgIBCSoftwareUpgrade, MsgUpdateParams } from "./tx"; export const AminoConverter = { "/ibc.core.client.v1.MsgCreateClient": { aminoType: "cosmos-sdk/MsgCreateClient", @@ -19,5 +19,20 @@ export const AminoConverter = { aminoType: "cosmos-sdk/MsgSubmitMisbehaviour", toAmino: MsgSubmitMisbehaviour.toAmino, fromAmino: MsgSubmitMisbehaviour.fromAmino + }, + "/ibc.core.client.v1.MsgRecoverClient": { + aminoType: "cosmos-sdk/MsgRecoverClient", + toAmino: MsgRecoverClient.toAmino, + fromAmino: MsgRecoverClient.fromAmino + }, + "/ibc.core.client.v1.MsgIBCSoftwareUpgrade": { + aminoType: "cosmos-sdk/MsgIBCSoftwareUpgrade", + toAmino: MsgIBCSoftwareUpgrade.toAmino, + fromAmino: MsgIBCSoftwareUpgrade.fromAmino + }, + "/ibc.core.client.v1.MsgUpdateParams": { + aminoType: "cosmos-sdk/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino } }; \ No newline at end of file diff --git a/src/codegen/ibc/core/client/v1/tx.registry.ts b/src/codegen/ibc/core/client/v1/tx.registry.ts index a3582cd..7b22973 100644 --- a/src/codegen/ibc/core/client/v1/tx.registry.ts +++ b/src/codegen/ibc/core/client/v1/tx.registry.ts @@ -1,6 +1,6 @@ import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.core.client.v1.MsgCreateClient", MsgCreateClient], ["/ibc.core.client.v1.MsgUpdateClient", MsgUpdateClient], ["/ibc.core.client.v1.MsgUpgradeClient", MsgUpgradeClient], ["/ibc.core.client.v1.MsgSubmitMisbehaviour", MsgSubmitMisbehaviour]]; +import { MsgCreateClient, MsgUpdateClient, MsgUpgradeClient, MsgSubmitMisbehaviour, MsgRecoverClient, MsgIBCSoftwareUpgrade, MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.core.client.v1.MsgCreateClient", MsgCreateClient], ["/ibc.core.client.v1.MsgUpdateClient", MsgUpdateClient], ["/ibc.core.client.v1.MsgUpgradeClient", MsgUpgradeClient], ["/ibc.core.client.v1.MsgSubmitMisbehaviour", MsgSubmitMisbehaviour], ["/ibc.core.client.v1.MsgRecoverClient", MsgRecoverClient], ["/ibc.core.client.v1.MsgIBCSoftwareUpgrade", MsgIBCSoftwareUpgrade], ["/ibc.core.client.v1.MsgUpdateParams", MsgUpdateParams]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -31,6 +31,24 @@ export const MessageComposer = { typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour", value: MsgSubmitMisbehaviour.encode(value).finish() }; + }, + recoverClient(value: MsgRecoverClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgRecoverClient", + value: MsgRecoverClient.encode(value).finish() + }; + }, + iBCSoftwareUpgrade(value: MsgIBCSoftwareUpgrade) { + return { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgrade", + value: MsgIBCSoftwareUpgrade.encode(value).finish() + }; + }, + updateClientParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; } }, withTypeUrl: { @@ -57,6 +75,24 @@ export const MessageComposer = { typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour", value }; + }, + recoverClient(value: MsgRecoverClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgRecoverClient", + value + }; + }, + iBCSoftwareUpgrade(value: MsgIBCSoftwareUpgrade) { + return { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgrade", + value + }; + }, + updateClientParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams", + value + }; } }, fromPartial: { @@ -83,6 +119,24 @@ export const MessageComposer = { typeUrl: "/ibc.core.client.v1.MsgSubmitMisbehaviour", value: MsgSubmitMisbehaviour.fromPartial(value) }; + }, + recoverClient(value: MsgRecoverClient) { + return { + typeUrl: "/ibc.core.client.v1.MsgRecoverClient", + value: MsgRecoverClient.fromPartial(value) + }; + }, + iBCSoftwareUpgrade(value: MsgIBCSoftwareUpgrade) { + return { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgrade", + value: MsgIBCSoftwareUpgrade.fromPartial(value) + }; + }, + updateClientParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/src/codegen/ibc/core/client/v1/tx.rpc.msg.ts b/src/codegen/ibc/core/client/v1/tx.rpc.msg.ts index 29890ac..2b884de 100644 --- a/src/codegen/ibc/core/client/v1/tx.rpc.msg.ts +++ b/src/codegen/ibc/core/client/v1/tx.rpc.msg.ts @@ -1,6 +1,6 @@ import { Rpc } from "../../../../helpers"; import { BinaryReader } from "../../../../binary"; -import { MsgCreateClient, MsgCreateClientResponse, MsgUpdateClient, MsgUpdateClientResponse, MsgUpgradeClient, MsgUpgradeClientResponse, MsgSubmitMisbehaviour, MsgSubmitMisbehaviourResponse } from "./tx"; +import { MsgCreateClient, MsgCreateClientResponse, MsgUpdateClient, MsgUpdateClientResponse, MsgUpgradeClient, MsgUpgradeClientResponse, MsgSubmitMisbehaviour, MsgSubmitMisbehaviourResponse, MsgRecoverClient, MsgRecoverClientResponse, MsgIBCSoftwareUpgrade, MsgIBCSoftwareUpgradeResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; /** Msg defines the ibc/client Msg service. */ export interface Msg { /** CreateClient defines a rpc handler method for MsgCreateClient. */ @@ -11,6 +11,12 @@ export interface Msg { upgradeClient(request: MsgUpgradeClient): Promise; /** SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. */ submitMisbehaviour(request: MsgSubmitMisbehaviour): Promise; + /** RecoverClient defines a rpc handler method for MsgRecoverClient. */ + recoverClient(request: MsgRecoverClient): Promise; + /** IBCSoftwareUpgrade defines a rpc handler method for MsgIBCSoftwareUpgrade. */ + iBCSoftwareUpgrade(request: MsgIBCSoftwareUpgrade): Promise; + /** UpdateClientParams defines a rpc handler method for MsgUpdateParams. */ + updateClientParams(request: MsgUpdateParams): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -20,6 +26,9 @@ export class MsgClientImpl implements Msg { this.updateClient = this.updateClient.bind(this); this.upgradeClient = this.upgradeClient.bind(this); this.submitMisbehaviour = this.submitMisbehaviour.bind(this); + this.recoverClient = this.recoverClient.bind(this); + this.iBCSoftwareUpgrade = this.iBCSoftwareUpgrade.bind(this); + this.updateClientParams = this.updateClientParams.bind(this); } createClient(request: MsgCreateClient): Promise { const data = MsgCreateClient.encode(request).finish(); @@ -41,4 +50,19 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("ibc.core.client.v1.Msg", "SubmitMisbehaviour", data); return promise.then(data => MsgSubmitMisbehaviourResponse.decode(new BinaryReader(data))); } + recoverClient(request: MsgRecoverClient): Promise { + const data = MsgRecoverClient.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Msg", "RecoverClient", data); + return promise.then(data => MsgRecoverClientResponse.decode(new BinaryReader(data))); + } + iBCSoftwareUpgrade(request: MsgIBCSoftwareUpgrade): Promise { + const data = MsgIBCSoftwareUpgrade.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Msg", "IBCSoftwareUpgrade", data); + return promise.then(data => MsgIBCSoftwareUpgradeResponse.decode(new BinaryReader(data))); + } + updateClientParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("ibc.core.client.v1.Msg", "UpdateClientParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } } \ No newline at end of file diff --git a/src/codegen/ibc/core/client/v1/tx.ts b/src/codegen/ibc/core/client/v1/tx.ts index 51791cc..5ff805f 100644 --- a/src/codegen/ibc/core/client/v1/tx.ts +++ b/src/codegen/ibc/core/client/v1/tx.ts @@ -1,4 +1,6 @@ import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { Plan, PlanAmino, PlanSDKType } from "../../../../cosmos/upgrade/v1beta1/upgrade"; +import { Params, ParamsAmino, ParamsSDKType } from "./client"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** MsgCreateClient defines a message to create an IBC client */ @@ -55,13 +57,13 @@ export interface MsgCreateClientResponseAminoMsg { export interface MsgCreateClientResponseSDKType {} /** * MsgUpdateClient defines an sdk.Msg to update a IBC client state using - * the given header. + * the given client message. */ export interface MsgUpdateClient { /** client unique identifier */ clientId: string; - /** header to update the light client */ - header?: Any; + /** client message to update the light client */ + clientMessage?: Any; /** signer address */ signer: string; } @@ -71,13 +73,13 @@ export interface MsgUpdateClientProtoMsg { } /** * MsgUpdateClient defines an sdk.Msg to update a IBC client state using - * the given header. + * the given client message. */ export interface MsgUpdateClientAmino { /** client unique identifier */ client_id?: string; - /** header to update the light client */ - header?: AnyAmino; + /** client message to update the light client */ + client_message?: AnyAmino; /** signer address */ signer?: string; } @@ -87,11 +89,11 @@ export interface MsgUpdateClientAminoMsg { } /** * MsgUpdateClient defines an sdk.Msg to update a IBC client state using - * the given header. + * the given client message. */ export interface MsgUpdateClientSDKType { client_id: string; - header?: AnySDKType; + client_message?: AnySDKType; signer: string; } /** MsgUpdateClientResponse defines the Msg/UpdateClient response type. */ @@ -187,7 +189,9 @@ export interface MsgUpgradeClientResponseSDKType {} /** * MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for * light client misbehaviour. + * This message has been deprecated. Use MsgUpdateClient instead. */ +/** @deprecated */ export interface MsgSubmitMisbehaviour { /** client unique identifier */ clientId: string; @@ -203,7 +207,9 @@ export interface MsgSubmitMisbehaviourProtoMsg { /** * MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for * light client misbehaviour. + * This message has been deprecated. Use MsgUpdateClient instead. */ +/** @deprecated */ export interface MsgSubmitMisbehaviourAmino { /** client unique identifier */ client_id?: string; @@ -219,7 +225,9 @@ export interface MsgSubmitMisbehaviourAminoMsg { /** * MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for * light client misbehaviour. + * This message has been deprecated. Use MsgUpdateClient instead. */ +/** @deprecated */ export interface MsgSubmitMisbehaviourSDKType { client_id: string; misbehaviour?: AnySDKType; @@ -248,6 +256,169 @@ export interface MsgSubmitMisbehaviourResponseAminoMsg { * type. */ export interface MsgSubmitMisbehaviourResponseSDKType {} +/** MsgRecoverClient defines the message used to recover a frozen or expired client. */ +export interface MsgRecoverClient { + /** the client identifier for the client to be updated if the proposal passes */ + subjectClientId: string; + /** + * the substitute client identifier for the client which will replace the subject + * client + */ + substituteClientId: string; + /** signer address */ + signer: string; +} +export interface MsgRecoverClientProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgRecoverClient"; + value: Uint8Array; +} +/** MsgRecoverClient defines the message used to recover a frozen or expired client. */ +export interface MsgRecoverClientAmino { + /** the client identifier for the client to be updated if the proposal passes */ + subject_client_id?: string; + /** + * the substitute client identifier for the client which will replace the subject + * client + */ + substitute_client_id?: string; + /** signer address */ + signer?: string; +} +export interface MsgRecoverClientAminoMsg { + type: "cosmos-sdk/MsgRecoverClient"; + value: MsgRecoverClientAmino; +} +/** MsgRecoverClient defines the message used to recover a frozen or expired client. */ +export interface MsgRecoverClientSDKType { + subject_client_id: string; + substitute_client_id: string; + signer: string; +} +/** MsgRecoverClientResponse defines the Msg/RecoverClient response type. */ +export interface MsgRecoverClientResponse {} +export interface MsgRecoverClientResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgRecoverClientResponse"; + value: Uint8Array; +} +/** MsgRecoverClientResponse defines the Msg/RecoverClient response type. */ +export interface MsgRecoverClientResponseAmino {} +export interface MsgRecoverClientResponseAminoMsg { + type: "cosmos-sdk/MsgRecoverClientResponse"; + value: MsgRecoverClientResponseAmino; +} +/** MsgRecoverClientResponse defines the Msg/RecoverClient response type. */ +export interface MsgRecoverClientResponseSDKType {} +/** MsgIBCSoftwareUpgrade defines the message used to schedule an upgrade of an IBC client using a v1 governance proposal */ +export interface MsgIBCSoftwareUpgrade { + plan: Plan; + /** + * An UpgradedClientState must be provided to perform an IBC breaking upgrade. + * This will make the chain commit to the correct upgraded (self) client state + * before the upgrade occurs, so that connecting chains can verify that the + * new upgraded client is valid by verifying a proof on the previous version + * of the chain. This will allow IBC connections to persist smoothly across + * planned chain upgrades. Correspondingly, the UpgradedClientState field has been + * deprecated in the Cosmos SDK to allow for this logic to exist solely in + * the 02-client module. + */ + upgradedClientState?: Any; + /** signer address */ + signer: string; +} +export interface MsgIBCSoftwareUpgradeProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgrade"; + value: Uint8Array; +} +/** MsgIBCSoftwareUpgrade defines the message used to schedule an upgrade of an IBC client using a v1 governance proposal */ +export interface MsgIBCSoftwareUpgradeAmino { + plan?: PlanAmino; + /** + * An UpgradedClientState must be provided to perform an IBC breaking upgrade. + * This will make the chain commit to the correct upgraded (self) client state + * before the upgrade occurs, so that connecting chains can verify that the + * new upgraded client is valid by verifying a proof on the previous version + * of the chain. This will allow IBC connections to persist smoothly across + * planned chain upgrades. Correspondingly, the UpgradedClientState field has been + * deprecated in the Cosmos SDK to allow for this logic to exist solely in + * the 02-client module. + */ + upgraded_client_state?: AnyAmino; + /** signer address */ + signer?: string; +} +export interface MsgIBCSoftwareUpgradeAminoMsg { + type: "cosmos-sdk/MsgIBCSoftwareUpgrade"; + value: MsgIBCSoftwareUpgradeAmino; +} +/** MsgIBCSoftwareUpgrade defines the message used to schedule an upgrade of an IBC client using a v1 governance proposal */ +export interface MsgIBCSoftwareUpgradeSDKType { + plan: PlanSDKType; + upgraded_client_state?: AnySDKType; + signer: string; +} +/** MsgIBCSoftwareUpgradeResponse defines the Msg/IBCSoftwareUpgrade response type. */ +export interface MsgIBCSoftwareUpgradeResponse {} +export interface MsgIBCSoftwareUpgradeResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgradeResponse"; + value: Uint8Array; +} +/** MsgIBCSoftwareUpgradeResponse defines the Msg/IBCSoftwareUpgrade response type. */ +export interface MsgIBCSoftwareUpgradeResponseAmino {} +export interface MsgIBCSoftwareUpgradeResponseAminoMsg { + type: "cosmos-sdk/MsgIBCSoftwareUpgradeResponse"; + value: MsgIBCSoftwareUpgradeResponseAmino; +} +/** MsgIBCSoftwareUpgradeResponse defines the Msg/IBCSoftwareUpgrade response type. */ +export interface MsgIBCSoftwareUpgradeResponseSDKType {} +/** MsgUpdateParams defines the sdk.Msg type to update the client parameters. */ +export interface MsgUpdateParams { + /** signer address */ + signer: string; + /** + * params defines the client parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** MsgUpdateParams defines the sdk.Msg type to update the client parameters. */ +export interface MsgUpdateParamsAmino { + /** signer address */ + signer?: string; + /** + * params defines the client parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params?: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** MsgUpdateParams defines the sdk.Msg type to update the client parameters. */ +export interface MsgUpdateParamsSDKType { + signer: string; + params: ParamsSDKType; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/ibc.core.client.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponseSDKType {} function createBaseMsgCreateClient(): MsgCreateClient { return { clientState: undefined, @@ -400,7 +571,7 @@ export const MsgCreateClientResponse = { function createBaseMsgUpdateClient(): MsgUpdateClient { return { clientId: "", - header: undefined, + clientMessage: undefined, signer: "" }; } @@ -410,8 +581,8 @@ export const MsgUpdateClient = { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); } - if (message.header !== undefined) { - Any.encode(message.header, writer.uint32(18).fork()).ldelim(); + if (message.clientMessage !== undefined) { + Any.encode(message.clientMessage, writer.uint32(18).fork()).ldelim(); } if (message.signer !== "") { writer.uint32(26).string(message.signer); @@ -429,7 +600,7 @@ export const MsgUpdateClient = { message.clientId = reader.string(); break; case 2: - message.header = Any.decode(reader, reader.uint32()); + message.clientMessage = Any.decode(reader, reader.uint32()); break; case 3: message.signer = reader.string(); @@ -444,7 +615,7 @@ export const MsgUpdateClient = { fromPartial(object: Partial): MsgUpdateClient { const message = createBaseMsgUpdateClient(); message.clientId = object.clientId ?? ""; - message.header = object.header !== undefined && object.header !== null ? Any.fromPartial(object.header) : undefined; + message.clientMessage = object.clientMessage !== undefined && object.clientMessage !== null ? Any.fromPartial(object.clientMessage) : undefined; message.signer = object.signer ?? ""; return message; }, @@ -453,8 +624,8 @@ export const MsgUpdateClient = { if (object.client_id !== undefined && object.client_id !== null) { message.clientId = object.client_id; } - if (object.header !== undefined && object.header !== null) { - message.header = Any.fromAmino(object.header); + if (object.client_message !== undefined && object.client_message !== null) { + message.clientMessage = Any.fromAmino(object.client_message); } if (object.signer !== undefined && object.signer !== null) { message.signer = object.signer; @@ -464,7 +635,7 @@ export const MsgUpdateClient = { toAmino(message: MsgUpdateClient): MsgUpdateClientAmino { const obj: any = {}; obj.client_id = message.clientId === "" ? undefined : message.clientId; - obj.header = message.header ? Any.toAmino(message.header) : undefined; + obj.client_message = message.clientMessage ? Any.toAmino(message.clientMessage) : undefined; obj.signer = message.signer === "" ? undefined : message.signer; return obj; }, @@ -879,4 +1050,439 @@ export const MsgSubmitMisbehaviourResponse = { value: MsgSubmitMisbehaviourResponse.encode(message).finish() }; } +}; +function createBaseMsgRecoverClient(): MsgRecoverClient { + return { + subjectClientId: "", + substituteClientId: "", + signer: "" + }; +} +export const MsgRecoverClient = { + typeUrl: "/ibc.core.client.v1.MsgRecoverClient", + encode(message: MsgRecoverClient, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.subjectClientId !== "") { + writer.uint32(10).string(message.subjectClientId); + } + if (message.substituteClientId !== "") { + writer.uint32(18).string(message.substituteClientId); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRecoverClient { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRecoverClient(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subjectClientId = reader.string(); + break; + case 2: + message.substituteClientId = reader.string(); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgRecoverClient { + const message = createBaseMsgRecoverClient(); + message.subjectClientId = object.subjectClientId ?? ""; + message.substituteClientId = object.substituteClientId ?? ""; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgRecoverClientAmino): MsgRecoverClient { + const message = createBaseMsgRecoverClient(); + if (object.subject_client_id !== undefined && object.subject_client_id !== null) { + message.subjectClientId = object.subject_client_id; + } + if (object.substitute_client_id !== undefined && object.substitute_client_id !== null) { + message.substituteClientId = object.substitute_client_id; + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgRecoverClient): MsgRecoverClientAmino { + const obj: any = {}; + obj.subject_client_id = message.subjectClientId === "" ? undefined : message.subjectClientId; + obj.substitute_client_id = message.substituteClientId === "" ? undefined : message.substituteClientId; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgRecoverClientAminoMsg): MsgRecoverClient { + return MsgRecoverClient.fromAmino(object.value); + }, + toAminoMsg(message: MsgRecoverClient): MsgRecoverClientAminoMsg { + return { + type: "cosmos-sdk/MsgRecoverClient", + value: MsgRecoverClient.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRecoverClientProtoMsg): MsgRecoverClient { + return MsgRecoverClient.decode(message.value); + }, + toProto(message: MsgRecoverClient): Uint8Array { + return MsgRecoverClient.encode(message).finish(); + }, + toProtoMsg(message: MsgRecoverClient): MsgRecoverClientProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgRecoverClient", + value: MsgRecoverClient.encode(message).finish() + }; + } +}; +function createBaseMsgRecoverClientResponse(): MsgRecoverClientResponse { + return {}; +} +export const MsgRecoverClientResponse = { + typeUrl: "/ibc.core.client.v1.MsgRecoverClientResponse", + encode(_: MsgRecoverClientResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRecoverClientResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRecoverClientResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgRecoverClientResponse { + const message = createBaseMsgRecoverClientResponse(); + return message; + }, + fromAmino(_: MsgRecoverClientResponseAmino): MsgRecoverClientResponse { + const message = createBaseMsgRecoverClientResponse(); + return message; + }, + toAmino(_: MsgRecoverClientResponse): MsgRecoverClientResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRecoverClientResponseAminoMsg): MsgRecoverClientResponse { + return MsgRecoverClientResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgRecoverClientResponse): MsgRecoverClientResponseAminoMsg { + return { + type: "cosmos-sdk/MsgRecoverClientResponse", + value: MsgRecoverClientResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRecoverClientResponseProtoMsg): MsgRecoverClientResponse { + return MsgRecoverClientResponse.decode(message.value); + }, + toProto(message: MsgRecoverClientResponse): Uint8Array { + return MsgRecoverClientResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRecoverClientResponse): MsgRecoverClientResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgRecoverClientResponse", + value: MsgRecoverClientResponse.encode(message).finish() + }; + } +}; +function createBaseMsgIBCSoftwareUpgrade(): MsgIBCSoftwareUpgrade { + return { + plan: Plan.fromPartial({}), + upgradedClientState: undefined, + signer: "" + }; +} +export const MsgIBCSoftwareUpgrade = { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgrade", + encode(message: MsgIBCSoftwareUpgrade, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.plan !== undefined) { + Plan.encode(message.plan, writer.uint32(10).fork()).ldelim(); + } + if (message.upgradedClientState !== undefined) { + Any.encode(message.upgradedClientState, writer.uint32(18).fork()).ldelim(); + } + if (message.signer !== "") { + writer.uint32(26).string(message.signer); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgIBCSoftwareUpgrade { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgIBCSoftwareUpgrade(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.plan = Plan.decode(reader, reader.uint32()); + break; + case 2: + message.upgradedClientState = Any.decode(reader, reader.uint32()); + break; + case 3: + message.signer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgIBCSoftwareUpgrade { + const message = createBaseMsgIBCSoftwareUpgrade(); + message.plan = object.plan !== undefined && object.plan !== null ? Plan.fromPartial(object.plan) : undefined; + message.upgradedClientState = object.upgradedClientState !== undefined && object.upgradedClientState !== null ? Any.fromPartial(object.upgradedClientState) : undefined; + message.signer = object.signer ?? ""; + return message; + }, + fromAmino(object: MsgIBCSoftwareUpgradeAmino): MsgIBCSoftwareUpgrade { + const message = createBaseMsgIBCSoftwareUpgrade(); + if (object.plan !== undefined && object.plan !== null) { + message.plan = Plan.fromAmino(object.plan); + } + if (object.upgraded_client_state !== undefined && object.upgraded_client_state !== null) { + message.upgradedClientState = Any.fromAmino(object.upgraded_client_state); + } + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + return message; + }, + toAmino(message: MsgIBCSoftwareUpgrade): MsgIBCSoftwareUpgradeAmino { + const obj: any = {}; + obj.plan = message.plan ? Plan.toAmino(message.plan) : undefined; + obj.upgraded_client_state = message.upgradedClientState ? Any.toAmino(message.upgradedClientState) : undefined; + obj.signer = message.signer === "" ? undefined : message.signer; + return obj; + }, + fromAminoMsg(object: MsgIBCSoftwareUpgradeAminoMsg): MsgIBCSoftwareUpgrade { + return MsgIBCSoftwareUpgrade.fromAmino(object.value); + }, + toAminoMsg(message: MsgIBCSoftwareUpgrade): MsgIBCSoftwareUpgradeAminoMsg { + return { + type: "cosmos-sdk/MsgIBCSoftwareUpgrade", + value: MsgIBCSoftwareUpgrade.toAmino(message) + }; + }, + fromProtoMsg(message: MsgIBCSoftwareUpgradeProtoMsg): MsgIBCSoftwareUpgrade { + return MsgIBCSoftwareUpgrade.decode(message.value); + }, + toProto(message: MsgIBCSoftwareUpgrade): Uint8Array { + return MsgIBCSoftwareUpgrade.encode(message).finish(); + }, + toProtoMsg(message: MsgIBCSoftwareUpgrade): MsgIBCSoftwareUpgradeProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgrade", + value: MsgIBCSoftwareUpgrade.encode(message).finish() + }; + } +}; +function createBaseMsgIBCSoftwareUpgradeResponse(): MsgIBCSoftwareUpgradeResponse { + return {}; +} +export const MsgIBCSoftwareUpgradeResponse = { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgradeResponse", + encode(_: MsgIBCSoftwareUpgradeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgIBCSoftwareUpgradeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgIBCSoftwareUpgradeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgIBCSoftwareUpgradeResponse { + const message = createBaseMsgIBCSoftwareUpgradeResponse(); + return message; + }, + fromAmino(_: MsgIBCSoftwareUpgradeResponseAmino): MsgIBCSoftwareUpgradeResponse { + const message = createBaseMsgIBCSoftwareUpgradeResponse(); + return message; + }, + toAmino(_: MsgIBCSoftwareUpgradeResponse): MsgIBCSoftwareUpgradeResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgIBCSoftwareUpgradeResponseAminoMsg): MsgIBCSoftwareUpgradeResponse { + return MsgIBCSoftwareUpgradeResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgIBCSoftwareUpgradeResponse): MsgIBCSoftwareUpgradeResponseAminoMsg { + return { + type: "cosmos-sdk/MsgIBCSoftwareUpgradeResponse", + value: MsgIBCSoftwareUpgradeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgIBCSoftwareUpgradeResponseProtoMsg): MsgIBCSoftwareUpgradeResponse { + return MsgIBCSoftwareUpgradeResponse.decode(message.value); + }, + toProto(message: MsgIBCSoftwareUpgradeResponse): Uint8Array { + return MsgIBCSoftwareUpgradeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgIBCSoftwareUpgradeResponse): MsgIBCSoftwareUpgradeResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgIBCSoftwareUpgradeResponse", + value: MsgIBCSoftwareUpgradeResponse.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + signer: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.signer = object.signer ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.signer = message.signer === "" ? undefined : message.signer; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/ibc.core.client.v1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/ibc.core.client.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/src/codegen/ibc/core/commitment/v1/commitment.ts b/src/codegen/ibc/core/commitment/v1/commitment.ts index 2060162..4de9406 100644 --- a/src/codegen/ibc/core/commitment/v1/commitment.ts +++ b/src/codegen/ibc/core/commitment/v1/commitment.ts @@ -1,4 +1,4 @@ -import { CommitmentProof, CommitmentProofAmino, CommitmentProofSDKType } from "../../../../proofs"; +import { CommitmentProof, CommitmentProofAmino, CommitmentProofSDKType } from "../../../../cosmos/ics23/v1/proofs"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** diff --git a/src/codegen/ibc/core/connection/v1/query.lcd.ts b/src/codegen/ibc/core/connection/v1/query.lcd.ts index 30e10b8..95a6d73 100644 --- a/src/codegen/ibc/core/connection/v1/query.lcd.ts +++ b/src/codegen/ibc/core/connection/v1/query.lcd.ts @@ -1,6 +1,6 @@ import { setPaginationParams } from "../../../../helpers"; import { LCDClient } from "@cosmology/lcd"; -import { QueryConnectionRequest, QueryConnectionResponseSDKType, QueryConnectionsRequest, QueryConnectionsResponseSDKType, QueryClientConnectionsRequest, QueryClientConnectionsResponseSDKType, QueryConnectionClientStateRequest, QueryConnectionClientStateResponseSDKType, QueryConnectionConsensusStateRequest, QueryConnectionConsensusStateResponseSDKType } from "./query"; +import { QueryConnectionRequest, QueryConnectionResponseSDKType, QueryConnectionsRequest, QueryConnectionsResponseSDKType, QueryClientConnectionsRequest, QueryClientConnectionsResponseSDKType, QueryConnectionClientStateRequest, QueryConnectionClientStateResponseSDKType, QueryConnectionConsensusStateRequest, QueryConnectionConsensusStateResponseSDKType, QueryConnectionParamsRequest, QueryConnectionParamsResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; constructor({ @@ -14,6 +14,7 @@ export class LCDQueryClient { this.clientConnections = this.clientConnections.bind(this); this.connectionClientState = this.connectionClientState.bind(this); this.connectionConsensusState = this.connectionConsensusState.bind(this); + this.connectionParams = this.connectionParams.bind(this); } /* Connection queries an IBC connection end. */ async connection(params: QueryConnectionRequest): Promise { @@ -51,4 +52,9 @@ export class LCDQueryClient { const endpoint = `ibc/core/connection/v1/connections/${params.connectionId}/consensus_state/revision/${params.revisionNumber}/height/${params.revisionHeight}`; return await this.req.get(endpoint); } + /* ConnectionParams queries all parameters of the ibc connection submodule. */ + async connectionParams(_params: QueryConnectionParamsRequest = {}): Promise { + const endpoint = `ibc/core/connection/v1/params`; + return await this.req.get(endpoint); + } } \ No newline at end of file diff --git a/src/codegen/ibc/core/connection/v1/query.rpc.Query.ts b/src/codegen/ibc/core/connection/v1/query.rpc.Query.ts index e702220..5f3189a 100644 --- a/src/codegen/ibc/core/connection/v1/query.rpc.Query.ts +++ b/src/codegen/ibc/core/connection/v1/query.rpc.Query.ts @@ -1,7 +1,7 @@ import { Rpc } from "../../../../helpers"; import { BinaryReader } from "../../../../binary"; import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; -import { QueryConnectionRequest, QueryConnectionResponse, QueryConnectionsRequest, QueryConnectionsResponse, QueryClientConnectionsRequest, QueryClientConnectionsResponse, QueryConnectionClientStateRequest, QueryConnectionClientStateResponse, QueryConnectionConsensusStateRequest, QueryConnectionConsensusStateResponse } from "./query"; +import { QueryConnectionRequest, QueryConnectionResponse, QueryConnectionsRequest, QueryConnectionsResponse, QueryClientConnectionsRequest, QueryClientConnectionsResponse, QueryConnectionClientStateRequest, QueryConnectionClientStateResponse, QueryConnectionConsensusStateRequest, QueryConnectionConsensusStateResponse, QueryConnectionParamsRequest, QueryConnectionParamsResponse } from "./query"; /** Query provides defines the gRPC querier service */ export interface Query { /** Connection queries an IBC connection end. */ @@ -23,6 +23,8 @@ export interface Query { * connection. */ connectionConsensusState(request: QueryConnectionConsensusStateRequest): Promise; + /** ConnectionParams queries all parameters of the ibc connection submodule. */ + connectionParams(request?: QueryConnectionParamsRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -33,6 +35,7 @@ export class QueryClientImpl implements Query { this.clientConnections = this.clientConnections.bind(this); this.connectionClientState = this.connectionClientState.bind(this); this.connectionConsensusState = this.connectionConsensusState.bind(this); + this.connectionParams = this.connectionParams.bind(this); } connection(request: QueryConnectionRequest): Promise { const data = QueryConnectionRequest.encode(request).finish(); @@ -61,6 +64,11 @@ export class QueryClientImpl implements Query { const promise = this.rpc.request("ibc.core.connection.v1.Query", "ConnectionConsensusState", data); return promise.then(data => QueryConnectionConsensusStateResponse.decode(new BinaryReader(data))); } + connectionParams(request: QueryConnectionParamsRequest = {}): Promise { + const data = QueryConnectionParamsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Query", "ConnectionParams", data); + return promise.then(data => QueryConnectionParamsResponse.decode(new BinaryReader(data))); + } } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -80,6 +88,9 @@ export const createRpcQueryExtension = (base: QueryClient) => { }, connectionConsensusState(request: QueryConnectionConsensusStateRequest): Promise { return queryService.connectionConsensusState(request); + }, + connectionParams(request?: QueryConnectionParamsRequest): Promise { + return queryService.connectionParams(request); } }; }; \ No newline at end of file diff --git a/src/codegen/ibc/core/connection/v1/query.ts b/src/codegen/ibc/core/connection/v1/query.ts index 2ef715c..af8bfbc 100644 --- a/src/codegen/ibc/core/connection/v1/query.ts +++ b/src/codegen/ibc/core/connection/v1/query.ts @@ -1,6 +1,6 @@ import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../../cosmos/base/query/v1beta1/pagination"; import { ConnectionEnd, ConnectionEndAmino, ConnectionEndSDKType, IdentifiedConnection, IdentifiedConnectionAmino, IdentifiedConnectionSDKType } from "./connection"; -import { Height, HeightAmino, HeightSDKType, IdentifiedClientState, IdentifiedClientStateAmino, IdentifiedClientStateSDKType } from "../../client/v1/client"; +import { Height, HeightAmino, HeightSDKType, IdentifiedClientState, IdentifiedClientStateAmino, IdentifiedClientStateSDKType, Params, ParamsAmino, ParamsSDKType } from "../../client/v1/client"; import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; @@ -376,6 +376,42 @@ export interface QueryConnectionConsensusStateResponseSDKType { proof: Uint8Array; proof_height: HeightSDKType; } +/** QueryConnectionParamsRequest is the request type for the Query/ConnectionParams RPC method. */ +export interface QueryConnectionParamsRequest {} +export interface QueryConnectionParamsRequestProtoMsg { + typeUrl: "/ibc.core.connection.v1.QueryConnectionParamsRequest"; + value: Uint8Array; +} +/** QueryConnectionParamsRequest is the request type for the Query/ConnectionParams RPC method. */ +export interface QueryConnectionParamsRequestAmino {} +export interface QueryConnectionParamsRequestAminoMsg { + type: "cosmos-sdk/QueryConnectionParamsRequest"; + value: QueryConnectionParamsRequestAmino; +} +/** QueryConnectionParamsRequest is the request type for the Query/ConnectionParams RPC method. */ +export interface QueryConnectionParamsRequestSDKType {} +/** QueryConnectionParamsResponse is the response type for the Query/ConnectionParams RPC method. */ +export interface QueryConnectionParamsResponse { + /** params defines the parameters of the module. */ + params?: Params; +} +export interface QueryConnectionParamsResponseProtoMsg { + typeUrl: "/ibc.core.connection.v1.QueryConnectionParamsResponse"; + value: Uint8Array; +} +/** QueryConnectionParamsResponse is the response type for the Query/ConnectionParams RPC method. */ +export interface QueryConnectionParamsResponseAmino { + /** params defines the parameters of the module. */ + params?: ParamsAmino; +} +export interface QueryConnectionParamsResponseAminoMsg { + type: "cosmos-sdk/QueryConnectionParamsResponse"; + value: QueryConnectionParamsResponseAmino; +} +/** QueryConnectionParamsResponse is the response type for the Query/ConnectionParams RPC method. */ +export interface QueryConnectionParamsResponseSDKType { + params?: ParamsSDKType; +} function createBaseQueryConnectionRequest(): QueryConnectionRequest { return { connectionId: "" @@ -1225,4 +1261,129 @@ export const QueryConnectionConsensusStateResponse = { value: QueryConnectionConsensusStateResponse.encode(message).finish() }; } +}; +function createBaseQueryConnectionParamsRequest(): QueryConnectionParamsRequest { + return {}; +} +export const QueryConnectionParamsRequest = { + typeUrl: "/ibc.core.connection.v1.QueryConnectionParamsRequest", + encode(_: QueryConnectionParamsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryConnectionParamsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionParamsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): QueryConnectionParamsRequest { + const message = createBaseQueryConnectionParamsRequest(); + return message; + }, + fromAmino(_: QueryConnectionParamsRequestAmino): QueryConnectionParamsRequest { + const message = createBaseQueryConnectionParamsRequest(); + return message; + }, + toAmino(_: QueryConnectionParamsRequest): QueryConnectionParamsRequestAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: QueryConnectionParamsRequestAminoMsg): QueryConnectionParamsRequest { + return QueryConnectionParamsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryConnectionParamsRequest): QueryConnectionParamsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryConnectionParamsRequest", + value: QueryConnectionParamsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryConnectionParamsRequestProtoMsg): QueryConnectionParamsRequest { + return QueryConnectionParamsRequest.decode(message.value); + }, + toProto(message: QueryConnectionParamsRequest): Uint8Array { + return QueryConnectionParamsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryConnectionParamsRequest): QueryConnectionParamsRequestProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.QueryConnectionParamsRequest", + value: QueryConnectionParamsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryConnectionParamsResponse(): QueryConnectionParamsResponse { + return { + params: undefined + }; +} +export const QueryConnectionParamsResponse = { + typeUrl: "/ibc.core.connection.v1.QueryConnectionParamsResponse", + encode(message: QueryConnectionParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryConnectionParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryConnectionParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryConnectionParamsResponse { + const message = createBaseQueryConnectionParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: QueryConnectionParamsResponseAmino): QueryConnectionParamsResponse { + const message = createBaseQueryConnectionParamsResponse(); + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: QueryConnectionParamsResponse): QueryConnectionParamsResponseAmino { + const obj: any = {}; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: QueryConnectionParamsResponseAminoMsg): QueryConnectionParamsResponse { + return QueryConnectionParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryConnectionParamsResponse): QueryConnectionParamsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryConnectionParamsResponse", + value: QueryConnectionParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryConnectionParamsResponseProtoMsg): QueryConnectionParamsResponse { + return QueryConnectionParamsResponse.decode(message.value); + }, + toProto(message: QueryConnectionParamsResponse): Uint8Array { + return QueryConnectionParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryConnectionParamsResponse): QueryConnectionParamsResponseProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.QueryConnectionParamsResponse", + value: QueryConnectionParamsResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/src/codegen/ibc/core/connection/v1/tx.amino.ts b/src/codegen/ibc/core/connection/v1/tx.amino.ts index 1ad5770..719f737 100644 --- a/src/codegen/ibc/core/connection/v1/tx.amino.ts +++ b/src/codegen/ibc/core/connection/v1/tx.amino.ts @@ -1,4 +1,4 @@ -import { MsgConnectionOpenInit, MsgConnectionOpenTry, MsgConnectionOpenAck, MsgConnectionOpenConfirm } from "./tx"; +import { MsgConnectionOpenInit, MsgConnectionOpenTry, MsgConnectionOpenAck, MsgConnectionOpenConfirm, MsgUpdateParams } from "./tx"; export const AminoConverter = { "/ibc.core.connection.v1.MsgConnectionOpenInit": { aminoType: "cosmos-sdk/MsgConnectionOpenInit", @@ -19,5 +19,10 @@ export const AminoConverter = { aminoType: "cosmos-sdk/MsgConnectionOpenConfirm", toAmino: MsgConnectionOpenConfirm.toAmino, fromAmino: MsgConnectionOpenConfirm.fromAmino + }, + "/ibc.core.connection.v1.MsgUpdateParams": { + aminoType: "cosmos-sdk/MsgUpdateParams", + toAmino: MsgUpdateParams.toAmino, + fromAmino: MsgUpdateParams.fromAmino } }; \ No newline at end of file diff --git a/src/codegen/ibc/core/connection/v1/tx.registry.ts b/src/codegen/ibc/core/connection/v1/tx.registry.ts index 2737361..cb73ff9 100644 --- a/src/codegen/ibc/core/connection/v1/tx.registry.ts +++ b/src/codegen/ibc/core/connection/v1/tx.registry.ts @@ -1,6 +1,6 @@ import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgConnectionOpenInit, MsgConnectionOpenTry, MsgConnectionOpenAck, MsgConnectionOpenConfirm } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.core.connection.v1.MsgConnectionOpenInit", MsgConnectionOpenInit], ["/ibc.core.connection.v1.MsgConnectionOpenTry", MsgConnectionOpenTry], ["/ibc.core.connection.v1.MsgConnectionOpenAck", MsgConnectionOpenAck], ["/ibc.core.connection.v1.MsgConnectionOpenConfirm", MsgConnectionOpenConfirm]]; +import { MsgConnectionOpenInit, MsgConnectionOpenTry, MsgConnectionOpenAck, MsgConnectionOpenConfirm, MsgUpdateParams } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.core.connection.v1.MsgConnectionOpenInit", MsgConnectionOpenInit], ["/ibc.core.connection.v1.MsgConnectionOpenTry", MsgConnectionOpenTry], ["/ibc.core.connection.v1.MsgConnectionOpenAck", MsgConnectionOpenAck], ["/ibc.core.connection.v1.MsgConnectionOpenConfirm", MsgConnectionOpenConfirm], ["/ibc.core.connection.v1.MsgUpdateParams", MsgUpdateParams]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -31,6 +31,12 @@ export const MessageComposer = { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm", value: MsgConnectionOpenConfirm.encode(value).finish() }; + }, + updateConnectionParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(value).finish() + }; } }, withTypeUrl: { @@ -57,6 +63,12 @@ export const MessageComposer = { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm", value }; + }, + updateConnectionParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParams", + value + }; } }, fromPartial: { @@ -83,6 +95,12 @@ export const MessageComposer = { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenConfirm", value: MsgConnectionOpenConfirm.fromPartial(value) }; + }, + updateConnectionParams(value: MsgUpdateParams) { + return { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParams", + value: MsgUpdateParams.fromPartial(value) + }; } } }; \ No newline at end of file diff --git a/src/codegen/ibc/core/connection/v1/tx.rpc.msg.ts b/src/codegen/ibc/core/connection/v1/tx.rpc.msg.ts index d5a2127..7344961 100644 --- a/src/codegen/ibc/core/connection/v1/tx.rpc.msg.ts +++ b/src/codegen/ibc/core/connection/v1/tx.rpc.msg.ts @@ -1,6 +1,6 @@ import { Rpc } from "../../../../helpers"; import { BinaryReader } from "../../../../binary"; -import { MsgConnectionOpenInit, MsgConnectionOpenInitResponse, MsgConnectionOpenTry, MsgConnectionOpenTryResponse, MsgConnectionOpenAck, MsgConnectionOpenAckResponse, MsgConnectionOpenConfirm, MsgConnectionOpenConfirmResponse } from "./tx"; +import { MsgConnectionOpenInit, MsgConnectionOpenInitResponse, MsgConnectionOpenTry, MsgConnectionOpenTryResponse, MsgConnectionOpenAck, MsgConnectionOpenAckResponse, MsgConnectionOpenConfirm, MsgConnectionOpenConfirmResponse, MsgUpdateParams, MsgUpdateParamsResponse } from "./tx"; /** Msg defines the ibc/connection Msg service. */ export interface Msg { /** ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. */ @@ -14,6 +14,11 @@ export interface Msg { * MsgConnectionOpenConfirm. */ connectionOpenConfirm(request: MsgConnectionOpenConfirm): Promise; + /** + * UpdateConnectionParams defines a rpc handler method for + * MsgUpdateParams. + */ + updateConnectionParams(request: MsgUpdateParams): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -23,6 +28,7 @@ export class MsgClientImpl implements Msg { this.connectionOpenTry = this.connectionOpenTry.bind(this); this.connectionOpenAck = this.connectionOpenAck.bind(this); this.connectionOpenConfirm = this.connectionOpenConfirm.bind(this); + this.updateConnectionParams = this.updateConnectionParams.bind(this); } connectionOpenInit(request: MsgConnectionOpenInit): Promise { const data = MsgConnectionOpenInit.encode(request).finish(); @@ -44,4 +50,9 @@ export class MsgClientImpl implements Msg { const promise = this.rpc.request("ibc.core.connection.v1.Msg", "ConnectionOpenConfirm", data); return promise.then(data => MsgConnectionOpenConfirmResponse.decode(new BinaryReader(data))); } + updateConnectionParams(request: MsgUpdateParams): Promise { + const data = MsgUpdateParams.encode(request).finish(); + const promise = this.rpc.request("ibc.core.connection.v1.Msg", "UpdateConnectionParams", data); + return promise.then(data => MsgUpdateParamsResponse.decode(new BinaryReader(data))); + } } \ No newline at end of file diff --git a/src/codegen/ibc/core/connection/v1/tx.ts b/src/codegen/ibc/core/connection/v1/tx.ts index 2818f70..b84b54b 100644 --- a/src/codegen/ibc/core/connection/v1/tx.ts +++ b/src/codegen/ibc/core/connection/v1/tx.ts @@ -1,6 +1,6 @@ import { Counterparty, CounterpartyAmino, CounterpartySDKType, Version, VersionAmino, VersionSDKType } from "./connection"; import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; -import { Height, HeightAmino, HeightSDKType } from "../../client/v1/client"; +import { Height, HeightAmino, HeightSDKType, Params, ParamsAmino, ParamsSDKType } from "../../client/v1/client"; import { BinaryReader, BinaryWriter } from "../../../../binary"; import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; /** @@ -92,6 +92,8 @@ export interface MsgConnectionOpenTry { proofConsensus: Uint8Array; consensusHeight: Height; signer: string; + /** optional proof data for host state machines that are unable to introspect their own consensus state */ + hostConsensusStateProof: Uint8Array; } export interface MsgConnectionOpenTryProtoMsg { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenTry"; @@ -122,6 +124,8 @@ export interface MsgConnectionOpenTryAmino { proof_consensus?: string; consensus_height?: HeightAmino; signer?: string; + /** optional proof data for host state machines that are unable to introspect their own consensus state */ + host_consensus_state_proof?: string; } export interface MsgConnectionOpenTryAminoMsg { type: "cosmos-sdk/MsgConnectionOpenTry"; @@ -145,6 +149,7 @@ export interface MsgConnectionOpenTrySDKType { proof_consensus: Uint8Array; consensus_height: HeightSDKType; signer: string; + host_consensus_state_proof: Uint8Array; } /** MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. */ export interface MsgConnectionOpenTryResponse {} @@ -181,6 +186,8 @@ export interface MsgConnectionOpenAck { proofConsensus: Uint8Array; consensusHeight: Height; signer: string; + /** optional proof data for host state machines that are unable to introspect their own consensus state */ + hostConsensusStateProof: Uint8Array; } export interface MsgConnectionOpenAckProtoMsg { typeUrl: "/ibc.core.connection.v1.MsgConnectionOpenAck"; @@ -207,6 +214,8 @@ export interface MsgConnectionOpenAckAmino { proof_consensus?: string; consensus_height?: HeightAmino; signer?: string; + /** optional proof data for host state machines that are unable to introspect their own consensus state */ + host_consensus_state_proof?: string; } export interface MsgConnectionOpenAckAminoMsg { type: "cosmos-sdk/MsgConnectionOpenAck"; @@ -227,6 +236,7 @@ export interface MsgConnectionOpenAckSDKType { proof_consensus: Uint8Array; consensus_height: HeightSDKType; signer: string; + host_consensus_state_proof: Uint8Array; } /** MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. */ export interface MsgConnectionOpenAckResponse {} @@ -305,6 +315,55 @@ export interface MsgConnectionOpenConfirmResponseAminoMsg { * response type. */ export interface MsgConnectionOpenConfirmResponseSDKType {} +/** MsgUpdateParams defines the sdk.Msg type to update the connection parameters. */ +export interface MsgUpdateParams { + /** signer address */ + signer: string; + /** + * params defines the connection parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params: Params; +} +export interface MsgUpdateParamsProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParams"; + value: Uint8Array; +} +/** MsgUpdateParams defines the sdk.Msg type to update the connection parameters. */ +export interface MsgUpdateParamsAmino { + /** signer address */ + signer?: string; + /** + * params defines the connection parameters to update. + * + * NOTE: All parameters must be supplied. + */ + params?: ParamsAmino; +} +export interface MsgUpdateParamsAminoMsg { + type: "cosmos-sdk/MsgUpdateParams"; + value: MsgUpdateParamsAmino; +} +/** MsgUpdateParams defines the sdk.Msg type to update the connection parameters. */ +export interface MsgUpdateParamsSDKType { + signer: string; + params: ParamsSDKType; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponse {} +export interface MsgUpdateParamsResponseProtoMsg { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParamsResponse"; + value: Uint8Array; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponseAmino {} +export interface MsgUpdateParamsResponseAminoMsg { + type: "cosmos-sdk/MsgUpdateParamsResponse"; + value: MsgUpdateParamsResponseAmino; +} +/** MsgUpdateParamsResponse defines the MsgUpdateParams response type. */ +export interface MsgUpdateParamsResponseSDKType {} function createBaseMsgConnectionOpenInit(): MsgConnectionOpenInit { return { clientId: "", @@ -491,7 +550,8 @@ function createBaseMsgConnectionOpenTry(): MsgConnectionOpenTry { proofClient: new Uint8Array(), proofConsensus: new Uint8Array(), consensusHeight: Height.fromPartial({}), - signer: "" + signer: "", + hostConsensusStateProof: new Uint8Array() }; } export const MsgConnectionOpenTry = { @@ -533,6 +593,9 @@ export const MsgConnectionOpenTry = { if (message.signer !== "") { writer.uint32(98).string(message.signer); } + if (message.hostConsensusStateProof.length !== 0) { + writer.uint32(106).bytes(message.hostConsensusStateProof); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): MsgConnectionOpenTry { @@ -578,6 +641,9 @@ export const MsgConnectionOpenTry = { case 12: message.signer = reader.string(); break; + case 13: + message.hostConsensusStateProof = reader.bytes(); + break; default: reader.skipType(tag & 7); break; @@ -599,6 +665,7 @@ export const MsgConnectionOpenTry = { message.proofConsensus = object.proofConsensus ?? new Uint8Array(); message.consensusHeight = object.consensusHeight !== undefined && object.consensusHeight !== null ? Height.fromPartial(object.consensusHeight) : undefined; message.signer = object.signer ?? ""; + message.hostConsensusStateProof = object.hostConsensusStateProof ?? new Uint8Array(); return message; }, fromAmino(object: MsgConnectionOpenTryAmino): MsgConnectionOpenTry { @@ -637,6 +704,9 @@ export const MsgConnectionOpenTry = { if (object.signer !== undefined && object.signer !== null) { message.signer = object.signer; } + if (object.host_consensus_state_proof !== undefined && object.host_consensus_state_proof !== null) { + message.hostConsensusStateProof = bytesFromBase64(object.host_consensus_state_proof); + } return message; }, toAmino(message: MsgConnectionOpenTry): MsgConnectionOpenTryAmino { @@ -657,6 +727,7 @@ export const MsgConnectionOpenTry = { obj.proof_consensus = message.proofConsensus ? base64FromBytes(message.proofConsensus) : undefined; obj.consensus_height = message.consensusHeight ? Height.toAmino(message.consensusHeight) : {}; obj.signer = message.signer === "" ? undefined : message.signer; + obj.host_consensus_state_proof = message.hostConsensusStateProof ? base64FromBytes(message.hostConsensusStateProof) : undefined; return obj; }, fromAminoMsg(object: MsgConnectionOpenTryAminoMsg): MsgConnectionOpenTry { @@ -748,7 +819,8 @@ function createBaseMsgConnectionOpenAck(): MsgConnectionOpenAck { proofClient: new Uint8Array(), proofConsensus: new Uint8Array(), consensusHeight: Height.fromPartial({}), - signer: "" + signer: "", + hostConsensusStateProof: new Uint8Array() }; } export const MsgConnectionOpenAck = { @@ -784,6 +856,9 @@ export const MsgConnectionOpenAck = { if (message.signer !== "") { writer.uint32(82).string(message.signer); } + if (message.hostConsensusStateProof.length !== 0) { + writer.uint32(90).bytes(message.hostConsensusStateProof); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): MsgConnectionOpenAck { @@ -823,6 +898,9 @@ export const MsgConnectionOpenAck = { case 10: message.signer = reader.string(); break; + case 11: + message.hostConsensusStateProof = reader.bytes(); + break; default: reader.skipType(tag & 7); break; @@ -842,6 +920,7 @@ export const MsgConnectionOpenAck = { message.proofConsensus = object.proofConsensus ?? new Uint8Array(); message.consensusHeight = object.consensusHeight !== undefined && object.consensusHeight !== null ? Height.fromPartial(object.consensusHeight) : undefined; message.signer = object.signer ?? ""; + message.hostConsensusStateProof = object.hostConsensusStateProof ?? new Uint8Array(); return message; }, fromAmino(object: MsgConnectionOpenAckAmino): MsgConnectionOpenAck { @@ -876,6 +955,9 @@ export const MsgConnectionOpenAck = { if (object.signer !== undefined && object.signer !== null) { message.signer = object.signer; } + if (object.host_consensus_state_proof !== undefined && object.host_consensus_state_proof !== null) { + message.hostConsensusStateProof = bytesFromBase64(object.host_consensus_state_proof); + } return message; }, toAmino(message: MsgConnectionOpenAck): MsgConnectionOpenAckAmino { @@ -890,6 +972,7 @@ export const MsgConnectionOpenAck = { obj.proof_consensus = message.proofConsensus ? base64FromBytes(message.proofConsensus) : undefined; obj.consensus_height = message.consensusHeight ? Height.toAmino(message.consensusHeight) : {}; obj.signer = message.signer === "" ? undefined : message.signer; + obj.host_consensus_state_proof = message.hostConsensusStateProof ? base64FromBytes(message.hostConsensusStateProof) : undefined; return obj; }, fromAminoMsg(object: MsgConnectionOpenAckAminoMsg): MsgConnectionOpenAck { @@ -1130,4 +1213,141 @@ export const MsgConnectionOpenConfirmResponse = { value: MsgConnectionOpenConfirmResponse.encode(message).finish() }; } +}; +function createBaseMsgUpdateParams(): MsgUpdateParams { + return { + signer: "", + params: Params.fromPartial({}) + }; +} +export const MsgUpdateParams = { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParams", + encode(message: MsgUpdateParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.params = Params.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + message.signer = object.signer ?? ""; + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + fromAmino(object: MsgUpdateParamsAmino): MsgUpdateParams { + const message = createBaseMsgUpdateParams(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.params !== undefined && object.params !== null) { + message.params = Params.fromAmino(object.params); + } + return message; + }, + toAmino(message: MsgUpdateParams): MsgUpdateParamsAmino { + const obj: any = {}; + obj.signer = message.signer === "" ? undefined : message.signer; + obj.params = message.params ? Params.toAmino(message.params) : undefined; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsAminoMsg): MsgUpdateParams { + return MsgUpdateParams.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParams): MsgUpdateParamsAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParams", + value: MsgUpdateParams.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsProtoMsg): MsgUpdateParams { + return MsgUpdateParams.decode(message.value); + }, + toProto(message: MsgUpdateParams): Uint8Array { + return MsgUpdateParams.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParams): MsgUpdateParamsProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParams", + value: MsgUpdateParams.encode(message).finish() + }; + } +}; +function createBaseMsgUpdateParamsResponse(): MsgUpdateParamsResponse { + return {}; +} +export const MsgUpdateParamsResponse = { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParamsResponse", + encode(_: MsgUpdateParamsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgUpdateParamsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUpdateParamsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + fromAmino(_: MsgUpdateParamsResponseAmino): MsgUpdateParamsResponse { + const message = createBaseMsgUpdateParamsResponse(); + return message; + }, + toAmino(_: MsgUpdateParamsResponse): MsgUpdateParamsResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgUpdateParamsResponseAminoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseAminoMsg { + return { + type: "cosmos-sdk/MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgUpdateParamsResponseProtoMsg): MsgUpdateParamsResponse { + return MsgUpdateParamsResponse.decode(message.value); + }, + toProto(message: MsgUpdateParamsResponse): Uint8Array { + return MsgUpdateParamsResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgUpdateParamsResponse): MsgUpdateParamsResponseProtoMsg { + return { + typeUrl: "/ibc.core.connection.v1.MsgUpdateParamsResponse", + value: MsgUpdateParamsResponse.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/src/codegen/ibc/lcd.ts b/src/codegen/ibc/lcd.ts index ae8e636..4e57284 100644 --- a/src/codegen/ibc/lcd.ts +++ b/src/codegen/ibc/lcd.ts @@ -36,6 +36,16 @@ export const createLCDClient = async ({ }) } }, + circuit: { + v1: new (await import("../cosmos/circuit/v1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, + consensus: { + v1: new (await import("../cosmos/consensus/v1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, distribution: { v1beta1: new (await import("../cosmos/distribution/v1beta1/query.lcd")).LCDQueryClient({ requestClient @@ -52,15 +62,28 @@ export const createLCDClient = async ({ }) }, gov: { + v1: new (await import("../cosmos/gov/v1/query.lcd")).LCDQueryClient({ + requestClient + }), v1beta1: new (await import("../cosmos/gov/v1beta1/query.lcd")).LCDQueryClient({ requestClient }) }, + group: { + v1: new (await import("../cosmos/group/v1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, mint: { v1beta1: new (await import("../cosmos/mint/v1beta1/query.lcd")).LCDQueryClient({ requestClient }) }, + nft: { + v1beta1: new (await import("../cosmos/nft/v1beta1/query.lcd")).LCDQueryClient({ + requestClient + }) + }, params: { v1beta1: new (await import("../cosmos/params/v1beta1/query.lcd")).LCDQueryClient({ requestClient @@ -128,6 +151,13 @@ export const createLCDClient = async ({ requestClient }) } + }, + lightclients: { + wasm: { + v1: new (await import("./lightclients/wasm/v1/query.lcd")).LCDQueryClient({ + requestClient + }) + } } } }; diff --git a/src/codegen/ibc/lightclients/localhost/v2/localhost.ts b/src/codegen/ibc/lightclients/localhost/v2/localhost.ts new file mode 100644 index 0000000..98f1fcc --- /dev/null +++ b/src/codegen/ibc/lightclients/localhost/v2/localhost.ts @@ -0,0 +1,93 @@ +import { Height, HeightAmino, HeightSDKType } from "../../../core/client/v1/client"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +/** ClientState defines the 09-localhost client state */ +export interface ClientState { + /** the latest block height */ + latestHeight: Height; +} +export interface ClientStateProtoMsg { + typeUrl: "/ibc.lightclients.localhost.v2.ClientState"; + value: Uint8Array; +} +/** ClientState defines the 09-localhost client state */ +export interface ClientStateAmino { + /** the latest block height */ + latest_height?: HeightAmino; +} +export interface ClientStateAminoMsg { + type: "cosmos-sdk/ClientState"; + value: ClientStateAmino; +} +/** ClientState defines the 09-localhost client state */ +export interface ClientStateSDKType { + latest_height: HeightSDKType; +} +function createBaseClientState(): ClientState { + return { + latestHeight: Height.fromPartial({}) + }; +} +export const ClientState = { + typeUrl: "/ibc.lightclients.localhost.v2.ClientState", + encode(message: ClientState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.latestHeight !== undefined) { + Height.encode(message.latestHeight, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ClientState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.latestHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ClientState { + const message = createBaseClientState(); + message.latestHeight = object.latestHeight !== undefined && object.latestHeight !== null ? Height.fromPartial(object.latestHeight) : undefined; + return message; + }, + fromAmino(object: ClientStateAmino): ClientState { + const message = createBaseClientState(); + if (object.latest_height !== undefined && object.latest_height !== null) { + message.latestHeight = Height.fromAmino(object.latest_height); + } + return message; + }, + toAmino(message: ClientState): ClientStateAmino { + const obj: any = {}; + obj.latest_height = message.latestHeight ? Height.toAmino(message.latestHeight) : {}; + return obj; + }, + fromAminoMsg(object: ClientStateAminoMsg): ClientState { + return ClientState.fromAmino(object.value); + }, + toAminoMsg(message: ClientState): ClientStateAminoMsg { + return { + type: "cosmos-sdk/ClientState", + value: ClientState.toAmino(message) + }; + }, + fromProtoMsg(message: ClientStateProtoMsg): ClientState { + return ClientState.decode(message.value); + }, + toProto(message: ClientState): Uint8Array { + return ClientState.encode(message).finish(); + }, + toProtoMsg(message: ClientState): ClientStateProtoMsg { + return { + typeUrl: "/ibc.lightclients.localhost.v2.ClientState", + value: ClientState.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/ibc/lightclients/solomachine/v3/solomachine.ts b/src/codegen/ibc/lightclients/solomachine/v3/solomachine.ts new file mode 100644 index 0000000..51d2ddc --- /dev/null +++ b/src/codegen/ibc/lightclients/solomachine/v3/solomachine.ts @@ -0,0 +1,1063 @@ +import { Any, AnyAmino, AnySDKType } from "../../../../google/protobuf/any"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** + * ClientState defines a solo machine client that tracks the current consensus + * state and if the client is frozen. + */ +export interface ClientState { + /** latest sequence of the client state */ + sequence: bigint; + /** frozen sequence of the solo machine */ + isFrozen: boolean; + consensusState?: ConsensusState; +} +export interface ClientStateProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v3.ClientState"; + value: Uint8Array; +} +/** + * ClientState defines a solo machine client that tracks the current consensus + * state and if the client is frozen. + */ +export interface ClientStateAmino { + /** latest sequence of the client state */ + sequence?: string; + /** frozen sequence of the solo machine */ + is_frozen?: boolean; + consensus_state?: ConsensusStateAmino; +} +export interface ClientStateAminoMsg { + type: "cosmos-sdk/ClientState"; + value: ClientStateAmino; +} +/** + * ClientState defines a solo machine client that tracks the current consensus + * state and if the client is frozen. + */ +export interface ClientStateSDKType { + sequence: bigint; + is_frozen: boolean; + consensus_state?: ConsensusStateSDKType; +} +/** + * ConsensusState defines a solo machine consensus state. The sequence of a + * consensus state is contained in the "height" key used in storing the + * consensus state. + */ +export interface ConsensusState { + /** public key of the solo machine */ + publicKey?: Any; + /** + * diversifier allows the same public key to be re-used across different solo + * machine clients (potentially on different chains) without being considered + * misbehaviour. + */ + diversifier: string; + timestamp: bigint; +} +export interface ConsensusStateProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v3.ConsensusState"; + value: Uint8Array; +} +/** + * ConsensusState defines a solo machine consensus state. The sequence of a + * consensus state is contained in the "height" key used in storing the + * consensus state. + */ +export interface ConsensusStateAmino { + /** public key of the solo machine */ + public_key?: AnyAmino; + /** + * diversifier allows the same public key to be re-used across different solo + * machine clients (potentially on different chains) without being considered + * misbehaviour. + */ + diversifier?: string; + timestamp?: string; +} +export interface ConsensusStateAminoMsg { + type: "cosmos-sdk/ConsensusState"; + value: ConsensusStateAmino; +} +/** + * ConsensusState defines a solo machine consensus state. The sequence of a + * consensus state is contained in the "height" key used in storing the + * consensus state. + */ +export interface ConsensusStateSDKType { + public_key?: AnySDKType; + diversifier: string; + timestamp: bigint; +} +/** Header defines a solo machine consensus header */ +export interface Header { + timestamp: bigint; + signature: Uint8Array; + newPublicKey?: Any; + newDiversifier: string; +} +export interface HeaderProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v3.Header"; + value: Uint8Array; +} +/** Header defines a solo machine consensus header */ +export interface HeaderAmino { + timestamp?: string; + signature?: string; + new_public_key?: AnyAmino; + new_diversifier?: string; +} +export interface HeaderAminoMsg { + type: "cosmos-sdk/Header"; + value: HeaderAmino; +} +/** Header defines a solo machine consensus header */ +export interface HeaderSDKType { + timestamp: bigint; + signature: Uint8Array; + new_public_key?: AnySDKType; + new_diversifier: string; +} +/** + * Misbehaviour defines misbehaviour for a solo machine which consists + * of a sequence and two signatures over different messages at that sequence. + */ +export interface Misbehaviour { + sequence: bigint; + signatureOne?: SignatureAndData; + signatureTwo?: SignatureAndData; +} +export interface MisbehaviourProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v3.Misbehaviour"; + value: Uint8Array; +} +/** + * Misbehaviour defines misbehaviour for a solo machine which consists + * of a sequence and two signatures over different messages at that sequence. + */ +export interface MisbehaviourAmino { + sequence?: string; + signature_one?: SignatureAndDataAmino; + signature_two?: SignatureAndDataAmino; +} +export interface MisbehaviourAminoMsg { + type: "cosmos-sdk/Misbehaviour"; + value: MisbehaviourAmino; +} +/** + * Misbehaviour defines misbehaviour for a solo machine which consists + * of a sequence and two signatures over different messages at that sequence. + */ +export interface MisbehaviourSDKType { + sequence: bigint; + signature_one?: SignatureAndDataSDKType; + signature_two?: SignatureAndDataSDKType; +} +/** + * SignatureAndData contains a signature and the data signed over to create that + * signature. + */ +export interface SignatureAndData { + signature: Uint8Array; + path: Uint8Array; + data: Uint8Array; + timestamp: bigint; +} +export interface SignatureAndDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v3.SignatureAndData"; + value: Uint8Array; +} +/** + * SignatureAndData contains a signature and the data signed over to create that + * signature. + */ +export interface SignatureAndDataAmino { + signature?: string; + path?: string; + data?: string; + timestamp?: string; +} +export interface SignatureAndDataAminoMsg { + type: "cosmos-sdk/SignatureAndData"; + value: SignatureAndDataAmino; +} +/** + * SignatureAndData contains a signature and the data signed over to create that + * signature. + */ +export interface SignatureAndDataSDKType { + signature: Uint8Array; + path: Uint8Array; + data: Uint8Array; + timestamp: bigint; +} +/** + * TimestampedSignatureData contains the signature data and the timestamp of the + * signature. + */ +export interface TimestampedSignatureData { + signatureData: Uint8Array; + timestamp: bigint; +} +export interface TimestampedSignatureDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v3.TimestampedSignatureData"; + value: Uint8Array; +} +/** + * TimestampedSignatureData contains the signature data and the timestamp of the + * signature. + */ +export interface TimestampedSignatureDataAmino { + signature_data?: string; + timestamp?: string; +} +export interface TimestampedSignatureDataAminoMsg { + type: "cosmos-sdk/TimestampedSignatureData"; + value: TimestampedSignatureDataAmino; +} +/** + * TimestampedSignatureData contains the signature data and the timestamp of the + * signature. + */ +export interface TimestampedSignatureDataSDKType { + signature_data: Uint8Array; + timestamp: bigint; +} +/** SignBytes defines the signed bytes used for signature verification. */ +export interface SignBytes { + /** the sequence number */ + sequence: bigint; + /** the proof timestamp */ + timestamp: bigint; + /** the public key diversifier */ + diversifier: string; + /** the standardised path bytes */ + path: Uint8Array; + /** the marshaled data bytes */ + data: Uint8Array; +} +export interface SignBytesProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v3.SignBytes"; + value: Uint8Array; +} +/** SignBytes defines the signed bytes used for signature verification. */ +export interface SignBytesAmino { + /** the sequence number */ + sequence?: string; + /** the proof timestamp */ + timestamp?: string; + /** the public key diversifier */ + diversifier?: string; + /** the standardised path bytes */ + path?: string; + /** the marshaled data bytes */ + data?: string; +} +export interface SignBytesAminoMsg { + type: "cosmos-sdk/SignBytes"; + value: SignBytesAmino; +} +/** SignBytes defines the signed bytes used for signature verification. */ +export interface SignBytesSDKType { + sequence: bigint; + timestamp: bigint; + diversifier: string; + path: Uint8Array; + data: Uint8Array; +} +/** HeaderData returns the SignBytes data for update verification. */ +export interface HeaderData { + /** header public key */ + newPubKey?: Any; + /** header diversifier */ + newDiversifier: string; +} +export interface HeaderDataProtoMsg { + typeUrl: "/ibc.lightclients.solomachine.v3.HeaderData"; + value: Uint8Array; +} +/** HeaderData returns the SignBytes data for update verification. */ +export interface HeaderDataAmino { + /** header public key */ + new_pub_key?: AnyAmino; + /** header diversifier */ + new_diversifier?: string; +} +export interface HeaderDataAminoMsg { + type: "cosmos-sdk/HeaderData"; + value: HeaderDataAmino; +} +/** HeaderData returns the SignBytes data for update verification. */ +export interface HeaderDataSDKType { + new_pub_key?: AnySDKType; + new_diversifier: string; +} +function createBaseClientState(): ClientState { + return { + sequence: BigInt(0), + isFrozen: false, + consensusState: undefined + }; +} +export const ClientState = { + typeUrl: "/ibc.lightclients.solomachine.v3.ClientState", + encode(message: ClientState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sequence !== BigInt(0)) { + writer.uint32(8).uint64(message.sequence); + } + if (message.isFrozen === true) { + writer.uint32(16).bool(message.isFrozen); + } + if (message.consensusState !== undefined) { + ConsensusState.encode(message.consensusState, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ClientState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequence = reader.uint64(); + break; + case 2: + message.isFrozen = reader.bool(); + break; + case 3: + message.consensusState = ConsensusState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ClientState { + const message = createBaseClientState(); + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + message.isFrozen = object.isFrozen ?? false; + message.consensusState = object.consensusState !== undefined && object.consensusState !== null ? ConsensusState.fromPartial(object.consensusState) : undefined; + return message; + }, + fromAmino(object: ClientStateAmino): ClientState { + const message = createBaseClientState(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.is_frozen !== undefined && object.is_frozen !== null) { + message.isFrozen = object.is_frozen; + } + if (object.consensus_state !== undefined && object.consensus_state !== null) { + message.consensusState = ConsensusState.fromAmino(object.consensus_state); + } + return message; + }, + toAmino(message: ClientState): ClientStateAmino { + const obj: any = {}; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; + obj.is_frozen = message.isFrozen === false ? undefined : message.isFrozen; + obj.consensus_state = message.consensusState ? ConsensusState.toAmino(message.consensusState) : undefined; + return obj; + }, + fromAminoMsg(object: ClientStateAminoMsg): ClientState { + return ClientState.fromAmino(object.value); + }, + toAminoMsg(message: ClientState): ClientStateAminoMsg { + return { + type: "cosmos-sdk/ClientState", + value: ClientState.toAmino(message) + }; + }, + fromProtoMsg(message: ClientStateProtoMsg): ClientState { + return ClientState.decode(message.value); + }, + toProto(message: ClientState): Uint8Array { + return ClientState.encode(message).finish(); + }, + toProtoMsg(message: ClientState): ClientStateProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v3.ClientState", + value: ClientState.encode(message).finish() + }; + } +}; +function createBaseConsensusState(): ConsensusState { + return { + publicKey: undefined, + diversifier: "", + timestamp: BigInt(0) + }; +} +export const ConsensusState = { + typeUrl: "/ibc.lightclients.solomachine.v3.ConsensusState", + encode(message: ConsensusState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.publicKey !== undefined) { + Any.encode(message.publicKey, writer.uint32(10).fork()).ldelim(); + } + if (message.diversifier !== "") { + writer.uint32(18).string(message.diversifier); + } + if (message.timestamp !== BigInt(0)) { + writer.uint32(24).uint64(message.timestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConsensusState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsensusState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publicKey = Any.decode(reader, reader.uint32()); + break; + case 2: + message.diversifier = reader.string(); + break; + case 3: + message.timestamp = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ConsensusState { + const message = createBaseConsensusState(); + message.publicKey = object.publicKey !== undefined && object.publicKey !== null ? Any.fromPartial(object.publicKey) : undefined; + message.diversifier = object.diversifier ?? ""; + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ConsensusStateAmino): ConsensusState { + const message = createBaseConsensusState(); + if (object.public_key !== undefined && object.public_key !== null) { + message.publicKey = Any.fromAmino(object.public_key); + } + if (object.diversifier !== undefined && object.diversifier !== null) { + message.diversifier = object.diversifier; + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + return message; + }, + toAmino(message: ConsensusState): ConsensusStateAmino { + const obj: any = {}; + obj.public_key = message.publicKey ? Any.toAmino(message.publicKey) : undefined; + obj.diversifier = message.diversifier === "" ? undefined : message.diversifier; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ConsensusStateAminoMsg): ConsensusState { + return ConsensusState.fromAmino(object.value); + }, + toAminoMsg(message: ConsensusState): ConsensusStateAminoMsg { + return { + type: "cosmos-sdk/ConsensusState", + value: ConsensusState.toAmino(message) + }; + }, + fromProtoMsg(message: ConsensusStateProtoMsg): ConsensusState { + return ConsensusState.decode(message.value); + }, + toProto(message: ConsensusState): Uint8Array { + return ConsensusState.encode(message).finish(); + }, + toProtoMsg(message: ConsensusState): ConsensusStateProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v3.ConsensusState", + value: ConsensusState.encode(message).finish() + }; + } +}; +function createBaseHeader(): Header { + return { + timestamp: BigInt(0), + signature: new Uint8Array(), + newPublicKey: undefined, + newDiversifier: "" + }; +} +export const Header = { + typeUrl: "/ibc.lightclients.solomachine.v3.Header", + encode(message: Header, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.timestamp !== BigInt(0)) { + writer.uint32(8).uint64(message.timestamp); + } + if (message.signature.length !== 0) { + writer.uint32(18).bytes(message.signature); + } + if (message.newPublicKey !== undefined) { + Any.encode(message.newPublicKey, writer.uint32(26).fork()).ldelim(); + } + if (message.newDiversifier !== "") { + writer.uint32(34).string(message.newDiversifier); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Header { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHeader(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.timestamp = reader.uint64(); + break; + case 2: + message.signature = reader.bytes(); + break; + case 3: + message.newPublicKey = Any.decode(reader, reader.uint32()); + break; + case 4: + message.newDiversifier = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial
): Header { + const message = createBaseHeader(); + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + message.signature = object.signature ?? new Uint8Array(); + message.newPublicKey = object.newPublicKey !== undefined && object.newPublicKey !== null ? Any.fromPartial(object.newPublicKey) : undefined; + message.newDiversifier = object.newDiversifier ?? ""; + return message; + }, + fromAmino(object: HeaderAmino): Header { + const message = createBaseHeader(); + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + if (object.new_public_key !== undefined && object.new_public_key !== null) { + message.newPublicKey = Any.fromAmino(object.new_public_key); + } + if (object.new_diversifier !== undefined && object.new_diversifier !== null) { + message.newDiversifier = object.new_diversifier; + } + return message; + }, + toAmino(message: Header): HeaderAmino { + const obj: any = {}; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp.toString() : undefined; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; + obj.new_public_key = message.newPublicKey ? Any.toAmino(message.newPublicKey) : undefined; + obj.new_diversifier = message.newDiversifier === "" ? undefined : message.newDiversifier; + return obj; + }, + fromAminoMsg(object: HeaderAminoMsg): Header { + return Header.fromAmino(object.value); + }, + toAminoMsg(message: Header): HeaderAminoMsg { + return { + type: "cosmos-sdk/Header", + value: Header.toAmino(message) + }; + }, + fromProtoMsg(message: HeaderProtoMsg): Header { + return Header.decode(message.value); + }, + toProto(message: Header): Uint8Array { + return Header.encode(message).finish(); + }, + toProtoMsg(message: Header): HeaderProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v3.Header", + value: Header.encode(message).finish() + }; + } +}; +function createBaseMisbehaviour(): Misbehaviour { + return { + sequence: BigInt(0), + signatureOne: undefined, + signatureTwo: undefined + }; +} +export const Misbehaviour = { + typeUrl: "/ibc.lightclients.solomachine.v3.Misbehaviour", + encode(message: Misbehaviour, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sequence !== BigInt(0)) { + writer.uint32(8).uint64(message.sequence); + } + if (message.signatureOne !== undefined) { + SignatureAndData.encode(message.signatureOne, writer.uint32(18).fork()).ldelim(); + } + if (message.signatureTwo !== undefined) { + SignatureAndData.encode(message.signatureTwo, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Misbehaviour { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMisbehaviour(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequence = reader.uint64(); + break; + case 2: + message.signatureOne = SignatureAndData.decode(reader, reader.uint32()); + break; + case 3: + message.signatureTwo = SignatureAndData.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Misbehaviour { + const message = createBaseMisbehaviour(); + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + message.signatureOne = object.signatureOne !== undefined && object.signatureOne !== null ? SignatureAndData.fromPartial(object.signatureOne) : undefined; + message.signatureTwo = object.signatureTwo !== undefined && object.signatureTwo !== null ? SignatureAndData.fromPartial(object.signatureTwo) : undefined; + return message; + }, + fromAmino(object: MisbehaviourAmino): Misbehaviour { + const message = createBaseMisbehaviour(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.signature_one !== undefined && object.signature_one !== null) { + message.signatureOne = SignatureAndData.fromAmino(object.signature_one); + } + if (object.signature_two !== undefined && object.signature_two !== null) { + message.signatureTwo = SignatureAndData.fromAmino(object.signature_two); + } + return message; + }, + toAmino(message: Misbehaviour): MisbehaviourAmino { + const obj: any = {}; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; + obj.signature_one = message.signatureOne ? SignatureAndData.toAmino(message.signatureOne) : undefined; + obj.signature_two = message.signatureTwo ? SignatureAndData.toAmino(message.signatureTwo) : undefined; + return obj; + }, + fromAminoMsg(object: MisbehaviourAminoMsg): Misbehaviour { + return Misbehaviour.fromAmino(object.value); + }, + toAminoMsg(message: Misbehaviour): MisbehaviourAminoMsg { + return { + type: "cosmos-sdk/Misbehaviour", + value: Misbehaviour.toAmino(message) + }; + }, + fromProtoMsg(message: MisbehaviourProtoMsg): Misbehaviour { + return Misbehaviour.decode(message.value); + }, + toProto(message: Misbehaviour): Uint8Array { + return Misbehaviour.encode(message).finish(); + }, + toProtoMsg(message: Misbehaviour): MisbehaviourProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v3.Misbehaviour", + value: Misbehaviour.encode(message).finish() + }; + } +}; +function createBaseSignatureAndData(): SignatureAndData { + return { + signature: new Uint8Array(), + path: new Uint8Array(), + data: new Uint8Array(), + timestamp: BigInt(0) + }; +} +export const SignatureAndData = { + typeUrl: "/ibc.lightclients.solomachine.v3.SignatureAndData", + encode(message: SignatureAndData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signature.length !== 0) { + writer.uint32(10).bytes(message.signature); + } + if (message.path.length !== 0) { + writer.uint32(18).bytes(message.path); + } + if (message.data.length !== 0) { + writer.uint32(26).bytes(message.data); + } + if (message.timestamp !== BigInt(0)) { + writer.uint32(32).uint64(message.timestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignatureAndData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignatureAndData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signature = reader.bytes(); + break; + case 2: + message.path = reader.bytes(); + break; + case 3: + message.data = reader.bytes(); + break; + case 4: + message.timestamp = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SignatureAndData { + const message = createBaseSignatureAndData(); + message.signature = object.signature ?? new Uint8Array(); + message.path = object.path ?? new Uint8Array(); + message.data = object.data ?? new Uint8Array(); + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: SignatureAndDataAmino): SignatureAndData { + const message = createBaseSignatureAndData(); + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + return message; + }, + toAmino(message: SignatureAndData): SignatureAndDataAmino { + const obj: any = {}; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; + obj.path = message.path ? base64FromBytes(message.path) : undefined; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp.toString() : undefined; + return obj; + }, + fromAminoMsg(object: SignatureAndDataAminoMsg): SignatureAndData { + return SignatureAndData.fromAmino(object.value); + }, + toAminoMsg(message: SignatureAndData): SignatureAndDataAminoMsg { + return { + type: "cosmos-sdk/SignatureAndData", + value: SignatureAndData.toAmino(message) + }; + }, + fromProtoMsg(message: SignatureAndDataProtoMsg): SignatureAndData { + return SignatureAndData.decode(message.value); + }, + toProto(message: SignatureAndData): Uint8Array { + return SignatureAndData.encode(message).finish(); + }, + toProtoMsg(message: SignatureAndData): SignatureAndDataProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v3.SignatureAndData", + value: SignatureAndData.encode(message).finish() + }; + } +}; +function createBaseTimestampedSignatureData(): TimestampedSignatureData { + return { + signatureData: new Uint8Array(), + timestamp: BigInt(0) + }; +} +export const TimestampedSignatureData = { + typeUrl: "/ibc.lightclients.solomachine.v3.TimestampedSignatureData", + encode(message: TimestampedSignatureData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signatureData.length !== 0) { + writer.uint32(10).bytes(message.signatureData); + } + if (message.timestamp !== BigInt(0)) { + writer.uint32(16).uint64(message.timestamp); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): TimestampedSignatureData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTimestampedSignatureData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signatureData = reader.bytes(); + break; + case 2: + message.timestamp = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): TimestampedSignatureData { + const message = createBaseTimestampedSignatureData(); + message.signatureData = object.signatureData ?? new Uint8Array(); + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + return message; + }, + fromAmino(object: TimestampedSignatureDataAmino): TimestampedSignatureData { + const message = createBaseTimestampedSignatureData(); + if (object.signature_data !== undefined && object.signature_data !== null) { + message.signatureData = bytesFromBase64(object.signature_data); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + return message; + }, + toAmino(message: TimestampedSignatureData): TimestampedSignatureDataAmino { + const obj: any = {}; + obj.signature_data = message.signatureData ? base64FromBytes(message.signatureData) : undefined; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp.toString() : undefined; + return obj; + }, + fromAminoMsg(object: TimestampedSignatureDataAminoMsg): TimestampedSignatureData { + return TimestampedSignatureData.fromAmino(object.value); + }, + toAminoMsg(message: TimestampedSignatureData): TimestampedSignatureDataAminoMsg { + return { + type: "cosmos-sdk/TimestampedSignatureData", + value: TimestampedSignatureData.toAmino(message) + }; + }, + fromProtoMsg(message: TimestampedSignatureDataProtoMsg): TimestampedSignatureData { + return TimestampedSignatureData.decode(message.value); + }, + toProto(message: TimestampedSignatureData): Uint8Array { + return TimestampedSignatureData.encode(message).finish(); + }, + toProtoMsg(message: TimestampedSignatureData): TimestampedSignatureDataProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v3.TimestampedSignatureData", + value: TimestampedSignatureData.encode(message).finish() + }; + } +}; +function createBaseSignBytes(): SignBytes { + return { + sequence: BigInt(0), + timestamp: BigInt(0), + diversifier: "", + path: new Uint8Array(), + data: new Uint8Array() + }; +} +export const SignBytes = { + typeUrl: "/ibc.lightclients.solomachine.v3.SignBytes", + encode(message: SignBytes, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.sequence !== BigInt(0)) { + writer.uint32(8).uint64(message.sequence); + } + if (message.timestamp !== BigInt(0)) { + writer.uint32(16).uint64(message.timestamp); + } + if (message.diversifier !== "") { + writer.uint32(26).string(message.diversifier); + } + if (message.path.length !== 0) { + writer.uint32(34).bytes(message.path); + } + if (message.data.length !== 0) { + writer.uint32(42).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): SignBytes { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSignBytes(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sequence = reader.uint64(); + break; + case 2: + message.timestamp = reader.uint64(); + break; + case 3: + message.diversifier = reader.string(); + break; + case 4: + message.path = reader.bytes(); + break; + case 5: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): SignBytes { + const message = createBaseSignBytes(); + message.sequence = object.sequence !== undefined && object.sequence !== null ? BigInt(object.sequence.toString()) : BigInt(0); + message.timestamp = object.timestamp !== undefined && object.timestamp !== null ? BigInt(object.timestamp.toString()) : BigInt(0); + message.diversifier = object.diversifier ?? ""; + message.path = object.path ?? new Uint8Array(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: SignBytesAmino): SignBytes { + const message = createBaseSignBytes(); + if (object.sequence !== undefined && object.sequence !== null) { + message.sequence = BigInt(object.sequence); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = BigInt(object.timestamp); + } + if (object.diversifier !== undefined && object.diversifier !== null) { + message.diversifier = object.diversifier; + } + if (object.path !== undefined && object.path !== null) { + message.path = bytesFromBase64(object.path); + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: SignBytes): SignBytesAmino { + const obj: any = {}; + obj.sequence = message.sequence !== BigInt(0) ? message.sequence.toString() : undefined; + obj.timestamp = message.timestamp !== BigInt(0) ? message.timestamp.toString() : undefined; + obj.diversifier = message.diversifier === "" ? undefined : message.diversifier; + obj.path = message.path ? base64FromBytes(message.path) : undefined; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: SignBytesAminoMsg): SignBytes { + return SignBytes.fromAmino(object.value); + }, + toAminoMsg(message: SignBytes): SignBytesAminoMsg { + return { + type: "cosmos-sdk/SignBytes", + value: SignBytes.toAmino(message) + }; + }, + fromProtoMsg(message: SignBytesProtoMsg): SignBytes { + return SignBytes.decode(message.value); + }, + toProto(message: SignBytes): Uint8Array { + return SignBytes.encode(message).finish(); + }, + toProtoMsg(message: SignBytes): SignBytesProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v3.SignBytes", + value: SignBytes.encode(message).finish() + }; + } +}; +function createBaseHeaderData(): HeaderData { + return { + newPubKey: undefined, + newDiversifier: "" + }; +} +export const HeaderData = { + typeUrl: "/ibc.lightclients.solomachine.v3.HeaderData", + encode(message: HeaderData, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.newPubKey !== undefined) { + Any.encode(message.newPubKey, writer.uint32(10).fork()).ldelim(); + } + if (message.newDiversifier !== "") { + writer.uint32(18).string(message.newDiversifier); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): HeaderData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHeaderData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.newPubKey = Any.decode(reader, reader.uint32()); + break; + case 2: + message.newDiversifier = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): HeaderData { + const message = createBaseHeaderData(); + message.newPubKey = object.newPubKey !== undefined && object.newPubKey !== null ? Any.fromPartial(object.newPubKey) : undefined; + message.newDiversifier = object.newDiversifier ?? ""; + return message; + }, + fromAmino(object: HeaderDataAmino): HeaderData { + const message = createBaseHeaderData(); + if (object.new_pub_key !== undefined && object.new_pub_key !== null) { + message.newPubKey = Any.fromAmino(object.new_pub_key); + } + if (object.new_diversifier !== undefined && object.new_diversifier !== null) { + message.newDiversifier = object.new_diversifier; + } + return message; + }, + toAmino(message: HeaderData): HeaderDataAmino { + const obj: any = {}; + obj.new_pub_key = message.newPubKey ? Any.toAmino(message.newPubKey) : undefined; + obj.new_diversifier = message.newDiversifier === "" ? undefined : message.newDiversifier; + return obj; + }, + fromAminoMsg(object: HeaderDataAminoMsg): HeaderData { + return HeaderData.fromAmino(object.value); + }, + toAminoMsg(message: HeaderData): HeaderDataAminoMsg { + return { + type: "cosmos-sdk/HeaderData", + value: HeaderData.toAmino(message) + }; + }, + fromProtoMsg(message: HeaderDataProtoMsg): HeaderData { + return HeaderData.decode(message.value); + }, + toProto(message: HeaderData): Uint8Array { + return HeaderData.encode(message).finish(); + }, + toProtoMsg(message: HeaderData): HeaderDataProtoMsg { + return { + typeUrl: "/ibc.lightclients.solomachine.v3.HeaderData", + value: HeaderData.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/ibc/lightclients/tendermint/v1/tendermint.ts b/src/codegen/ibc/lightclients/tendermint/v1/tendermint.ts index a144c99..70b384f 100644 --- a/src/codegen/ibc/lightclients/tendermint/v1/tendermint.ts +++ b/src/codegen/ibc/lightclients/tendermint/v1/tendermint.ts @@ -1,6 +1,6 @@ import { Duration, DurationAmino, DurationSDKType } from "../../../../google/protobuf/duration"; import { Height, HeightAmino, HeightSDKType } from "../../../core/client/v1/client"; -import { ProofSpec, ProofSpecAmino, ProofSpecSDKType } from "../../../../proofs"; +import { ProofSpec, ProofSpecAmino, ProofSpecSDKType } from "../../../../cosmos/ics23/v1/proofs"; import { Timestamp } from "../../../../google/protobuf/timestamp"; import { MerkleRoot, MerkleRootAmino, MerkleRootSDKType } from "../../../core/commitment/v1/commitment"; import { SignedHeader, SignedHeaderAmino, SignedHeaderSDKType } from "../../../../tendermint/types/types"; @@ -153,6 +153,8 @@ export interface ConsensusStateSDKType { * that implements Misbehaviour interface expected by ICS-02 */ export interface Misbehaviour { + /** ClientID is deprecated */ + /** @deprecated */ clientId: string; header1?: Header; header2?: Header; @@ -166,6 +168,8 @@ export interface MisbehaviourProtoMsg { * that implements Misbehaviour interface expected by ICS-02 */ export interface MisbehaviourAmino { + /** ClientID is deprecated */ + /** @deprecated */ client_id?: string; header_1?: HeaderAmino; header_2?: HeaderAmino; @@ -179,6 +183,7 @@ export interface MisbehaviourAminoMsg { * that implements Misbehaviour interface expected by ICS-02 */ export interface MisbehaviourSDKType { + /** @deprecated */ client_id: string; header_1?: HeaderSDKType; header_2?: HeaderSDKType; diff --git a/src/codegen/ibc/lightclients/wasm/v1/genesis.ts b/src/codegen/ibc/lightclients/wasm/v1/genesis.ts new file mode 100644 index 0000000..785af92 --- /dev/null +++ b/src/codegen/ibc/lightclients/wasm/v1/genesis.ts @@ -0,0 +1,186 @@ +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** GenesisState defines 08-wasm's keeper genesis state */ +export interface GenesisState { + /** uploaded light client wasm contracts */ + contracts: Contract[]; +} +export interface GenesisStateProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.GenesisState"; + value: Uint8Array; +} +/** GenesisState defines 08-wasm's keeper genesis state */ +export interface GenesisStateAmino { + /** uploaded light client wasm contracts */ + contracts?: ContractAmino[]; +} +export interface GenesisStateAminoMsg { + type: "cosmos-sdk/GenesisState"; + value: GenesisStateAmino; +} +/** GenesisState defines 08-wasm's keeper genesis state */ +export interface GenesisStateSDKType { + contracts: ContractSDKType[]; +} +/** Contract stores contract code */ +export interface Contract { + /** contract byte code */ + codeBytes: Uint8Array; +} +export interface ContractProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.Contract"; + value: Uint8Array; +} +/** Contract stores contract code */ +export interface ContractAmino { + /** contract byte code */ + code_bytes?: string; +} +export interface ContractAminoMsg { + type: "cosmos-sdk/Contract"; + value: ContractAmino; +} +/** Contract stores contract code */ +export interface ContractSDKType { + code_bytes: Uint8Array; +} +function createBaseGenesisState(): GenesisState { + return { + contracts: [] + }; +} +export const GenesisState = { + typeUrl: "/ibc.lightclients.wasm.v1.GenesisState", + encode(message: GenesisState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.contracts) { + Contract.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): GenesisState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contracts.push(Contract.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): GenesisState { + const message = createBaseGenesisState(); + message.contracts = object.contracts?.map(e => Contract.fromPartial(e)) || []; + return message; + }, + fromAmino(object: GenesisStateAmino): GenesisState { + const message = createBaseGenesisState(); + message.contracts = object.contracts?.map(e => Contract.fromAmino(e)) || []; + return message; + }, + toAmino(message: GenesisState): GenesisStateAmino { + const obj: any = {}; + if (message.contracts) { + obj.contracts = message.contracts.map(e => e ? Contract.toAmino(e) : undefined); + } else { + obj.contracts = message.contracts; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: "cosmos-sdk/GenesisState", + value: GenesisState.toAmino(message) + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + toProto(message: GenesisState): Uint8Array { + return GenesisState.encode(message).finish(); + }, + toProtoMsg(message: GenesisState): GenesisStateProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.GenesisState", + value: GenesisState.encode(message).finish() + }; + } +}; +function createBaseContract(): Contract { + return { + codeBytes: new Uint8Array() + }; +} +export const Contract = { + typeUrl: "/ibc.lightclients.wasm.v1.Contract", + encode(message: Contract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.codeBytes.length !== 0) { + writer.uint32(10).bytes(message.codeBytes); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Contract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.codeBytes = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Contract { + const message = createBaseContract(); + message.codeBytes = object.codeBytes ?? new Uint8Array(); + return message; + }, + fromAmino(object: ContractAmino): Contract { + const message = createBaseContract(); + if (object.code_bytes !== undefined && object.code_bytes !== null) { + message.codeBytes = bytesFromBase64(object.code_bytes); + } + return message; + }, + toAmino(message: Contract): ContractAmino { + const obj: any = {}; + obj.code_bytes = message.codeBytes ? base64FromBytes(message.codeBytes) : undefined; + return obj; + }, + fromAminoMsg(object: ContractAminoMsg): Contract { + return Contract.fromAmino(object.value); + }, + toAminoMsg(message: Contract): ContractAminoMsg { + return { + type: "cosmos-sdk/Contract", + value: Contract.toAmino(message) + }; + }, + fromProtoMsg(message: ContractProtoMsg): Contract { + return Contract.decode(message.value); + }, + toProto(message: Contract): Uint8Array { + return Contract.encode(message).finish(); + }, + toProtoMsg(message: Contract): ContractProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.Contract", + value: Contract.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/ibc/lightclients/wasm/v1/query.lcd.ts b/src/codegen/ibc/lightclients/wasm/v1/query.lcd.ts new file mode 100644 index 0000000..df9dd94 --- /dev/null +++ b/src/codegen/ibc/lightclients/wasm/v1/query.lcd.ts @@ -0,0 +1,33 @@ +import { setPaginationParams } from "../../../../helpers"; +import { LCDClient } from "@cosmology/lcd"; +import { QueryChecksumsRequest, QueryChecksumsResponseSDKType, QueryCodeRequest, QueryCodeResponseSDKType } from "./query"; +export class LCDQueryClient { + req: LCDClient; + constructor({ + requestClient + }: { + requestClient: LCDClient; + }) { + this.req = requestClient; + this.checksums = this.checksums.bind(this); + this.code = this.code.bind(this); + } + /* Get all Wasm checksums */ + async checksums(params: QueryChecksumsRequest = { + pagination: undefined + }): Promise { + const options: any = { + params: {} + }; + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + const endpoint = `ibc/lightclients/wasm/v1/checksums`; + return await this.req.get(endpoint, options); + } + /* Get Wasm code for given checksum */ + async code(params: QueryCodeRequest): Promise { + const endpoint = `ibc/lightclients/wasm/v1/checksums/${params.checksum}/code`; + return await this.req.get(endpoint); + } +} \ No newline at end of file diff --git a/src/codegen/ibc/lightclients/wasm/v1/query.rpc.Query.ts b/src/codegen/ibc/lightclients/wasm/v1/query.rpc.Query.ts new file mode 100644 index 0000000..3641d12 --- /dev/null +++ b/src/codegen/ibc/lightclients/wasm/v1/query.rpc.Query.ts @@ -0,0 +1,43 @@ +import { Rpc } from "../../../../helpers"; +import { BinaryReader } from "../../../../binary"; +import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; +import { QueryChecksumsRequest, QueryChecksumsResponse, QueryCodeRequest, QueryCodeResponse } from "./query"; +/** Query service for wasm module */ +export interface Query { + /** Get all Wasm checksums */ + checksums(request?: QueryChecksumsRequest): Promise; + /** Get Wasm code for given checksum */ + code(request: QueryCodeRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.checksums = this.checksums.bind(this); + this.code = this.code.bind(this); + } + checksums(request: QueryChecksumsRequest = { + pagination: undefined + }): Promise { + const data = QueryChecksumsRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.lightclients.wasm.v1.Query", "Checksums", data); + return promise.then(data => QueryChecksumsResponse.decode(new BinaryReader(data))); + } + code(request: QueryCodeRequest): Promise { + const data = QueryCodeRequest.encode(request).finish(); + const promise = this.rpc.request("ibc.lightclients.wasm.v1.Query", "Code", data); + return promise.then(data => QueryCodeResponse.decode(new BinaryReader(data))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + checksums(request?: QueryChecksumsRequest): Promise { + return queryService.checksums(request); + }, + code(request: QueryCodeRequest): Promise { + return queryService.code(request); + } + }; +}; \ No newline at end of file diff --git a/src/codegen/ibc/lightclients/wasm/v1/query.ts b/src/codegen/ibc/lightclients/wasm/v1/query.ts new file mode 100644 index 0000000..962ea48 --- /dev/null +++ b/src/codegen/ibc/lightclients/wasm/v1/query.ts @@ -0,0 +1,384 @@ +import { PageRequest, PageRequestAmino, PageRequestSDKType, PageResponse, PageResponseAmino, PageResponseSDKType } from "../../../../cosmos/base/query/v1beta1/pagination"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** QueryChecksumsRequest is the request type for the Query/Checksums RPC method. */ +export interface QueryChecksumsRequest { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequest; +} +export interface QueryChecksumsRequestProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.QueryChecksumsRequest"; + value: Uint8Array; +} +/** QueryChecksumsRequest is the request type for the Query/Checksums RPC method. */ +export interface QueryChecksumsRequestAmino { + /** pagination defines an optional pagination for the request. */ + pagination?: PageRequestAmino; +} +export interface QueryChecksumsRequestAminoMsg { + type: "cosmos-sdk/QueryChecksumsRequest"; + value: QueryChecksumsRequestAmino; +} +/** QueryChecksumsRequest is the request type for the Query/Checksums RPC method. */ +export interface QueryChecksumsRequestSDKType { + pagination?: PageRequestSDKType; +} +/** QueryChecksumsResponse is the response type for the Query/Checksums RPC method. */ +export interface QueryChecksumsResponse { + /** checksums is a list of the hex encoded checksums of all wasm codes stored. */ + checksums: string[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryChecksumsResponseProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.QueryChecksumsResponse"; + value: Uint8Array; +} +/** QueryChecksumsResponse is the response type for the Query/Checksums RPC method. */ +export interface QueryChecksumsResponseAmino { + /** checksums is a list of the hex encoded checksums of all wasm codes stored. */ + checksums?: string[]; + /** pagination defines the pagination in the response. */ + pagination?: PageResponseAmino; +} +export interface QueryChecksumsResponseAminoMsg { + type: "cosmos-sdk/QueryChecksumsResponse"; + value: QueryChecksumsResponseAmino; +} +/** QueryChecksumsResponse is the response type for the Query/Checksums RPC method. */ +export interface QueryChecksumsResponseSDKType { + checksums: string[]; + pagination?: PageResponseSDKType; +} +/** QueryCodeRequest is the request type for the Query/Code RPC method. */ +export interface QueryCodeRequest { + /** checksum is a hex encoded string of the code stored. */ + checksum: string; +} +export interface QueryCodeRequestProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.QueryCodeRequest"; + value: Uint8Array; +} +/** QueryCodeRequest is the request type for the Query/Code RPC method. */ +export interface QueryCodeRequestAmino { + /** checksum is a hex encoded string of the code stored. */ + checksum?: string; +} +export interface QueryCodeRequestAminoMsg { + type: "cosmos-sdk/QueryCodeRequest"; + value: QueryCodeRequestAmino; +} +/** QueryCodeRequest is the request type for the Query/Code RPC method. */ +export interface QueryCodeRequestSDKType { + checksum: string; +} +/** QueryCodeResponse is the response type for the Query/Code RPC method. */ +export interface QueryCodeResponse { + data: Uint8Array; +} +export interface QueryCodeResponseProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.QueryCodeResponse"; + value: Uint8Array; +} +/** QueryCodeResponse is the response type for the Query/Code RPC method. */ +export interface QueryCodeResponseAmino { + data?: string; +} +export interface QueryCodeResponseAminoMsg { + type: "cosmos-sdk/QueryCodeResponse"; + value: QueryCodeResponseAmino; +} +/** QueryCodeResponse is the response type for the Query/Code RPC method. */ +export interface QueryCodeResponseSDKType { + data: Uint8Array; +} +function createBaseQueryChecksumsRequest(): QueryChecksumsRequest { + return { + pagination: undefined + }; +} +export const QueryChecksumsRequest = { + typeUrl: "/ibc.lightclients.wasm.v1.QueryChecksumsRequest", + encode(message: QueryChecksumsRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryChecksumsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryChecksumsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryChecksumsRequest { + const message = createBaseQueryChecksumsRequest(); + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryChecksumsRequestAmino): QueryChecksumsRequest { + const message = createBaseQueryChecksumsRequest(); + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageRequest.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryChecksumsRequest): QueryChecksumsRequestAmino { + const obj: any = {}; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryChecksumsRequestAminoMsg): QueryChecksumsRequest { + return QueryChecksumsRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryChecksumsRequest): QueryChecksumsRequestAminoMsg { + return { + type: "cosmos-sdk/QueryChecksumsRequest", + value: QueryChecksumsRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryChecksumsRequestProtoMsg): QueryChecksumsRequest { + return QueryChecksumsRequest.decode(message.value); + }, + toProto(message: QueryChecksumsRequest): Uint8Array { + return QueryChecksumsRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryChecksumsRequest): QueryChecksumsRequestProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.QueryChecksumsRequest", + value: QueryChecksumsRequest.encode(message).finish() + }; + } +}; +function createBaseQueryChecksumsResponse(): QueryChecksumsResponse { + return { + checksums: [], + pagination: undefined + }; +} +export const QueryChecksumsResponse = { + typeUrl: "/ibc.lightclients.wasm.v1.QueryChecksumsResponse", + encode(message: QueryChecksumsResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.checksums) { + writer.uint32(10).string(v!); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryChecksumsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryChecksumsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.checksums.push(reader.string()); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryChecksumsResponse { + const message = createBaseQueryChecksumsResponse(); + message.checksums = object.checksums?.map(e => e) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + fromAmino(object: QueryChecksumsResponseAmino): QueryChecksumsResponse { + const message = createBaseQueryChecksumsResponse(); + message.checksums = object.checksums?.map(e => e) || []; + if (object.pagination !== undefined && object.pagination !== null) { + message.pagination = PageResponse.fromAmino(object.pagination); + } + return message; + }, + toAmino(message: QueryChecksumsResponse): QueryChecksumsResponseAmino { + const obj: any = {}; + if (message.checksums) { + obj.checksums = message.checksums.map(e => e); + } else { + obj.checksums = message.checksums; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryChecksumsResponseAminoMsg): QueryChecksumsResponse { + return QueryChecksumsResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryChecksumsResponse): QueryChecksumsResponseAminoMsg { + return { + type: "cosmos-sdk/QueryChecksumsResponse", + value: QueryChecksumsResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryChecksumsResponseProtoMsg): QueryChecksumsResponse { + return QueryChecksumsResponse.decode(message.value); + }, + toProto(message: QueryChecksumsResponse): Uint8Array { + return QueryChecksumsResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryChecksumsResponse): QueryChecksumsResponseProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.QueryChecksumsResponse", + value: QueryChecksumsResponse.encode(message).finish() + }; + } +}; +function createBaseQueryCodeRequest(): QueryCodeRequest { + return { + checksum: "" + }; +} +export const QueryCodeRequest = { + typeUrl: "/ibc.lightclients.wasm.v1.QueryCodeRequest", + encode(message: QueryCodeRequest, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.checksum !== "") { + writer.uint32(10).string(message.checksum); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCodeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCodeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.checksum = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryCodeRequest { + const message = createBaseQueryCodeRequest(); + message.checksum = object.checksum ?? ""; + return message; + }, + fromAmino(object: QueryCodeRequestAmino): QueryCodeRequest { + const message = createBaseQueryCodeRequest(); + if (object.checksum !== undefined && object.checksum !== null) { + message.checksum = object.checksum; + } + return message; + }, + toAmino(message: QueryCodeRequest): QueryCodeRequestAmino { + const obj: any = {}; + obj.checksum = message.checksum === "" ? undefined : message.checksum; + return obj; + }, + fromAminoMsg(object: QueryCodeRequestAminoMsg): QueryCodeRequest { + return QueryCodeRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryCodeRequest): QueryCodeRequestAminoMsg { + return { + type: "cosmos-sdk/QueryCodeRequest", + value: QueryCodeRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryCodeRequestProtoMsg): QueryCodeRequest { + return QueryCodeRequest.decode(message.value); + }, + toProto(message: QueryCodeRequest): Uint8Array { + return QueryCodeRequest.encode(message).finish(); + }, + toProtoMsg(message: QueryCodeRequest): QueryCodeRequestProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.QueryCodeRequest", + value: QueryCodeRequest.encode(message).finish() + }; + } +}; +function createBaseQueryCodeResponse(): QueryCodeResponse { + return { + data: new Uint8Array() + }; +} +export const QueryCodeResponse = { + typeUrl: "/ibc.lightclients.wasm.v1.QueryCodeResponse", + encode(message: QueryCodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): QueryCodeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCodeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): QueryCodeResponse { + const message = createBaseQueryCodeResponse(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: QueryCodeResponseAmino): QueryCodeResponse { + const message = createBaseQueryCodeResponse(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: QueryCodeResponse): QueryCodeResponseAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: QueryCodeResponseAminoMsg): QueryCodeResponse { + return QueryCodeResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryCodeResponse): QueryCodeResponseAminoMsg { + return { + type: "cosmos-sdk/QueryCodeResponse", + value: QueryCodeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryCodeResponseProtoMsg): QueryCodeResponse { + return QueryCodeResponse.decode(message.value); + }, + toProto(message: QueryCodeResponse): Uint8Array { + return QueryCodeResponse.encode(message).finish(); + }, + toProtoMsg(message: QueryCodeResponse): QueryCodeResponseProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.QueryCodeResponse", + value: QueryCodeResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/ibc/lightclients/wasm/v1/tx.amino.ts b/src/codegen/ibc/lightclients/wasm/v1/tx.amino.ts new file mode 100644 index 0000000..756c649 --- /dev/null +++ b/src/codegen/ibc/lightclients/wasm/v1/tx.amino.ts @@ -0,0 +1,18 @@ +import { MsgStoreCode, MsgRemoveChecksum, MsgMigrateContract } from "./tx"; +export const AminoConverter = { + "/ibc.lightclients.wasm.v1.MsgStoreCode": { + aminoType: "cosmos-sdk/MsgStoreCode", + toAmino: MsgStoreCode.toAmino, + fromAmino: MsgStoreCode.fromAmino + }, + "/ibc.lightclients.wasm.v1.MsgRemoveChecksum": { + aminoType: "cosmos-sdk/MsgRemoveChecksum", + toAmino: MsgRemoveChecksum.toAmino, + fromAmino: MsgRemoveChecksum.fromAmino + }, + "/ibc.lightclients.wasm.v1.MsgMigrateContract": { + aminoType: "cosmos-sdk/MsgMigrateContract", + toAmino: MsgMigrateContract.toAmino, + fromAmino: MsgMigrateContract.fromAmino + } +}; \ No newline at end of file diff --git a/src/codegen/ibc/lightclients/wasm/v1/tx.registry.ts b/src/codegen/ibc/lightclients/wasm/v1/tx.registry.ts new file mode 100644 index 0000000..9f6a6cd --- /dev/null +++ b/src/codegen/ibc/lightclients/wasm/v1/tx.registry.ts @@ -0,0 +1,70 @@ +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgStoreCode, MsgRemoveChecksum, MsgMigrateContract } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/ibc.lightclients.wasm.v1.MsgStoreCode", MsgStoreCode], ["/ibc.lightclients.wasm.v1.MsgRemoveChecksum", MsgRemoveChecksum], ["/ibc.lightclients.wasm.v1.MsgMigrateContract", MsgMigrateContract]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + storeCode(value: MsgStoreCode) { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgStoreCode", + value: MsgStoreCode.encode(value).finish() + }; + }, + removeChecksum(value: MsgRemoveChecksum) { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgRemoveChecksum", + value: MsgRemoveChecksum.encode(value).finish() + }; + }, + migrateContract(value: MsgMigrateContract) { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgMigrateContract", + value: MsgMigrateContract.encode(value).finish() + }; + } + }, + withTypeUrl: { + storeCode(value: MsgStoreCode) { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgStoreCode", + value + }; + }, + removeChecksum(value: MsgRemoveChecksum) { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgRemoveChecksum", + value + }; + }, + migrateContract(value: MsgMigrateContract) { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgMigrateContract", + value + }; + } + }, + fromPartial: { + storeCode(value: MsgStoreCode) { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgStoreCode", + value: MsgStoreCode.fromPartial(value) + }; + }, + removeChecksum(value: MsgRemoveChecksum) { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgRemoveChecksum", + value: MsgRemoveChecksum.fromPartial(value) + }; + }, + migrateContract(value: MsgMigrateContract) { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgMigrateContract", + value: MsgMigrateContract.fromPartial(value) + }; + } + } +}; \ No newline at end of file diff --git a/src/codegen/ibc/lightclients/wasm/v1/tx.rpc.msg.ts b/src/codegen/ibc/lightclients/wasm/v1/tx.rpc.msg.ts new file mode 100644 index 0000000..4019186 --- /dev/null +++ b/src/codegen/ibc/lightclients/wasm/v1/tx.rpc.msg.ts @@ -0,0 +1,36 @@ +import { Rpc } from "../../../../helpers"; +import { BinaryReader } from "../../../../binary"; +import { MsgStoreCode, MsgStoreCodeResponse, MsgRemoveChecksum, MsgRemoveChecksumResponse, MsgMigrateContract, MsgMigrateContractResponse } from "./tx"; +/** Msg defines the ibc/08-wasm Msg service. */ +export interface Msg { + /** StoreCode defines a rpc handler method for MsgStoreCode. */ + storeCode(request: MsgStoreCode): Promise; + /** RemoveChecksum defines a rpc handler method for MsgRemoveChecksum. */ + removeChecksum(request: MsgRemoveChecksum): Promise; + /** MigrateContract defines a rpc handler method for MsgMigrateContract. */ + migrateContract(request: MsgMigrateContract): Promise; +} +export class MsgClientImpl implements Msg { + private readonly rpc: Rpc; + constructor(rpc: Rpc) { + this.rpc = rpc; + this.storeCode = this.storeCode.bind(this); + this.removeChecksum = this.removeChecksum.bind(this); + this.migrateContract = this.migrateContract.bind(this); + } + storeCode(request: MsgStoreCode): Promise { + const data = MsgStoreCode.encode(request).finish(); + const promise = this.rpc.request("ibc.lightclients.wasm.v1.Msg", "StoreCode", data); + return promise.then(data => MsgStoreCodeResponse.decode(new BinaryReader(data))); + } + removeChecksum(request: MsgRemoveChecksum): Promise { + const data = MsgRemoveChecksum.encode(request).finish(); + const promise = this.rpc.request("ibc.lightclients.wasm.v1.Msg", "RemoveChecksum", data); + return promise.then(data => MsgRemoveChecksumResponse.decode(new BinaryReader(data))); + } + migrateContract(request: MsgMigrateContract): Promise { + const data = MsgMigrateContract.encode(request).finish(); + const promise = this.rpc.request("ibc.lightclients.wasm.v1.Msg", "MigrateContract", data); + return promise.then(data => MsgMigrateContractResponse.decode(new BinaryReader(data))); + } +} \ No newline at end of file diff --git a/src/codegen/ibc/lightclients/wasm/v1/tx.ts b/src/codegen/ibc/lightclients/wasm/v1/tx.ts new file mode 100644 index 0000000..aa39d19 --- /dev/null +++ b/src/codegen/ibc/lightclients/wasm/v1/tx.ts @@ -0,0 +1,591 @@ +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** MsgStoreCode defines the request type for the StoreCode rpc. */ +export interface MsgStoreCode { + /** signer address */ + signer: string; + /** wasm byte code of light client contract. It can be raw or gzip compressed */ + wasmByteCode: Uint8Array; +} +export interface MsgStoreCodeProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.MsgStoreCode"; + value: Uint8Array; +} +/** MsgStoreCode defines the request type for the StoreCode rpc. */ +export interface MsgStoreCodeAmino { + /** signer address */ + signer?: string; + /** wasm byte code of light client contract. It can be raw or gzip compressed */ + wasm_byte_code?: string; +} +export interface MsgStoreCodeAminoMsg { + type: "cosmos-sdk/MsgStoreCode"; + value: MsgStoreCodeAmino; +} +/** MsgStoreCode defines the request type for the StoreCode rpc. */ +export interface MsgStoreCodeSDKType { + signer: string; + wasm_byte_code: Uint8Array; +} +/** MsgStoreCodeResponse defines the response type for the StoreCode rpc */ +export interface MsgStoreCodeResponse { + /** checksum is the sha256 hash of the stored code */ + checksum: Uint8Array; +} +export interface MsgStoreCodeResponseProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.MsgStoreCodeResponse"; + value: Uint8Array; +} +/** MsgStoreCodeResponse defines the response type for the StoreCode rpc */ +export interface MsgStoreCodeResponseAmino { + /** checksum is the sha256 hash of the stored code */ + checksum?: string; +} +export interface MsgStoreCodeResponseAminoMsg { + type: "cosmos-sdk/MsgStoreCodeResponse"; + value: MsgStoreCodeResponseAmino; +} +/** MsgStoreCodeResponse defines the response type for the StoreCode rpc */ +export interface MsgStoreCodeResponseSDKType { + checksum: Uint8Array; +} +/** MsgRemoveChecksum defines the request type for the MsgRemoveChecksum rpc. */ +export interface MsgRemoveChecksum { + /** signer address */ + signer: string; + /** checksum is the sha256 hash to be removed from the store */ + checksum: Uint8Array; +} +export interface MsgRemoveChecksumProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.MsgRemoveChecksum"; + value: Uint8Array; +} +/** MsgRemoveChecksum defines the request type for the MsgRemoveChecksum rpc. */ +export interface MsgRemoveChecksumAmino { + /** signer address */ + signer?: string; + /** checksum is the sha256 hash to be removed from the store */ + checksum?: string; +} +export interface MsgRemoveChecksumAminoMsg { + type: "cosmos-sdk/MsgRemoveChecksum"; + value: MsgRemoveChecksumAmino; +} +/** MsgRemoveChecksum defines the request type for the MsgRemoveChecksum rpc. */ +export interface MsgRemoveChecksumSDKType { + signer: string; + checksum: Uint8Array; +} +/** MsgStoreChecksumResponse defines the response type for the StoreCode rpc */ +export interface MsgRemoveChecksumResponse {} +export interface MsgRemoveChecksumResponseProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.MsgRemoveChecksumResponse"; + value: Uint8Array; +} +/** MsgStoreChecksumResponse defines the response type for the StoreCode rpc */ +export interface MsgRemoveChecksumResponseAmino {} +export interface MsgRemoveChecksumResponseAminoMsg { + type: "cosmos-sdk/MsgRemoveChecksumResponse"; + value: MsgRemoveChecksumResponseAmino; +} +/** MsgStoreChecksumResponse defines the response type for the StoreCode rpc */ +export interface MsgRemoveChecksumResponseSDKType {} +/** MsgMigrateContract defines the request type for the MigrateContract rpc. */ +export interface MsgMigrateContract { + /** signer address */ + signer: string; + /** the client id of the contract */ + clientId: string; + /** checksum is the sha256 hash of the new wasm byte code for the contract */ + checksum: Uint8Array; + /** the json encoded message to be passed to the contract on migration */ + msg: Uint8Array; +} +export interface MsgMigrateContractProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.MsgMigrateContract"; + value: Uint8Array; +} +/** MsgMigrateContract defines the request type for the MigrateContract rpc. */ +export interface MsgMigrateContractAmino { + /** signer address */ + signer?: string; + /** the client id of the contract */ + client_id?: string; + /** checksum is the sha256 hash of the new wasm byte code for the contract */ + checksum?: string; + /** the json encoded message to be passed to the contract on migration */ + msg?: string; +} +export interface MsgMigrateContractAminoMsg { + type: "cosmos-sdk/MsgMigrateContract"; + value: MsgMigrateContractAmino; +} +/** MsgMigrateContract defines the request type for the MigrateContract rpc. */ +export interface MsgMigrateContractSDKType { + signer: string; + client_id: string; + checksum: Uint8Array; + msg: Uint8Array; +} +/** MsgMigrateContractResponse defines the response type for the MigrateContract rpc */ +export interface MsgMigrateContractResponse {} +export interface MsgMigrateContractResponseProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.MsgMigrateContractResponse"; + value: Uint8Array; +} +/** MsgMigrateContractResponse defines the response type for the MigrateContract rpc */ +export interface MsgMigrateContractResponseAmino {} +export interface MsgMigrateContractResponseAminoMsg { + type: "cosmos-sdk/MsgMigrateContractResponse"; + value: MsgMigrateContractResponseAmino; +} +/** MsgMigrateContractResponse defines the response type for the MigrateContract rpc */ +export interface MsgMigrateContractResponseSDKType {} +function createBaseMsgStoreCode(): MsgStoreCode { + return { + signer: "", + wasmByteCode: new Uint8Array() + }; +} +export const MsgStoreCode = { + typeUrl: "/ibc.lightclients.wasm.v1.MsgStoreCode", + encode(message: MsgStoreCode, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.wasmByteCode.length !== 0) { + writer.uint32(18).bytes(message.wasmByteCode); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreCode { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStoreCode(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.wasmByteCode = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgStoreCode { + const message = createBaseMsgStoreCode(); + message.signer = object.signer ?? ""; + message.wasmByteCode = object.wasmByteCode ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgStoreCodeAmino): MsgStoreCode { + const message = createBaseMsgStoreCode(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) { + message.wasmByteCode = bytesFromBase64(object.wasm_byte_code); + } + return message; + }, + toAmino(message: MsgStoreCode): MsgStoreCodeAmino { + const obj: any = {}; + obj.signer = message.signer === "" ? undefined : message.signer; + obj.wasm_byte_code = message.wasmByteCode ? base64FromBytes(message.wasmByteCode) : undefined; + return obj; + }, + fromAminoMsg(object: MsgStoreCodeAminoMsg): MsgStoreCode { + return MsgStoreCode.fromAmino(object.value); + }, + toAminoMsg(message: MsgStoreCode): MsgStoreCodeAminoMsg { + return { + type: "cosmos-sdk/MsgStoreCode", + value: MsgStoreCode.toAmino(message) + }; + }, + fromProtoMsg(message: MsgStoreCodeProtoMsg): MsgStoreCode { + return MsgStoreCode.decode(message.value); + }, + toProto(message: MsgStoreCode): Uint8Array { + return MsgStoreCode.encode(message).finish(); + }, + toProtoMsg(message: MsgStoreCode): MsgStoreCodeProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgStoreCode", + value: MsgStoreCode.encode(message).finish() + }; + } +}; +function createBaseMsgStoreCodeResponse(): MsgStoreCodeResponse { + return { + checksum: new Uint8Array() + }; +} +export const MsgStoreCodeResponse = { + typeUrl: "/ibc.lightclients.wasm.v1.MsgStoreCodeResponse", + encode(message: MsgStoreCodeResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.checksum.length !== 0) { + writer.uint32(10).bytes(message.checksum); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgStoreCodeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStoreCodeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.checksum = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgStoreCodeResponse { + const message = createBaseMsgStoreCodeResponse(); + message.checksum = object.checksum ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgStoreCodeResponseAmino): MsgStoreCodeResponse { + const message = createBaseMsgStoreCodeResponse(); + if (object.checksum !== undefined && object.checksum !== null) { + message.checksum = bytesFromBase64(object.checksum); + } + return message; + }, + toAmino(message: MsgStoreCodeResponse): MsgStoreCodeResponseAmino { + const obj: any = {}; + obj.checksum = message.checksum ? base64FromBytes(message.checksum) : undefined; + return obj; + }, + fromAminoMsg(object: MsgStoreCodeResponseAminoMsg): MsgStoreCodeResponse { + return MsgStoreCodeResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgStoreCodeResponse): MsgStoreCodeResponseAminoMsg { + return { + type: "cosmos-sdk/MsgStoreCodeResponse", + value: MsgStoreCodeResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgStoreCodeResponseProtoMsg): MsgStoreCodeResponse { + return MsgStoreCodeResponse.decode(message.value); + }, + toProto(message: MsgStoreCodeResponse): Uint8Array { + return MsgStoreCodeResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgStoreCodeResponse): MsgStoreCodeResponseProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgStoreCodeResponse", + value: MsgStoreCodeResponse.encode(message).finish() + }; + } +}; +function createBaseMsgRemoveChecksum(): MsgRemoveChecksum { + return { + signer: "", + checksum: new Uint8Array() + }; +} +export const MsgRemoveChecksum = { + typeUrl: "/ibc.lightclients.wasm.v1.MsgRemoveChecksum", + encode(message: MsgRemoveChecksum, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.checksum.length !== 0) { + writer.uint32(18).bytes(message.checksum); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRemoveChecksum { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRemoveChecksum(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.checksum = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgRemoveChecksum { + const message = createBaseMsgRemoveChecksum(); + message.signer = object.signer ?? ""; + message.checksum = object.checksum ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgRemoveChecksumAmino): MsgRemoveChecksum { + const message = createBaseMsgRemoveChecksum(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.checksum !== undefined && object.checksum !== null) { + message.checksum = bytesFromBase64(object.checksum); + } + return message; + }, + toAmino(message: MsgRemoveChecksum): MsgRemoveChecksumAmino { + const obj: any = {}; + obj.signer = message.signer === "" ? undefined : message.signer; + obj.checksum = message.checksum ? base64FromBytes(message.checksum) : undefined; + return obj; + }, + fromAminoMsg(object: MsgRemoveChecksumAminoMsg): MsgRemoveChecksum { + return MsgRemoveChecksum.fromAmino(object.value); + }, + toAminoMsg(message: MsgRemoveChecksum): MsgRemoveChecksumAminoMsg { + return { + type: "cosmos-sdk/MsgRemoveChecksum", + value: MsgRemoveChecksum.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRemoveChecksumProtoMsg): MsgRemoveChecksum { + return MsgRemoveChecksum.decode(message.value); + }, + toProto(message: MsgRemoveChecksum): Uint8Array { + return MsgRemoveChecksum.encode(message).finish(); + }, + toProtoMsg(message: MsgRemoveChecksum): MsgRemoveChecksumProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgRemoveChecksum", + value: MsgRemoveChecksum.encode(message).finish() + }; + } +}; +function createBaseMsgRemoveChecksumResponse(): MsgRemoveChecksumResponse { + return {}; +} +export const MsgRemoveChecksumResponse = { + typeUrl: "/ibc.lightclients.wasm.v1.MsgRemoveChecksumResponse", + encode(_: MsgRemoveChecksumResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgRemoveChecksumResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgRemoveChecksumResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgRemoveChecksumResponse { + const message = createBaseMsgRemoveChecksumResponse(); + return message; + }, + fromAmino(_: MsgRemoveChecksumResponseAmino): MsgRemoveChecksumResponse { + const message = createBaseMsgRemoveChecksumResponse(); + return message; + }, + toAmino(_: MsgRemoveChecksumResponse): MsgRemoveChecksumResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRemoveChecksumResponseAminoMsg): MsgRemoveChecksumResponse { + return MsgRemoveChecksumResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgRemoveChecksumResponse): MsgRemoveChecksumResponseAminoMsg { + return { + type: "cosmos-sdk/MsgRemoveChecksumResponse", + value: MsgRemoveChecksumResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRemoveChecksumResponseProtoMsg): MsgRemoveChecksumResponse { + return MsgRemoveChecksumResponse.decode(message.value); + }, + toProto(message: MsgRemoveChecksumResponse): Uint8Array { + return MsgRemoveChecksumResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRemoveChecksumResponse): MsgRemoveChecksumResponseProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgRemoveChecksumResponse", + value: MsgRemoveChecksumResponse.encode(message).finish() + }; + } +}; +function createBaseMsgMigrateContract(): MsgMigrateContract { + return { + signer: "", + clientId: "", + checksum: new Uint8Array(), + msg: new Uint8Array() + }; +} +export const MsgMigrateContract = { + typeUrl: "/ibc.lightclients.wasm.v1.MsgMigrateContract", + encode(message: MsgMigrateContract, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.signer !== "") { + writer.uint32(10).string(message.signer); + } + if (message.clientId !== "") { + writer.uint32(18).string(message.clientId); + } + if (message.checksum.length !== 0) { + writer.uint32(26).bytes(message.checksum); + } + if (message.msg.length !== 0) { + writer.uint32(34).bytes(message.msg); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgMigrateContract { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMigrateContract(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signer = reader.string(); + break; + case 2: + message.clientId = reader.string(); + break; + case 3: + message.checksum = reader.bytes(); + break; + case 4: + message.msg = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): MsgMigrateContract { + const message = createBaseMsgMigrateContract(); + message.signer = object.signer ?? ""; + message.clientId = object.clientId ?? ""; + message.checksum = object.checksum ?? new Uint8Array(); + message.msg = object.msg ?? new Uint8Array(); + return message; + }, + fromAmino(object: MsgMigrateContractAmino): MsgMigrateContract { + const message = createBaseMsgMigrateContract(); + if (object.signer !== undefined && object.signer !== null) { + message.signer = object.signer; + } + if (object.client_id !== undefined && object.client_id !== null) { + message.clientId = object.client_id; + } + if (object.checksum !== undefined && object.checksum !== null) { + message.checksum = bytesFromBase64(object.checksum); + } + if (object.msg !== undefined && object.msg !== null) { + message.msg = bytesFromBase64(object.msg); + } + return message; + }, + toAmino(message: MsgMigrateContract): MsgMigrateContractAmino { + const obj: any = {}; + obj.signer = message.signer === "" ? undefined : message.signer; + obj.client_id = message.clientId === "" ? undefined : message.clientId; + obj.checksum = message.checksum ? base64FromBytes(message.checksum) : undefined; + obj.msg = message.msg ? base64FromBytes(message.msg) : undefined; + return obj; + }, + fromAminoMsg(object: MsgMigrateContractAminoMsg): MsgMigrateContract { + return MsgMigrateContract.fromAmino(object.value); + }, + toAminoMsg(message: MsgMigrateContract): MsgMigrateContractAminoMsg { + return { + type: "cosmos-sdk/MsgMigrateContract", + value: MsgMigrateContract.toAmino(message) + }; + }, + fromProtoMsg(message: MsgMigrateContractProtoMsg): MsgMigrateContract { + return MsgMigrateContract.decode(message.value); + }, + toProto(message: MsgMigrateContract): Uint8Array { + return MsgMigrateContract.encode(message).finish(); + }, + toProtoMsg(message: MsgMigrateContract): MsgMigrateContractProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgMigrateContract", + value: MsgMigrateContract.encode(message).finish() + }; + } +}; +function createBaseMsgMigrateContractResponse(): MsgMigrateContractResponse { + return {}; +} +export const MsgMigrateContractResponse = { + typeUrl: "/ibc.lightclients.wasm.v1.MsgMigrateContractResponse", + encode(_: MsgMigrateContractResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): MsgMigrateContractResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMigrateContractResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(_: Partial): MsgMigrateContractResponse { + const message = createBaseMsgMigrateContractResponse(); + return message; + }, + fromAmino(_: MsgMigrateContractResponseAmino): MsgMigrateContractResponse { + const message = createBaseMsgMigrateContractResponse(); + return message; + }, + toAmino(_: MsgMigrateContractResponse): MsgMigrateContractResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgMigrateContractResponseAminoMsg): MsgMigrateContractResponse { + return MsgMigrateContractResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgMigrateContractResponse): MsgMigrateContractResponseAminoMsg { + return { + type: "cosmos-sdk/MsgMigrateContractResponse", + value: MsgMigrateContractResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgMigrateContractResponseProtoMsg): MsgMigrateContractResponse { + return MsgMigrateContractResponse.decode(message.value); + }, + toProto(message: MsgMigrateContractResponse): Uint8Array { + return MsgMigrateContractResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgMigrateContractResponse): MsgMigrateContractResponseProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.MsgMigrateContractResponse", + value: MsgMigrateContractResponse.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/ibc/lightclients/wasm/v1/wasm.ts b/src/codegen/ibc/lightclients/wasm/v1/wasm.ts new file mode 100644 index 0000000..671698d --- /dev/null +++ b/src/codegen/ibc/lightclients/wasm/v1/wasm.ts @@ -0,0 +1,425 @@ +import { Height, HeightAmino, HeightSDKType } from "../../../core/client/v1/client"; +import { BinaryReader, BinaryWriter } from "../../../../binary"; +import { bytesFromBase64, base64FromBytes } from "../../../../helpers"; +/** Wasm light client's Client state */ +export interface ClientState { + /** + * bytes encoding the client state of the underlying light client + * implemented as a Wasm contract. + */ + data: Uint8Array; + checksum: Uint8Array; + latestHeight: Height; +} +export interface ClientStateProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.ClientState"; + value: Uint8Array; +} +/** Wasm light client's Client state */ +export interface ClientStateAmino { + /** + * bytes encoding the client state of the underlying light client + * implemented as a Wasm contract. + */ + data?: string; + checksum?: string; + latest_height?: HeightAmino; +} +export interface ClientStateAminoMsg { + type: "cosmos-sdk/ClientState"; + value: ClientStateAmino; +} +/** Wasm light client's Client state */ +export interface ClientStateSDKType { + data: Uint8Array; + checksum: Uint8Array; + latest_height: HeightSDKType; +} +/** Wasm light client's ConsensusState */ +export interface ConsensusState { + /** + * bytes encoding the consensus state of the underlying light client + * implemented as a Wasm contract. + */ + data: Uint8Array; +} +export interface ConsensusStateProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.ConsensusState"; + value: Uint8Array; +} +/** Wasm light client's ConsensusState */ +export interface ConsensusStateAmino { + /** + * bytes encoding the consensus state of the underlying light client + * implemented as a Wasm contract. + */ + data?: string; +} +export interface ConsensusStateAminoMsg { + type: "cosmos-sdk/ConsensusState"; + value: ConsensusStateAmino; +} +/** Wasm light client's ConsensusState */ +export interface ConsensusStateSDKType { + data: Uint8Array; +} +/** Wasm light client message (either header(s) or misbehaviour) */ +export interface ClientMessage { + data: Uint8Array; +} +export interface ClientMessageProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.ClientMessage"; + value: Uint8Array; +} +/** Wasm light client message (either header(s) or misbehaviour) */ +export interface ClientMessageAmino { + data?: string; +} +export interface ClientMessageAminoMsg { + type: "cosmos-sdk/ClientMessage"; + value: ClientMessageAmino; +} +/** Wasm light client message (either header(s) or misbehaviour) */ +export interface ClientMessageSDKType { + data: Uint8Array; +} +/** + * Checksums defines a list of all checksums that are stored + * + * Deprecated: This message is deprecated in favor of storing the checksums + * using a Collections.KeySet. + */ +/** @deprecated */ +export interface Checksums { + checksums: Uint8Array[]; +} +export interface ChecksumsProtoMsg { + typeUrl: "/ibc.lightclients.wasm.v1.Checksums"; + value: Uint8Array; +} +/** + * Checksums defines a list of all checksums that are stored + * + * Deprecated: This message is deprecated in favor of storing the checksums + * using a Collections.KeySet. + */ +/** @deprecated */ +export interface ChecksumsAmino { + checksums?: string[]; +} +export interface ChecksumsAminoMsg { + type: "cosmos-sdk/Checksums"; + value: ChecksumsAmino; +} +/** + * Checksums defines a list of all checksums that are stored + * + * Deprecated: This message is deprecated in favor of storing the checksums + * using a Collections.KeySet. + */ +/** @deprecated */ +export interface ChecksumsSDKType { + checksums: Uint8Array[]; +} +function createBaseClientState(): ClientState { + return { + data: new Uint8Array(), + checksum: new Uint8Array(), + latestHeight: Height.fromPartial({}) + }; +} +export const ClientState = { + typeUrl: "/ibc.lightclients.wasm.v1.ClientState", + encode(message: ClientState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + if (message.checksum.length !== 0) { + writer.uint32(18).bytes(message.checksum); + } + if (message.latestHeight !== undefined) { + Height.encode(message.latestHeight, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ClientState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + case 2: + message.checksum = reader.bytes(); + break; + case 3: + message.latestHeight = Height.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ClientState { + const message = createBaseClientState(); + message.data = object.data ?? new Uint8Array(); + message.checksum = object.checksum ?? new Uint8Array(); + message.latestHeight = object.latestHeight !== undefined && object.latestHeight !== null ? Height.fromPartial(object.latestHeight) : undefined; + return message; + }, + fromAmino(object: ClientStateAmino): ClientState { + const message = createBaseClientState(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.checksum !== undefined && object.checksum !== null) { + message.checksum = bytesFromBase64(object.checksum); + } + if (object.latest_height !== undefined && object.latest_height !== null) { + message.latestHeight = Height.fromAmino(object.latest_height); + } + return message; + }, + toAmino(message: ClientState): ClientStateAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + obj.checksum = message.checksum ? base64FromBytes(message.checksum) : undefined; + obj.latest_height = message.latestHeight ? Height.toAmino(message.latestHeight) : {}; + return obj; + }, + fromAminoMsg(object: ClientStateAminoMsg): ClientState { + return ClientState.fromAmino(object.value); + }, + toAminoMsg(message: ClientState): ClientStateAminoMsg { + return { + type: "cosmos-sdk/ClientState", + value: ClientState.toAmino(message) + }; + }, + fromProtoMsg(message: ClientStateProtoMsg): ClientState { + return ClientState.decode(message.value); + }, + toProto(message: ClientState): Uint8Array { + return ClientState.encode(message).finish(); + }, + toProtoMsg(message: ClientState): ClientStateProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.ClientState", + value: ClientState.encode(message).finish() + }; + } +}; +function createBaseConsensusState(): ConsensusState { + return { + data: new Uint8Array() + }; +} +export const ConsensusState = { + typeUrl: "/ibc.lightclients.wasm.v1.ConsensusState", + encode(message: ConsensusState, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ConsensusState { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConsensusState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ConsensusState { + const message = createBaseConsensusState(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: ConsensusStateAmino): ConsensusState { + const message = createBaseConsensusState(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: ConsensusState): ConsensusStateAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: ConsensusStateAminoMsg): ConsensusState { + return ConsensusState.fromAmino(object.value); + }, + toAminoMsg(message: ConsensusState): ConsensusStateAminoMsg { + return { + type: "cosmos-sdk/ConsensusState", + value: ConsensusState.toAmino(message) + }; + }, + fromProtoMsg(message: ConsensusStateProtoMsg): ConsensusState { + return ConsensusState.decode(message.value); + }, + toProto(message: ConsensusState): Uint8Array { + return ConsensusState.encode(message).finish(); + }, + toProtoMsg(message: ConsensusState): ConsensusStateProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.ConsensusState", + value: ConsensusState.encode(message).finish() + }; + } +}; +function createBaseClientMessage(): ClientMessage { + return { + data: new Uint8Array() + }; +} +export const ClientMessage = { + typeUrl: "/ibc.lightclients.wasm.v1.ClientMessage", + encode(message: ClientMessage, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data.length !== 0) { + writer.uint32(10).bytes(message.data); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ClientMessage { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientMessage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.data = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ClientMessage { + const message = createBaseClientMessage(); + message.data = object.data ?? new Uint8Array(); + return message; + }, + fromAmino(object: ClientMessageAmino): ClientMessage { + const message = createBaseClientMessage(); + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + return message; + }, + toAmino(message: ClientMessage): ClientMessageAmino { + const obj: any = {}; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + return obj; + }, + fromAminoMsg(object: ClientMessageAminoMsg): ClientMessage { + return ClientMessage.fromAmino(object.value); + }, + toAminoMsg(message: ClientMessage): ClientMessageAminoMsg { + return { + type: "cosmos-sdk/ClientMessage", + value: ClientMessage.toAmino(message) + }; + }, + fromProtoMsg(message: ClientMessageProtoMsg): ClientMessage { + return ClientMessage.decode(message.value); + }, + toProto(message: ClientMessage): Uint8Array { + return ClientMessage.encode(message).finish(); + }, + toProtoMsg(message: ClientMessage): ClientMessageProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.ClientMessage", + value: ClientMessage.encode(message).finish() + }; + } +}; +function createBaseChecksums(): Checksums { + return { + checksums: [] + }; +} +export const Checksums = { + typeUrl: "/ibc.lightclients.wasm.v1.Checksums", + encode(message: Checksums, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.checksums) { + writer.uint32(10).bytes(v!); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): Checksums { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseChecksums(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.checksums.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): Checksums { + const message = createBaseChecksums(); + message.checksums = object.checksums?.map(e => e) || []; + return message; + }, + fromAmino(object: ChecksumsAmino): Checksums { + const message = createBaseChecksums(); + message.checksums = object.checksums?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: Checksums): ChecksumsAmino { + const obj: any = {}; + if (message.checksums) { + obj.checksums = message.checksums.map(e => base64FromBytes(e)); + } else { + obj.checksums = message.checksums; + } + return obj; + }, + fromAminoMsg(object: ChecksumsAminoMsg): Checksums { + return Checksums.fromAmino(object.value); + }, + toAminoMsg(message: Checksums): ChecksumsAminoMsg { + return { + type: "cosmos-sdk/Checksums", + value: Checksums.toAmino(message) + }; + }, + fromProtoMsg(message: ChecksumsProtoMsg): Checksums { + return Checksums.decode(message.value); + }, + toProto(message: Checksums): Uint8Array { + return Checksums.encode(message).finish(); + }, + toProtoMsg(message: Checksums): ChecksumsProtoMsg { + return { + typeUrl: "/ibc.lightclients.wasm.v1.Checksums", + value: Checksums.encode(message).finish() + }; + } +}; \ No newline at end of file diff --git a/src/codegen/ibc/rpc.query.ts b/src/codegen/ibc/rpc.query.ts index 0c9ee73..debe2ad 100644 --- a/src/codegen/ibc/rpc.query.ts +++ b/src/codegen/ibc/rpc.query.ts @@ -9,12 +9,18 @@ export const createRPCQueryClient = async ({ const client = new QueryClient(tmClient); return { cosmos: { + app: { + v1alpha1: (await import("../cosmos/app/v1alpha1/query.rpc.Query")).createRpcQueryExtension(client) + }, auth: { v1beta1: (await import("../cosmos/auth/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, authz: { v1beta1: (await import("../cosmos/authz/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, + autocli: { + v1: (await import("../cosmos/autocli/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, bank: { v1beta1: (await import("../cosmos/bank/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, @@ -26,6 +32,12 @@ export const createRPCQueryClient = async ({ v1beta1: (await import("../cosmos/base/tendermint/v1beta1/query.rpc.Service")).createRpcQueryExtension(client) } }, + circuit: { + v1: (await import("../cosmos/circuit/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, + consensus: { + v1: (await import("../cosmos/consensus/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, distribution: { v1beta1: (await import("../cosmos/distribution/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, @@ -36,11 +48,23 @@ export const createRPCQueryClient = async ({ v1beta1: (await import("../cosmos/feegrant/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, gov: { + v1: (await import("../cosmos/gov/v1/query.rpc.Query")).createRpcQueryExtension(client), v1beta1: (await import("../cosmos/gov/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, + group: { + v1: (await import("../cosmos/group/v1/query.rpc.Query")).createRpcQueryExtension(client) + }, mint: { v1beta1: (await import("../cosmos/mint/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, + nft: { + v1beta1: (await import("../cosmos/nft/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + }, + orm: { + query: { + v1alpha1: (await import("../cosmos/orm/query/v1alpha1/query.rpc.Query")).createRpcQueryExtension(client) + } + }, params: { v1beta1: (await import("../cosmos/params/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, @@ -84,6 +108,11 @@ export const createRPCQueryClient = async ({ connection: { v1: (await import("./core/connection/v1/query.rpc.Query")).createRpcQueryExtension(client) } + }, + lightclients: { + wasm: { + v1: (await import("./lightclients/wasm/v1/query.rpc.Query")).createRpcQueryExtension(client) + } } } }; diff --git a/src/codegen/ibc/rpc.tx.ts b/src/codegen/ibc/rpc.tx.ts index 5398c98..b8883b0 100644 --- a/src/codegen/ibc/rpc.tx.ts +++ b/src/codegen/ibc/rpc.tx.ts @@ -5,12 +5,21 @@ export const createRPCMsgClient = async ({ rpc: Rpc; }) => ({ cosmos: { + auth: { + v1beta1: new (await import("../cosmos/auth/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, authz: { v1beta1: new (await import("../cosmos/authz/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, bank: { v1beta1: new (await import("../cosmos/bank/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, + circuit: { + v1: new (await import("../cosmos/circuit/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + consensus: { + v1: new (await import("../cosmos/consensus/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, crisis: { v1beta1: new (await import("../cosmos/crisis/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, @@ -24,14 +33,27 @@ export const createRPCMsgClient = async ({ v1beta1: new (await import("../cosmos/feegrant/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, gov: { + v1: new (await import("../cosmos/gov/v1/tx.rpc.msg")).MsgClientImpl(rpc), v1beta1: new (await import("../cosmos/gov/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, + group: { + v1: new (await import("../cosmos/group/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + mint: { + v1beta1: new (await import("../cosmos/mint/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + nft: { + v1beta1: new (await import("../cosmos/nft/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, slashing: { v1beta1: new (await import("../cosmos/slashing/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, staking: { v1beta1: new (await import("../cosmos/staking/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) }, + upgrade: { + v1beta1: new (await import("../cosmos/upgrade/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) + }, vesting: { v1beta1: new (await import("../cosmos/vesting/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) } @@ -41,6 +63,14 @@ export const createRPCMsgClient = async ({ fee: { v1: new (await import("./applications/fee/v1/tx.rpc.msg")).MsgClientImpl(rpc) }, + interchain_accounts: { + controller: { + v1: new (await import("./applications/interchain_accounts/controller/v1/tx.rpc.msg")).MsgClientImpl(rpc) + }, + host: { + v1: new (await import("./applications/interchain_accounts/host/v1/tx.rpc.msg")).MsgClientImpl(rpc) + } + }, transfer: { v1: new (await import("./applications/transfer/v1/tx.rpc.msg")).MsgClientImpl(rpc) } @@ -55,6 +85,11 @@ export const createRPCMsgClient = async ({ connection: { v1: new (await import("./core/connection/v1/tx.rpc.msg")).MsgClientImpl(rpc) } + }, + lightclients: { + wasm: { + v1: new (await import("./lightclients/wasm/v1/tx.rpc.msg")).MsgClientImpl(rpc) + } } } }); \ No newline at end of file diff --git a/src/codegen/index.ts b/src/codegen/index.ts index 6b3a40e..5699e5f 100644 --- a/src/codegen/index.ts +++ b/src/codegen/index.ts @@ -4,14 +4,15 @@ * and run the transpile command or yarn proto command to regenerate this bundle. */ -export * from "./ics23/bundle"; +export * from "./amino/bundle"; +export * from "./capability/bundle"; export * from "./cosmos_proto/bundle"; export * from "./cosmos/bundle"; export * from "./cosmos/client"; export * from "./cosmwasm/bundle"; export * from "./cosmwasm/client"; -export * from "./google/bundle"; export * from "./gogoproto/bundle"; +export * from "./google/bundle"; export * from "./ibc/bundle"; export * from "./ibc/client"; export * from "./tendermint/bundle"; diff --git a/src/codegen/tendermint/abci/types.ts b/src/codegen/tendermint/abci/types.ts index 909ba91..cda0473 100644 --- a/src/codegen/tendermint/abci/types.ts +++ b/src/codegen/tendermint/abci/types.ts @@ -1,8 +1,8 @@ import { Timestamp } from "../../google/protobuf/timestamp"; -import { Header, HeaderAmino, HeaderSDKType } from "../types/types"; +import { ConsensusParams, ConsensusParamsAmino, ConsensusParamsSDKType } from "../types/params"; import { ProofOps, ProofOpsAmino, ProofOpsSDKType } from "../crypto/proof"; -import { EvidenceParams, EvidenceParamsAmino, EvidenceParamsSDKType, ValidatorParams, ValidatorParamsAmino, ValidatorParamsSDKType, VersionParams, VersionParamsAmino, VersionParamsSDKType } from "../types/params"; import { PublicKey, PublicKeyAmino, PublicKeySDKType } from "../crypto/keys"; +import { BlockIDFlag } from "../types/validator"; import { BinaryReader, BinaryWriter } from "../../binary"; import { toTimestamp, fromTimestamp, bytesFromBase64, base64FromBytes } from "../../helpers"; export enum CheckTxType { @@ -161,40 +161,122 @@ export function responseApplySnapshotChunk_ResultToJSON(object: ResponseApplySna return "UNRECOGNIZED"; } } -export enum EvidenceType { +export enum ResponseProcessProposal_ProposalStatus { + UNKNOWN = 0, + ACCEPT = 1, + REJECT = 2, + UNRECOGNIZED = -1, +} +export const ResponseProcessProposal_ProposalStatusSDKType = ResponseProcessProposal_ProposalStatus; +export const ResponseProcessProposal_ProposalStatusAmino = ResponseProcessProposal_ProposalStatus; +export function responseProcessProposal_ProposalStatusFromJSON(object: any): ResponseProcessProposal_ProposalStatus { + switch (object) { + case 0: + case "UNKNOWN": + return ResponseProcessProposal_ProposalStatus.UNKNOWN; + case 1: + case "ACCEPT": + return ResponseProcessProposal_ProposalStatus.ACCEPT; + case 2: + case "REJECT": + return ResponseProcessProposal_ProposalStatus.REJECT; + case -1: + case "UNRECOGNIZED": + default: + return ResponseProcessProposal_ProposalStatus.UNRECOGNIZED; + } +} +export function responseProcessProposal_ProposalStatusToJSON(object: ResponseProcessProposal_ProposalStatus): string { + switch (object) { + case ResponseProcessProposal_ProposalStatus.UNKNOWN: + return "UNKNOWN"; + case ResponseProcessProposal_ProposalStatus.ACCEPT: + return "ACCEPT"; + case ResponseProcessProposal_ProposalStatus.REJECT: + return "REJECT"; + case ResponseProcessProposal_ProposalStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum ResponseVerifyVoteExtension_VerifyStatus { + UNKNOWN = 0, + ACCEPT = 1, + /** + * REJECT - Rejecting the vote extension will reject the entire precommit by the sender. + * Incorrectly implementing this thus has liveness implications as it may affect + * CometBFT's ability to receive 2/3+ valid votes to finalize the block. + * Honest nodes should never be rejected. + */ + REJECT = 2, + UNRECOGNIZED = -1, +} +export const ResponseVerifyVoteExtension_VerifyStatusSDKType = ResponseVerifyVoteExtension_VerifyStatus; +export const ResponseVerifyVoteExtension_VerifyStatusAmino = ResponseVerifyVoteExtension_VerifyStatus; +export function responseVerifyVoteExtension_VerifyStatusFromJSON(object: any): ResponseVerifyVoteExtension_VerifyStatus { + switch (object) { + case 0: + case "UNKNOWN": + return ResponseVerifyVoteExtension_VerifyStatus.UNKNOWN; + case 1: + case "ACCEPT": + return ResponseVerifyVoteExtension_VerifyStatus.ACCEPT; + case 2: + case "REJECT": + return ResponseVerifyVoteExtension_VerifyStatus.REJECT; + case -1: + case "UNRECOGNIZED": + default: + return ResponseVerifyVoteExtension_VerifyStatus.UNRECOGNIZED; + } +} +export function responseVerifyVoteExtension_VerifyStatusToJSON(object: ResponseVerifyVoteExtension_VerifyStatus): string { + switch (object) { + case ResponseVerifyVoteExtension_VerifyStatus.UNKNOWN: + return "UNKNOWN"; + case ResponseVerifyVoteExtension_VerifyStatus.ACCEPT: + return "ACCEPT"; + case ResponseVerifyVoteExtension_VerifyStatus.REJECT: + return "REJECT"; + case ResponseVerifyVoteExtension_VerifyStatus.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} +export enum MisbehaviorType { UNKNOWN = 0, DUPLICATE_VOTE = 1, LIGHT_CLIENT_ATTACK = 2, UNRECOGNIZED = -1, } -export const EvidenceTypeSDKType = EvidenceType; -export const EvidenceTypeAmino = EvidenceType; -export function evidenceTypeFromJSON(object: any): EvidenceType { +export const MisbehaviorTypeSDKType = MisbehaviorType; +export const MisbehaviorTypeAmino = MisbehaviorType; +export function misbehaviorTypeFromJSON(object: any): MisbehaviorType { switch (object) { case 0: case "UNKNOWN": - return EvidenceType.UNKNOWN; + return MisbehaviorType.UNKNOWN; case 1: case "DUPLICATE_VOTE": - return EvidenceType.DUPLICATE_VOTE; + return MisbehaviorType.DUPLICATE_VOTE; case 2: case "LIGHT_CLIENT_ATTACK": - return EvidenceType.LIGHT_CLIENT_ATTACK; + return MisbehaviorType.LIGHT_CLIENT_ATTACK; case -1: case "UNRECOGNIZED": default: - return EvidenceType.UNRECOGNIZED; + return MisbehaviorType.UNRECOGNIZED; } } -export function evidenceTypeToJSON(object: EvidenceType): string { +export function misbehaviorTypeToJSON(object: MisbehaviorType): string { switch (object) { - case EvidenceType.UNKNOWN: + case MisbehaviorType.UNKNOWN: return "UNKNOWN"; - case EvidenceType.DUPLICATE_VOTE: + case MisbehaviorType.DUPLICATE_VOTE: return "DUPLICATE_VOTE"; - case EvidenceType.LIGHT_CLIENT_ATTACK: + case MisbehaviorType.LIGHT_CLIENT_ATTACK: return "LIGHT_CLIENT_ATTACK"; - case EvidenceType.UNRECOGNIZED: + case MisbehaviorType.UNRECOGNIZED: default: return "UNRECOGNIZED"; } @@ -203,18 +285,19 @@ export interface Request { echo?: RequestEcho; flush?: RequestFlush; info?: RequestInfo; - setOption?: RequestSetOption; initChain?: RequestInitChain; query?: RequestQuery; - beginBlock?: RequestBeginBlock; checkTx?: RequestCheckTx; - deliverTx?: RequestDeliverTx; - endBlock?: RequestEndBlock; commit?: RequestCommit; listSnapshots?: RequestListSnapshots; offerSnapshot?: RequestOfferSnapshot; loadSnapshotChunk?: RequestLoadSnapshotChunk; applySnapshotChunk?: RequestApplySnapshotChunk; + prepareProposal?: RequestPrepareProposal; + processProposal?: RequestProcessProposal; + extendVote?: RequestExtendVote; + verifyVoteExtension?: RequestVerifyVoteExtension; + finalizeBlock?: RequestFinalizeBlock; } export interface RequestProtoMsg { typeUrl: "/tendermint.abci.Request"; @@ -224,18 +307,19 @@ export interface RequestAmino { echo?: RequestEchoAmino; flush?: RequestFlushAmino; info?: RequestInfoAmino; - set_option?: RequestSetOptionAmino; init_chain?: RequestInitChainAmino; query?: RequestQueryAmino; - begin_block?: RequestBeginBlockAmino; check_tx?: RequestCheckTxAmino; - deliver_tx?: RequestDeliverTxAmino; - end_block?: RequestEndBlockAmino; commit?: RequestCommitAmino; list_snapshots?: RequestListSnapshotsAmino; offer_snapshot?: RequestOfferSnapshotAmino; load_snapshot_chunk?: RequestLoadSnapshotChunkAmino; apply_snapshot_chunk?: RequestApplySnapshotChunkAmino; + prepare_proposal?: RequestPrepareProposalAmino; + process_proposal?: RequestProcessProposalAmino; + extend_vote?: RequestExtendVoteAmino; + verify_vote_extension?: RequestVerifyVoteExtensionAmino; + finalize_block?: RequestFinalizeBlockAmino; } export interface RequestAminoMsg { type: "/tendermint.abci.Request"; @@ -245,18 +329,19 @@ export interface RequestSDKType { echo?: RequestEchoSDKType; flush?: RequestFlushSDKType; info?: RequestInfoSDKType; - set_option?: RequestSetOptionSDKType; init_chain?: RequestInitChainSDKType; query?: RequestQuerySDKType; - begin_block?: RequestBeginBlockSDKType; check_tx?: RequestCheckTxSDKType; - deliver_tx?: RequestDeliverTxSDKType; - end_block?: RequestEndBlockSDKType; commit?: RequestCommitSDKType; list_snapshots?: RequestListSnapshotsSDKType; offer_snapshot?: RequestOfferSnapshotSDKType; load_snapshot_chunk?: RequestLoadSnapshotChunkSDKType; apply_snapshot_chunk?: RequestApplySnapshotChunkSDKType; + prepare_proposal?: RequestPrepareProposalSDKType; + process_proposal?: RequestProcessProposalSDKType; + extend_vote?: RequestExtendVoteSDKType; + verify_vote_extension?: RequestVerifyVoteExtensionSDKType; + finalize_block?: RequestFinalizeBlockSDKType; } export interface RequestEcho { message: string; @@ -290,6 +375,7 @@ export interface RequestInfo { version: string; blockVersion: bigint; p2pVersion: bigint; + abciVersion: string; } export interface RequestInfoProtoMsg { typeUrl: "/tendermint.abci.RequestInfo"; @@ -299,6 +385,7 @@ export interface RequestInfoAmino { version?: string; block_version?: string; p2p_version?: string; + abci_version?: string; } export interface RequestInfoAminoMsg { type: "/tendermint.abci.RequestInfo"; @@ -308,29 +395,7 @@ export interface RequestInfoSDKType { version: string; block_version: bigint; p2p_version: bigint; -} -/** nondeterministic */ -export interface RequestSetOption { - key: string; - value: string; -} -export interface RequestSetOptionProtoMsg { - typeUrl: "/tendermint.abci.RequestSetOption"; - value: Uint8Array; -} -/** nondeterministic */ -export interface RequestSetOptionAmino { - key?: string; - value?: string; -} -export interface RequestSetOptionAminoMsg { - type: "/tendermint.abci.RequestSetOption"; - value: RequestSetOptionAmino; -} -/** nondeterministic */ -export interface RequestSetOptionSDKType { - key: string; - value: string; + abci_version: string; } export interface RequestInitChain { time: Date; @@ -390,32 +455,6 @@ export interface RequestQuerySDKType { height: bigint; prove: boolean; } -export interface RequestBeginBlock { - hash: Uint8Array; - header: Header; - lastCommitInfo: LastCommitInfo; - byzantineValidators: Evidence[]; -} -export interface RequestBeginBlockProtoMsg { - typeUrl: "/tendermint.abci.RequestBeginBlock"; - value: Uint8Array; -} -export interface RequestBeginBlockAmino { - hash?: string; - header?: HeaderAmino; - last_commit_info?: LastCommitInfoAmino; - byzantine_validators?: EvidenceAmino[]; -} -export interface RequestBeginBlockAminoMsg { - type: "/tendermint.abci.RequestBeginBlock"; - value: RequestBeginBlockAmino; -} -export interface RequestBeginBlockSDKType { - hash: Uint8Array; - header: HeaderSDKType; - last_commit_info: LastCommitInfoSDKType; - byzantine_validators: EvidenceSDKType[]; -} export interface RequestCheckTx { tx: Uint8Array; type: CheckTxType; @@ -436,40 +475,6 @@ export interface RequestCheckTxSDKType { tx: Uint8Array; type: CheckTxType; } -export interface RequestDeliverTx { - tx: Uint8Array; -} -export interface RequestDeliverTxProtoMsg { - typeUrl: "/tendermint.abci.RequestDeliverTx"; - value: Uint8Array; -} -export interface RequestDeliverTxAmino { - tx?: string; -} -export interface RequestDeliverTxAminoMsg { - type: "/tendermint.abci.RequestDeliverTx"; - value: RequestDeliverTxAmino; -} -export interface RequestDeliverTxSDKType { - tx: Uint8Array; -} -export interface RequestEndBlock { - height: bigint; -} -export interface RequestEndBlockProtoMsg { - typeUrl: "/tendermint.abci.RequestEndBlock"; - value: Uint8Array; -} -export interface RequestEndBlockAmino { - height?: string; -} -export interface RequestEndBlockAminoMsg { - type: "/tendermint.abci.RequestEndBlock"; - value: RequestEndBlockAmino; -} -export interface RequestEndBlockSDKType { - height: bigint; -} export interface RequestCommit {} export interface RequestCommitProtoMsg { typeUrl: "/tendermint.abci.RequestCommit"; @@ -574,23 +579,240 @@ export interface RequestApplySnapshotChunkSDKType { chunk: Uint8Array; sender: string; } +export interface RequestPrepareProposal { + /** the modified transactions cannot exceed this size. */ + maxTxBytes: bigint; + /** + * txs is an array of transactions that will be included in a block, + * sent to the app for possible modifications. + */ + txs: Uint8Array[]; + localLastCommit: ExtendedCommitInfo; + misbehavior: Misbehavior[]; + height: bigint; + time: Date; + nextValidatorsHash: Uint8Array; + /** address of the public key of the validator proposing the block. */ + proposerAddress: Uint8Array; +} +export interface RequestPrepareProposalProtoMsg { + typeUrl: "/tendermint.abci.RequestPrepareProposal"; + value: Uint8Array; +} +export interface RequestPrepareProposalAmino { + /** the modified transactions cannot exceed this size. */ + max_tx_bytes?: string; + /** + * txs is an array of transactions that will be included in a block, + * sent to the app for possible modifications. + */ + txs?: string[]; + local_last_commit?: ExtendedCommitInfoAmino; + misbehavior?: MisbehaviorAmino[]; + height?: string; + time?: string; + next_validators_hash?: string; + /** address of the public key of the validator proposing the block. */ + proposer_address?: string; +} +export interface RequestPrepareProposalAminoMsg { + type: "/tendermint.abci.RequestPrepareProposal"; + value: RequestPrepareProposalAmino; +} +export interface RequestPrepareProposalSDKType { + max_tx_bytes: bigint; + txs: Uint8Array[]; + local_last_commit: ExtendedCommitInfoSDKType; + misbehavior: MisbehaviorSDKType[]; + height: bigint; + time: Date; + next_validators_hash: Uint8Array; + proposer_address: Uint8Array; +} +export interface RequestProcessProposal { + txs: Uint8Array[]; + proposedLastCommit: CommitInfo; + misbehavior: Misbehavior[]; + /** hash is the merkle root hash of the fields of the proposed block. */ + hash: Uint8Array; + height: bigint; + time: Date; + nextValidatorsHash: Uint8Array; + /** address of the public key of the original proposer of the block. */ + proposerAddress: Uint8Array; +} +export interface RequestProcessProposalProtoMsg { + typeUrl: "/tendermint.abci.RequestProcessProposal"; + value: Uint8Array; +} +export interface RequestProcessProposalAmino { + txs?: string[]; + proposed_last_commit?: CommitInfoAmino; + misbehavior?: MisbehaviorAmino[]; + /** hash is the merkle root hash of the fields of the proposed block. */ + hash?: string; + height?: string; + time?: string; + next_validators_hash?: string; + /** address of the public key of the original proposer of the block. */ + proposer_address?: string; +} +export interface RequestProcessProposalAminoMsg { + type: "/tendermint.abci.RequestProcessProposal"; + value: RequestProcessProposalAmino; +} +export interface RequestProcessProposalSDKType { + txs: Uint8Array[]; + proposed_last_commit: CommitInfoSDKType; + misbehavior: MisbehaviorSDKType[]; + hash: Uint8Array; + height: bigint; + time: Date; + next_validators_hash: Uint8Array; + proposer_address: Uint8Array; +} +/** Extends a vote with application-injected data */ +export interface RequestExtendVote { + /** the hash of the block that this vote may be referring to */ + hash: Uint8Array; + /** the height of the extended vote */ + height: bigint; + /** info of the block that this vote may be referring to */ + time: Date; + txs: Uint8Array[]; + proposedLastCommit: CommitInfo; + misbehavior: Misbehavior[]; + nextValidatorsHash: Uint8Array; + /** address of the public key of the original proposer of the block. */ + proposerAddress: Uint8Array; +} +export interface RequestExtendVoteProtoMsg { + typeUrl: "/tendermint.abci.RequestExtendVote"; + value: Uint8Array; +} +/** Extends a vote with application-injected data */ +export interface RequestExtendVoteAmino { + /** the hash of the block that this vote may be referring to */ + hash?: string; + /** the height of the extended vote */ + height?: string; + /** info of the block that this vote may be referring to */ + time?: string; + txs?: string[]; + proposed_last_commit?: CommitInfoAmino; + misbehavior?: MisbehaviorAmino[]; + next_validators_hash?: string; + /** address of the public key of the original proposer of the block. */ + proposer_address?: string; +} +export interface RequestExtendVoteAminoMsg { + type: "/tendermint.abci.RequestExtendVote"; + value: RequestExtendVoteAmino; +} +/** Extends a vote with application-injected data */ +export interface RequestExtendVoteSDKType { + hash: Uint8Array; + height: bigint; + time: Date; + txs: Uint8Array[]; + proposed_last_commit: CommitInfoSDKType; + misbehavior: MisbehaviorSDKType[]; + next_validators_hash: Uint8Array; + proposer_address: Uint8Array; +} +/** Verify the vote extension */ +export interface RequestVerifyVoteExtension { + /** the hash of the block that this received vote corresponds to */ + hash: Uint8Array; + /** the validator that signed the vote extension */ + validatorAddress: Uint8Array; + height: bigint; + voteExtension: Uint8Array; +} +export interface RequestVerifyVoteExtensionProtoMsg { + typeUrl: "/tendermint.abci.RequestVerifyVoteExtension"; + value: Uint8Array; +} +/** Verify the vote extension */ +export interface RequestVerifyVoteExtensionAmino { + /** the hash of the block that this received vote corresponds to */ + hash?: string; + /** the validator that signed the vote extension */ + validator_address?: string; + height?: string; + vote_extension?: string; +} +export interface RequestVerifyVoteExtensionAminoMsg { + type: "/tendermint.abci.RequestVerifyVoteExtension"; + value: RequestVerifyVoteExtensionAmino; +} +/** Verify the vote extension */ +export interface RequestVerifyVoteExtensionSDKType { + hash: Uint8Array; + validator_address: Uint8Array; + height: bigint; + vote_extension: Uint8Array; +} +export interface RequestFinalizeBlock { + txs: Uint8Array[]; + decidedLastCommit: CommitInfo; + misbehavior: Misbehavior[]; + /** hash is the merkle root hash of the fields of the decided block. */ + hash: Uint8Array; + height: bigint; + time: Date; + nextValidatorsHash: Uint8Array; + /** proposer_address is the address of the public key of the original proposer of the block. */ + proposerAddress: Uint8Array; +} +export interface RequestFinalizeBlockProtoMsg { + typeUrl: "/tendermint.abci.RequestFinalizeBlock"; + value: Uint8Array; +} +export interface RequestFinalizeBlockAmino { + txs?: string[]; + decided_last_commit?: CommitInfoAmino; + misbehavior?: MisbehaviorAmino[]; + /** hash is the merkle root hash of the fields of the decided block. */ + hash?: string; + height?: string; + time?: string; + next_validators_hash?: string; + /** proposer_address is the address of the public key of the original proposer of the block. */ + proposer_address?: string; +} +export interface RequestFinalizeBlockAminoMsg { + type: "/tendermint.abci.RequestFinalizeBlock"; + value: RequestFinalizeBlockAmino; +} +export interface RequestFinalizeBlockSDKType { + txs: Uint8Array[]; + decided_last_commit: CommitInfoSDKType; + misbehavior: MisbehaviorSDKType[]; + hash: Uint8Array; + height: bigint; + time: Date; + next_validators_hash: Uint8Array; + proposer_address: Uint8Array; +} export interface Response { exception?: ResponseException; echo?: ResponseEcho; flush?: ResponseFlush; info?: ResponseInfo; - setOption?: ResponseSetOption; initChain?: ResponseInitChain; query?: ResponseQuery; - beginBlock?: ResponseBeginBlock; checkTx?: ResponseCheckTx; - deliverTx?: ResponseDeliverTx; - endBlock?: ResponseEndBlock; commit?: ResponseCommit; listSnapshots?: ResponseListSnapshots; offerSnapshot?: ResponseOfferSnapshot; loadSnapshotChunk?: ResponseLoadSnapshotChunk; applySnapshotChunk?: ResponseApplySnapshotChunk; + prepareProposal?: ResponsePrepareProposal; + processProposal?: ResponseProcessProposal; + extendVote?: ResponseExtendVote; + verifyVoteExtension?: ResponseVerifyVoteExtension; + finalizeBlock?: ResponseFinalizeBlock; } export interface ResponseProtoMsg { typeUrl: "/tendermint.abci.Response"; @@ -601,18 +823,19 @@ export interface ResponseAmino { echo?: ResponseEchoAmino; flush?: ResponseFlushAmino; info?: ResponseInfoAmino; - set_option?: ResponseSetOptionAmino; init_chain?: ResponseInitChainAmino; query?: ResponseQueryAmino; - begin_block?: ResponseBeginBlockAmino; check_tx?: ResponseCheckTxAmino; - deliver_tx?: ResponseDeliverTxAmino; - end_block?: ResponseEndBlockAmino; commit?: ResponseCommitAmino; list_snapshots?: ResponseListSnapshotsAmino; offer_snapshot?: ResponseOfferSnapshotAmino; load_snapshot_chunk?: ResponseLoadSnapshotChunkAmino; apply_snapshot_chunk?: ResponseApplySnapshotChunkAmino; + prepare_proposal?: ResponsePrepareProposalAmino; + process_proposal?: ResponseProcessProposalAmino; + extend_vote?: ResponseExtendVoteAmino; + verify_vote_extension?: ResponseVerifyVoteExtensionAmino; + finalize_block?: ResponseFinalizeBlockAmino; } export interface ResponseAminoMsg { type: "/tendermint.abci.Response"; @@ -623,18 +846,19 @@ export interface ResponseSDKType { echo?: ResponseEchoSDKType; flush?: ResponseFlushSDKType; info?: ResponseInfoSDKType; - set_option?: ResponseSetOptionSDKType; init_chain?: ResponseInitChainSDKType; query?: ResponseQuerySDKType; - begin_block?: ResponseBeginBlockSDKType; check_tx?: ResponseCheckTxSDKType; - deliver_tx?: ResponseDeliverTxSDKType; - end_block?: ResponseEndBlockSDKType; commit?: ResponseCommitSDKType; list_snapshots?: ResponseListSnapshotsSDKType; offer_snapshot?: ResponseOfferSnapshotSDKType; load_snapshot_chunk?: ResponseLoadSnapshotChunkSDKType; apply_snapshot_chunk?: ResponseApplySnapshotChunkSDKType; + prepare_proposal?: ResponsePrepareProposalSDKType; + process_proposal?: ResponseProcessProposalSDKType; + extend_vote?: ResponseExtendVoteSDKType; + verify_vote_extension?: ResponseVerifyVoteExtensionSDKType; + finalize_block?: ResponseFinalizeBlockSDKType; } /** nondeterministic */ export interface ResponseException { @@ -713,34 +937,6 @@ export interface ResponseInfoSDKType { last_block_height: bigint; last_block_app_hash: Uint8Array; } -/** nondeterministic */ -export interface ResponseSetOption { - code: number; - /** bytes data = 2; */ - log: string; - info: string; -} -export interface ResponseSetOptionProtoMsg { - typeUrl: "/tendermint.abci.ResponseSetOption"; - value: Uint8Array; -} -/** nondeterministic */ -export interface ResponseSetOptionAmino { - code?: number; - /** bytes data = 2; */ - log?: string; - info?: string; -} -export interface ResponseSetOptionAminoMsg { - type: "/tendermint.abci.ResponseSetOption"; - value: ResponseSetOptionAmino; -} -/** nondeterministic */ -export interface ResponseSetOptionSDKType { - code: number; - log: string; - info: string; -} export interface ResponseInitChain { consensusParams?: ConsensusParams; validators: ValidatorUpdate[]; @@ -809,23 +1005,6 @@ export interface ResponseQuerySDKType { height: bigint; codespace: string; } -export interface ResponseBeginBlock { - events: Event[]; -} -export interface ResponseBeginBlockProtoMsg { - typeUrl: "/tendermint.abci.ResponseBeginBlock"; - value: Uint8Array; -} -export interface ResponseBeginBlockAmino { - events?: EventAmino[]; -} -export interface ResponseBeginBlockAminoMsg { - type: "/tendermint.abci.ResponseBeginBlock"; - value: ResponseBeginBlockAmino; -} -export interface ResponseBeginBlockSDKType { - events: EventSDKType[]; -} export interface ResponseCheckTx { code: number; data: Uint8Array; @@ -837,13 +1016,6 @@ export interface ResponseCheckTx { gasUsed: bigint; events: Event[]; codespace: string; - sender: string; - priority: bigint; - /** - * mempool_error is set by CometBFT. - * ABCI applictions creating a ResponseCheckTX should not set mempool_error. - */ - mempoolError: string; } export interface ResponseCheckTxProtoMsg { typeUrl: "/tendermint.abci.ResponseCheckTx"; @@ -860,13 +1032,6 @@ export interface ResponseCheckTxAmino { gas_used?: string; events?: EventAmino[]; codespace?: string; - sender?: string; - priority?: string; - /** - * mempool_error is set by CometBFT. - * ABCI applictions creating a ResponseCheckTX should not set mempool_error. - */ - mempool_error?: string; } export interface ResponseCheckTxAminoMsg { type: "/tendermint.abci.ResponseCheckTx"; @@ -881,78 +1046,8 @@ export interface ResponseCheckTxSDKType { gas_used: bigint; events: EventSDKType[]; codespace: string; - sender: string; - priority: bigint; - mempool_error: string; -} -export interface ResponseDeliverTx { - code: number; - data: Uint8Array; - /** nondeterministic */ - log: string; - /** nondeterministic */ - info: string; - gasWanted: bigint; - gasUsed: bigint; - events: Event[]; - codespace: string; -} -export interface ResponseDeliverTxProtoMsg { - typeUrl: "/tendermint.abci.ResponseDeliverTx"; - value: Uint8Array; -} -export interface ResponseDeliverTxAmino { - code?: number; - data?: string; - /** nondeterministic */ - log?: string; - /** nondeterministic */ - info?: string; - gas_wanted?: string; - gas_used?: string; - events?: EventAmino[]; - codespace?: string; -} -export interface ResponseDeliverTxAminoMsg { - type: "/tendermint.abci.ResponseDeliverTx"; - value: ResponseDeliverTxAmino; -} -export interface ResponseDeliverTxSDKType { - code: number; - data: Uint8Array; - log: string; - info: string; - gas_wanted: bigint; - gas_used: bigint; - events: EventSDKType[]; - codespace: string; -} -export interface ResponseEndBlock { - validatorUpdates: ValidatorUpdate[]; - consensusParamUpdates?: ConsensusParams; - events: Event[]; -} -export interface ResponseEndBlockProtoMsg { - typeUrl: "/tendermint.abci.ResponseEndBlock"; - value: Uint8Array; -} -export interface ResponseEndBlockAmino { - validator_updates?: ValidatorUpdateAmino[]; - consensus_param_updates?: ConsensusParamsAmino; - events?: EventAmino[]; -} -export interface ResponseEndBlockAminoMsg { - type: "/tendermint.abci.ResponseEndBlock"; - value: ResponseEndBlockAmino; -} -export interface ResponseEndBlockSDKType { - validator_updates: ValidatorUpdateSDKType[]; - consensus_param_updates?: ConsensusParamsSDKType; - events: EventSDKType[]; } export interface ResponseCommit { - /** reserve 1 */ - data: Uint8Array; retainHeight: bigint; } export interface ResponseCommitProtoMsg { @@ -960,8 +1055,6 @@ export interface ResponseCommitProtoMsg { value: Uint8Array; } export interface ResponseCommitAmino { - /** reserve 1 */ - data?: string; retain_height?: string; } export interface ResponseCommitAminoMsg { @@ -969,7 +1062,6 @@ export interface ResponseCommitAminoMsg { value: ResponseCommitAmino; } export interface ResponseCommitSDKType { - data: Uint8Array; retain_height: bigint; } export interface ResponseListSnapshots { @@ -1050,94 +1142,195 @@ export interface ResponseApplySnapshotChunkSDKType { refetch_chunks: number[]; reject_senders: string[]; } -/** - * ConsensusParams contains all consensus-relevant parameters - * that can be adjusted by the abci app - */ -export interface ConsensusParams { - block?: BlockParams; - evidence?: EvidenceParams; - validator?: ValidatorParams; - version?: VersionParams; -} -export interface ConsensusParamsProtoMsg { - typeUrl: "/tendermint.abci.ConsensusParams"; +export interface ResponsePrepareProposal { + txs: Uint8Array[]; +} +export interface ResponsePrepareProposalProtoMsg { + typeUrl: "/tendermint.abci.ResponsePrepareProposal"; value: Uint8Array; } -/** - * ConsensusParams contains all consensus-relevant parameters - * that can be adjusted by the abci app - */ -export interface ConsensusParamsAmino { - block?: BlockParamsAmino; - evidence?: EvidenceParamsAmino; - validator?: ValidatorParamsAmino; - version?: VersionParamsAmino; +export interface ResponsePrepareProposalAmino { + txs?: string[]; } -export interface ConsensusParamsAminoMsg { - type: "/tendermint.abci.ConsensusParams"; - value: ConsensusParamsAmino; +export interface ResponsePrepareProposalAminoMsg { + type: "/tendermint.abci.ResponsePrepareProposal"; + value: ResponsePrepareProposalAmino; } -/** - * ConsensusParams contains all consensus-relevant parameters - * that can be adjusted by the abci app - */ -export interface ConsensusParamsSDKType { - block?: BlockParamsSDKType; - evidence?: EvidenceParamsSDKType; - validator?: ValidatorParamsSDKType; - version?: VersionParamsSDKType; -} -/** BlockParams contains limits on the block size. */ -export interface BlockParams { - /** Note: must be greater than 0 */ - maxBytes: bigint; - /** Note: must be greater or equal to -1 */ - maxGas: bigint; -} -export interface BlockParamsProtoMsg { - typeUrl: "/tendermint.abci.BlockParams"; +export interface ResponsePrepareProposalSDKType { + txs: Uint8Array[]; +} +export interface ResponseProcessProposal { + status: ResponseProcessProposal_ProposalStatus; +} +export interface ResponseProcessProposalProtoMsg { + typeUrl: "/tendermint.abci.ResponseProcessProposal"; value: Uint8Array; } -/** BlockParams contains limits on the block size. */ -export interface BlockParamsAmino { - /** Note: must be greater than 0 */ - max_bytes?: string; - /** Note: must be greater or equal to -1 */ - max_gas?: string; +export interface ResponseProcessProposalAmino { + status?: ResponseProcessProposal_ProposalStatus; } -export interface BlockParamsAminoMsg { - type: "/tendermint.abci.BlockParams"; - value: BlockParamsAmino; +export interface ResponseProcessProposalAminoMsg { + type: "/tendermint.abci.ResponseProcessProposal"; + value: ResponseProcessProposalAmino; } -/** BlockParams contains limits on the block size. */ -export interface BlockParamsSDKType { - max_bytes: bigint; - max_gas: bigint; +export interface ResponseProcessProposalSDKType { + status: ResponseProcessProposal_ProposalStatus; } -export interface LastCommitInfo { - round: number; - votes: VoteInfo[]; +export interface ResponseExtendVote { + voteExtension: Uint8Array; } -export interface LastCommitInfoProtoMsg { - typeUrl: "/tendermint.abci.LastCommitInfo"; +export interface ResponseExtendVoteProtoMsg { + typeUrl: "/tendermint.abci.ResponseExtendVote"; value: Uint8Array; } -export interface LastCommitInfoAmino { - round?: number; - votes?: VoteInfoAmino[]; +export interface ResponseExtendVoteAmino { + vote_extension?: string; } -export interface LastCommitInfoAminoMsg { - type: "/tendermint.abci.LastCommitInfo"; - value: LastCommitInfoAmino; +export interface ResponseExtendVoteAminoMsg { + type: "/tendermint.abci.ResponseExtendVote"; + value: ResponseExtendVoteAmino; } -export interface LastCommitInfoSDKType { - round: number; - votes: VoteInfoSDKType[]; +export interface ResponseExtendVoteSDKType { + vote_extension: Uint8Array; } -/** +export interface ResponseVerifyVoteExtension { + status: ResponseVerifyVoteExtension_VerifyStatus; +} +export interface ResponseVerifyVoteExtensionProtoMsg { + typeUrl: "/tendermint.abci.ResponseVerifyVoteExtension"; + value: Uint8Array; +} +export interface ResponseVerifyVoteExtensionAmino { + status?: ResponseVerifyVoteExtension_VerifyStatus; +} +export interface ResponseVerifyVoteExtensionAminoMsg { + type: "/tendermint.abci.ResponseVerifyVoteExtension"; + value: ResponseVerifyVoteExtensionAmino; +} +export interface ResponseVerifyVoteExtensionSDKType { + status: ResponseVerifyVoteExtension_VerifyStatus; +} +export interface ResponseFinalizeBlock { + /** set of block events emmitted as part of executing the block */ + events: Event[]; + /** + * the result of executing each transaction including the events + * the particular transction emitted. This should match the order + * of the transactions delivered in the block itself + */ + txResults: ExecTxResult[]; + /** a list of updates to the validator set. These will reflect the validator set at current height + 2. */ + validatorUpdates: ValidatorUpdate[]; + /** updates to the consensus params, if any. */ + consensusParamUpdates?: ConsensusParams; + /** + * app_hash is the hash of the applications' state which is used to confirm that execution of the transactions was + * deterministic. It is up to the application to decide which algorithm to use. + */ + appHash: Uint8Array; +} +export interface ResponseFinalizeBlockProtoMsg { + typeUrl: "/tendermint.abci.ResponseFinalizeBlock"; + value: Uint8Array; +} +export interface ResponseFinalizeBlockAmino { + /** set of block events emmitted as part of executing the block */ + events?: EventAmino[]; + /** + * the result of executing each transaction including the events + * the particular transction emitted. This should match the order + * of the transactions delivered in the block itself + */ + tx_results?: ExecTxResultAmino[]; + /** a list of updates to the validator set. These will reflect the validator set at current height + 2. */ + validator_updates?: ValidatorUpdateAmino[]; + /** updates to the consensus params, if any. */ + consensus_param_updates?: ConsensusParamsAmino; + /** + * app_hash is the hash of the applications' state which is used to confirm that execution of the transactions was + * deterministic. It is up to the application to decide which algorithm to use. + */ + app_hash?: string; +} +export interface ResponseFinalizeBlockAminoMsg { + type: "/tendermint.abci.ResponseFinalizeBlock"; + value: ResponseFinalizeBlockAmino; +} +export interface ResponseFinalizeBlockSDKType { + events: EventSDKType[]; + tx_results: ExecTxResultSDKType[]; + validator_updates: ValidatorUpdateSDKType[]; + consensus_param_updates?: ConsensusParamsSDKType; + app_hash: Uint8Array; +} +export interface CommitInfo { + round: number; + votes: VoteInfo[]; +} +export interface CommitInfoProtoMsg { + typeUrl: "/tendermint.abci.CommitInfo"; + value: Uint8Array; +} +export interface CommitInfoAmino { + round?: number; + votes?: VoteInfoAmino[]; +} +export interface CommitInfoAminoMsg { + type: "/tendermint.abci.CommitInfo"; + value: CommitInfoAmino; +} +export interface CommitInfoSDKType { + round: number; + votes: VoteInfoSDKType[]; +} +/** + * ExtendedCommitInfo is similar to CommitInfo except that it is only used in + * the PrepareProposal request such that CometBFT can provide vote extensions + * to the application. + */ +export interface ExtendedCommitInfo { + /** The round at which the block proposer decided in the previous height. */ + round: number; + /** + * List of validators' addresses in the last validator set with their voting + * information, including vote extensions. + */ + votes: ExtendedVoteInfo[]; +} +export interface ExtendedCommitInfoProtoMsg { + typeUrl: "/tendermint.abci.ExtendedCommitInfo"; + value: Uint8Array; +} +/** + * ExtendedCommitInfo is similar to CommitInfo except that it is only used in + * the PrepareProposal request such that CometBFT can provide vote extensions + * to the application. + */ +export interface ExtendedCommitInfoAmino { + /** The round at which the block proposer decided in the previous height. */ + round?: number; + /** + * List of validators' addresses in the last validator set with their voting + * information, including vote extensions. + */ + votes?: ExtendedVoteInfoAmino[]; +} +export interface ExtendedCommitInfoAminoMsg { + type: "/tendermint.abci.ExtendedCommitInfo"; + value: ExtendedCommitInfoAmino; +} +/** + * ExtendedCommitInfo is similar to CommitInfo except that it is only used in + * the PrepareProposal request such that CometBFT can provide vote extensions + * to the application. + */ +export interface ExtendedCommitInfoSDKType { + round: number; + votes: ExtendedVoteInfoSDKType[]; +} +/** * Event allows application developers to attach additional information to - * ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. + * ResponseFinalizeBlock and ResponseCheckTx. * Later, transactions may be queried using these events. */ export interface Event { @@ -1150,7 +1343,7 @@ export interface EventProtoMsg { } /** * Event allows application developers to attach additional information to - * ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. + * ResponseFinalizeBlock and ResponseCheckTx. * Later, transactions may be queried using these events. */ export interface EventAmino { @@ -1163,7 +1356,7 @@ export interface EventAminoMsg { } /** * Event allows application developers to attach additional information to - * ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. + * ResponseFinalizeBlock and ResponseCheckTx. * Later, transactions may be queried using these events. */ export interface EventSDKType { @@ -1172,8 +1365,8 @@ export interface EventSDKType { } /** EventAttribute is a single key-value pair, associated with an event. */ export interface EventAttribute { - key: Uint8Array; - value: Uint8Array; + key: string; + value: string; /** nondeterministic */ index: boolean; } @@ -1194,10 +1387,67 @@ export interface EventAttributeAminoMsg { } /** EventAttribute is a single key-value pair, associated with an event. */ export interface EventAttributeSDKType { - key: Uint8Array; - value: Uint8Array; + key: string; + value: string; index: boolean; } +/** + * ExecTxResult contains results of executing one individual transaction. + * + * * Its structure is equivalent to #ResponseDeliverTx which will be deprecated/deleted + */ +export interface ExecTxResult { + code: number; + data: Uint8Array; + /** nondeterministic */ + log: string; + /** nondeterministic */ + info: string; + gasWanted: bigint; + gasUsed: bigint; + events: Event[]; + codespace: string; +} +export interface ExecTxResultProtoMsg { + typeUrl: "/tendermint.abci.ExecTxResult"; + value: Uint8Array; +} +/** + * ExecTxResult contains results of executing one individual transaction. + * + * * Its structure is equivalent to #ResponseDeliverTx which will be deprecated/deleted + */ +export interface ExecTxResultAmino { + code?: number; + data?: string; + /** nondeterministic */ + log?: string; + /** nondeterministic */ + info?: string; + gas_wanted?: string; + gas_used?: string; + events?: EventAmino[]; + codespace?: string; +} +export interface ExecTxResultAminoMsg { + type: "/tendermint.abci.ExecTxResult"; + value: ExecTxResultAmino; +} +/** + * ExecTxResult contains results of executing one individual transaction. + * + * * Its structure is equivalent to #ResponseDeliverTx which will be deprecated/deleted + */ +export interface ExecTxResultSDKType { + code: number; + data: Uint8Array; + log: string; + info: string; + gas_wanted: bigint; + gas_used: bigint; + events: EventSDKType[]; + codespace: string; +} /** * TxResult contains results of executing the transaction. * @@ -1207,7 +1457,7 @@ export interface TxResult { height: bigint; index: number; tx: Uint8Array; - result: ResponseDeliverTx; + result: ExecTxResult; } export interface TxResultProtoMsg { typeUrl: "/tendermint.abci.TxResult"; @@ -1222,7 +1472,7 @@ export interface TxResultAmino { height?: string; index?: number; tx?: string; - result?: ResponseDeliverTxAmino; + result?: ExecTxResultAmino; } export interface TxResultAminoMsg { type: "/tendermint.abci.TxResult"; @@ -1237,9 +1487,8 @@ export interface TxResultSDKType { height: bigint; index: number; tx: Uint8Array; - result: ResponseDeliverTxSDKType; + result: ExecTxResultSDKType; } -/** Validator */ export interface Validator { /** * The first 20 bytes of SHA256(public key) @@ -1253,7 +1502,6 @@ export interface ValidatorProtoMsg { typeUrl: "/tendermint.abci.Validator"; value: Uint8Array; } -/** Validator */ export interface ValidatorAmino { /** * The first 20 bytes of SHA256(public key) @@ -1267,12 +1515,10 @@ export interface ValidatorAminoMsg { type: "/tendermint.abci.Validator"; value: ValidatorAmino; } -/** Validator */ export interface ValidatorSDKType { address: Uint8Array; power: bigint; } -/** ValidatorUpdate */ export interface ValidatorUpdate { pubKey: PublicKey; power: bigint; @@ -1281,7 +1527,6 @@ export interface ValidatorUpdateProtoMsg { typeUrl: "/tendermint.abci.ValidatorUpdate"; value: Uint8Array; } -/** ValidatorUpdate */ export interface ValidatorUpdateAmino { pub_key?: PublicKeyAmino; power?: string; @@ -1290,36 +1535,66 @@ export interface ValidatorUpdateAminoMsg { type: "/tendermint.abci.ValidatorUpdate"; value: ValidatorUpdateAmino; } -/** ValidatorUpdate */ export interface ValidatorUpdateSDKType { pub_key: PublicKeySDKType; power: bigint; } -/** VoteInfo */ export interface VoteInfo { validator: Validator; - signedLastBlock: boolean; + blockIdFlag: BlockIDFlag; } export interface VoteInfoProtoMsg { typeUrl: "/tendermint.abci.VoteInfo"; value: Uint8Array; } -/** VoteInfo */ export interface VoteInfoAmino { validator?: ValidatorAmino; - signed_last_block?: boolean; + block_id_flag?: BlockIDFlag; } export interface VoteInfoAminoMsg { type: "/tendermint.abci.VoteInfo"; value: VoteInfoAmino; } -/** VoteInfo */ export interface VoteInfoSDKType { validator: ValidatorSDKType; - signed_last_block: boolean; + block_id_flag: BlockIDFlag; +} +export interface ExtendedVoteInfo { + /** The validator that sent the vote. */ + validator: Validator; + /** Non-deterministic extension provided by the sending validator's application. */ + voteExtension: Uint8Array; + /** Vote extension signature created by CometBFT */ + extensionSignature: Uint8Array; + /** block_id_flag indicates whether the validator voted for a block, nil, or did not vote at all */ + blockIdFlag: BlockIDFlag; +} +export interface ExtendedVoteInfoProtoMsg { + typeUrl: "/tendermint.abci.ExtendedVoteInfo"; + value: Uint8Array; +} +export interface ExtendedVoteInfoAmino { + /** The validator that sent the vote. */ + validator?: ValidatorAmino; + /** Non-deterministic extension provided by the sending validator's application. */ + vote_extension?: string; + /** Vote extension signature created by CometBFT */ + extension_signature?: string; + /** block_id_flag indicates whether the validator voted for a block, nil, or did not vote at all */ + block_id_flag?: BlockIDFlag; +} +export interface ExtendedVoteInfoAminoMsg { + type: "/tendermint.abci.ExtendedVoteInfo"; + value: ExtendedVoteInfoAmino; +} +export interface ExtendedVoteInfoSDKType { + validator: ValidatorSDKType; + vote_extension: Uint8Array; + extension_signature: Uint8Array; + block_id_flag: BlockIDFlag; } -export interface Evidence { - type: EvidenceType; +export interface Misbehavior { + type: MisbehaviorType; /** The offending validator */ validator: Validator; /** The height when the offense occurred */ @@ -1333,12 +1608,12 @@ export interface Evidence { */ totalVotingPower: bigint; } -export interface EvidenceProtoMsg { - typeUrl: "/tendermint.abci.Evidence"; +export interface MisbehaviorProtoMsg { + typeUrl: "/tendermint.abci.Misbehavior"; value: Uint8Array; } -export interface EvidenceAmino { - type?: EvidenceType; +export interface MisbehaviorAmino { + type?: MisbehaviorType; /** The offending validator */ validator?: ValidatorAmino; /** The height when the offense occurred */ @@ -1352,12 +1627,12 @@ export interface EvidenceAmino { */ total_voting_power?: string; } -export interface EvidenceAminoMsg { - type: "/tendermint.abci.Evidence"; - value: EvidenceAmino; +export interface MisbehaviorAminoMsg { + type: "/tendermint.abci.Misbehavior"; + value: MisbehaviorAmino; } -export interface EvidenceSDKType { - type: EvidenceType; +export interface MisbehaviorSDKType { + type: MisbehaviorType; validator: ValidatorSDKType; height: bigint; time: Date; @@ -1407,18 +1682,19 @@ function createBaseRequest(): Request { echo: undefined, flush: undefined, info: undefined, - setOption: undefined, initChain: undefined, query: undefined, - beginBlock: undefined, checkTx: undefined, - deliverTx: undefined, - endBlock: undefined, commit: undefined, listSnapshots: undefined, offerSnapshot: undefined, loadSnapshotChunk: undefined, - applySnapshotChunk: undefined + applySnapshotChunk: undefined, + prepareProposal: undefined, + processProposal: undefined, + extendVote: undefined, + verifyVoteExtension: undefined, + finalizeBlock: undefined }; } export const Request = { @@ -1433,27 +1709,15 @@ export const Request = { if (message.info !== undefined) { RequestInfo.encode(message.info, writer.uint32(26).fork()).ldelim(); } - if (message.setOption !== undefined) { - RequestSetOption.encode(message.setOption, writer.uint32(34).fork()).ldelim(); - } if (message.initChain !== undefined) { RequestInitChain.encode(message.initChain, writer.uint32(42).fork()).ldelim(); } if (message.query !== undefined) { RequestQuery.encode(message.query, writer.uint32(50).fork()).ldelim(); } - if (message.beginBlock !== undefined) { - RequestBeginBlock.encode(message.beginBlock, writer.uint32(58).fork()).ldelim(); - } if (message.checkTx !== undefined) { RequestCheckTx.encode(message.checkTx, writer.uint32(66).fork()).ldelim(); } - if (message.deliverTx !== undefined) { - RequestDeliverTx.encode(message.deliverTx, writer.uint32(74).fork()).ldelim(); - } - if (message.endBlock !== undefined) { - RequestEndBlock.encode(message.endBlock, writer.uint32(82).fork()).ldelim(); - } if (message.commit !== undefined) { RequestCommit.encode(message.commit, writer.uint32(90).fork()).ldelim(); } @@ -1469,6 +1733,21 @@ export const Request = { if (message.applySnapshotChunk !== undefined) { RequestApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(122).fork()).ldelim(); } + if (message.prepareProposal !== undefined) { + RequestPrepareProposal.encode(message.prepareProposal, writer.uint32(130).fork()).ldelim(); + } + if (message.processProposal !== undefined) { + RequestProcessProposal.encode(message.processProposal, writer.uint32(138).fork()).ldelim(); + } + if (message.extendVote !== undefined) { + RequestExtendVote.encode(message.extendVote, writer.uint32(146).fork()).ldelim(); + } + if (message.verifyVoteExtension !== undefined) { + RequestVerifyVoteExtension.encode(message.verifyVoteExtension, writer.uint32(154).fork()).ldelim(); + } + if (message.finalizeBlock !== undefined) { + RequestFinalizeBlock.encode(message.finalizeBlock, writer.uint32(162).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Request { @@ -1487,27 +1766,15 @@ export const Request = { case 3: message.info = RequestInfo.decode(reader, reader.uint32()); break; - case 4: - message.setOption = RequestSetOption.decode(reader, reader.uint32()); - break; case 5: message.initChain = RequestInitChain.decode(reader, reader.uint32()); break; case 6: message.query = RequestQuery.decode(reader, reader.uint32()); break; - case 7: - message.beginBlock = RequestBeginBlock.decode(reader, reader.uint32()); - break; case 8: message.checkTx = RequestCheckTx.decode(reader, reader.uint32()); break; - case 9: - message.deliverTx = RequestDeliverTx.decode(reader, reader.uint32()); - break; - case 10: - message.endBlock = RequestEndBlock.decode(reader, reader.uint32()); - break; case 11: message.commit = RequestCommit.decode(reader, reader.uint32()); break; @@ -1523,6 +1790,21 @@ export const Request = { case 15: message.applySnapshotChunk = RequestApplySnapshotChunk.decode(reader, reader.uint32()); break; + case 16: + message.prepareProposal = RequestPrepareProposal.decode(reader, reader.uint32()); + break; + case 17: + message.processProposal = RequestProcessProposal.decode(reader, reader.uint32()); + break; + case 18: + message.extendVote = RequestExtendVote.decode(reader, reader.uint32()); + break; + case 19: + message.verifyVoteExtension = RequestVerifyVoteExtension.decode(reader, reader.uint32()); + break; + case 20: + message.finalizeBlock = RequestFinalizeBlock.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -1535,18 +1817,19 @@ export const Request = { message.echo = object.echo !== undefined && object.echo !== null ? RequestEcho.fromPartial(object.echo) : undefined; message.flush = object.flush !== undefined && object.flush !== null ? RequestFlush.fromPartial(object.flush) : undefined; message.info = object.info !== undefined && object.info !== null ? RequestInfo.fromPartial(object.info) : undefined; - message.setOption = object.setOption !== undefined && object.setOption !== null ? RequestSetOption.fromPartial(object.setOption) : undefined; message.initChain = object.initChain !== undefined && object.initChain !== null ? RequestInitChain.fromPartial(object.initChain) : undefined; message.query = object.query !== undefined && object.query !== null ? RequestQuery.fromPartial(object.query) : undefined; - message.beginBlock = object.beginBlock !== undefined && object.beginBlock !== null ? RequestBeginBlock.fromPartial(object.beginBlock) : undefined; message.checkTx = object.checkTx !== undefined && object.checkTx !== null ? RequestCheckTx.fromPartial(object.checkTx) : undefined; - message.deliverTx = object.deliverTx !== undefined && object.deliverTx !== null ? RequestDeliverTx.fromPartial(object.deliverTx) : undefined; - message.endBlock = object.endBlock !== undefined && object.endBlock !== null ? RequestEndBlock.fromPartial(object.endBlock) : undefined; message.commit = object.commit !== undefined && object.commit !== null ? RequestCommit.fromPartial(object.commit) : undefined; message.listSnapshots = object.listSnapshots !== undefined && object.listSnapshots !== null ? RequestListSnapshots.fromPartial(object.listSnapshots) : undefined; message.offerSnapshot = object.offerSnapshot !== undefined && object.offerSnapshot !== null ? RequestOfferSnapshot.fromPartial(object.offerSnapshot) : undefined; message.loadSnapshotChunk = object.loadSnapshotChunk !== undefined && object.loadSnapshotChunk !== null ? RequestLoadSnapshotChunk.fromPartial(object.loadSnapshotChunk) : undefined; message.applySnapshotChunk = object.applySnapshotChunk !== undefined && object.applySnapshotChunk !== null ? RequestApplySnapshotChunk.fromPartial(object.applySnapshotChunk) : undefined; + message.prepareProposal = object.prepareProposal !== undefined && object.prepareProposal !== null ? RequestPrepareProposal.fromPartial(object.prepareProposal) : undefined; + message.processProposal = object.processProposal !== undefined && object.processProposal !== null ? RequestProcessProposal.fromPartial(object.processProposal) : undefined; + message.extendVote = object.extendVote !== undefined && object.extendVote !== null ? RequestExtendVote.fromPartial(object.extendVote) : undefined; + message.verifyVoteExtension = object.verifyVoteExtension !== undefined && object.verifyVoteExtension !== null ? RequestVerifyVoteExtension.fromPartial(object.verifyVoteExtension) : undefined; + message.finalizeBlock = object.finalizeBlock !== undefined && object.finalizeBlock !== null ? RequestFinalizeBlock.fromPartial(object.finalizeBlock) : undefined; return message; }, fromAmino(object: RequestAmino): Request { @@ -1560,27 +1843,15 @@ export const Request = { if (object.info !== undefined && object.info !== null) { message.info = RequestInfo.fromAmino(object.info); } - if (object.set_option !== undefined && object.set_option !== null) { - message.setOption = RequestSetOption.fromAmino(object.set_option); - } if (object.init_chain !== undefined && object.init_chain !== null) { message.initChain = RequestInitChain.fromAmino(object.init_chain); } if (object.query !== undefined && object.query !== null) { message.query = RequestQuery.fromAmino(object.query); } - if (object.begin_block !== undefined && object.begin_block !== null) { - message.beginBlock = RequestBeginBlock.fromAmino(object.begin_block); - } if (object.check_tx !== undefined && object.check_tx !== null) { message.checkTx = RequestCheckTx.fromAmino(object.check_tx); } - if (object.deliver_tx !== undefined && object.deliver_tx !== null) { - message.deliverTx = RequestDeliverTx.fromAmino(object.deliver_tx); - } - if (object.end_block !== undefined && object.end_block !== null) { - message.endBlock = RequestEndBlock.fromAmino(object.end_block); - } if (object.commit !== undefined && object.commit !== null) { message.commit = RequestCommit.fromAmino(object.commit); } @@ -1596,6 +1867,21 @@ export const Request = { if (object.apply_snapshot_chunk !== undefined && object.apply_snapshot_chunk !== null) { message.applySnapshotChunk = RequestApplySnapshotChunk.fromAmino(object.apply_snapshot_chunk); } + if (object.prepare_proposal !== undefined && object.prepare_proposal !== null) { + message.prepareProposal = RequestPrepareProposal.fromAmino(object.prepare_proposal); + } + if (object.process_proposal !== undefined && object.process_proposal !== null) { + message.processProposal = RequestProcessProposal.fromAmino(object.process_proposal); + } + if (object.extend_vote !== undefined && object.extend_vote !== null) { + message.extendVote = RequestExtendVote.fromAmino(object.extend_vote); + } + if (object.verify_vote_extension !== undefined && object.verify_vote_extension !== null) { + message.verifyVoteExtension = RequestVerifyVoteExtension.fromAmino(object.verify_vote_extension); + } + if (object.finalize_block !== undefined && object.finalize_block !== null) { + message.finalizeBlock = RequestFinalizeBlock.fromAmino(object.finalize_block); + } return message; }, toAmino(message: Request): RequestAmino { @@ -1603,18 +1889,19 @@ export const Request = { obj.echo = message.echo ? RequestEcho.toAmino(message.echo) : undefined; obj.flush = message.flush ? RequestFlush.toAmino(message.flush) : undefined; obj.info = message.info ? RequestInfo.toAmino(message.info) : undefined; - obj.set_option = message.setOption ? RequestSetOption.toAmino(message.setOption) : undefined; obj.init_chain = message.initChain ? RequestInitChain.toAmino(message.initChain) : undefined; obj.query = message.query ? RequestQuery.toAmino(message.query) : undefined; - obj.begin_block = message.beginBlock ? RequestBeginBlock.toAmino(message.beginBlock) : undefined; obj.check_tx = message.checkTx ? RequestCheckTx.toAmino(message.checkTx) : undefined; - obj.deliver_tx = message.deliverTx ? RequestDeliverTx.toAmino(message.deliverTx) : undefined; - obj.end_block = message.endBlock ? RequestEndBlock.toAmino(message.endBlock) : undefined; obj.commit = message.commit ? RequestCommit.toAmino(message.commit) : undefined; obj.list_snapshots = message.listSnapshots ? RequestListSnapshots.toAmino(message.listSnapshots) : undefined; obj.offer_snapshot = message.offerSnapshot ? RequestOfferSnapshot.toAmino(message.offerSnapshot) : undefined; obj.load_snapshot_chunk = message.loadSnapshotChunk ? RequestLoadSnapshotChunk.toAmino(message.loadSnapshotChunk) : undefined; obj.apply_snapshot_chunk = message.applySnapshotChunk ? RequestApplySnapshotChunk.toAmino(message.applySnapshotChunk) : undefined; + obj.prepare_proposal = message.prepareProposal ? RequestPrepareProposal.toAmino(message.prepareProposal) : undefined; + obj.process_proposal = message.processProposal ? RequestProcessProposal.toAmino(message.processProposal) : undefined; + obj.extend_vote = message.extendVote ? RequestExtendVote.toAmino(message.extendVote) : undefined; + obj.verify_vote_extension = message.verifyVoteExtension ? RequestVerifyVoteExtension.toAmino(message.verifyVoteExtension) : undefined; + obj.finalize_block = message.finalizeBlock ? RequestFinalizeBlock.toAmino(message.finalizeBlock) : undefined; return obj; }, fromAminoMsg(object: RequestAminoMsg): Request { @@ -1750,7 +2037,8 @@ function createBaseRequestInfo(): RequestInfo { return { version: "", blockVersion: BigInt(0), - p2pVersion: BigInt(0) + p2pVersion: BigInt(0), + abciVersion: "" }; } export const RequestInfo = { @@ -1765,6 +2053,9 @@ export const RequestInfo = { if (message.p2pVersion !== BigInt(0)) { writer.uint32(24).uint64(message.p2pVersion); } + if (message.abciVersion !== "") { + writer.uint32(34).string(message.abciVersion); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RequestInfo { @@ -1783,6 +2074,9 @@ export const RequestInfo = { case 3: message.p2pVersion = reader.uint64(); break; + case 4: + message.abciVersion = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -1795,6 +2089,7 @@ export const RequestInfo = { message.version = object.version ?? ""; message.blockVersion = object.blockVersion !== undefined && object.blockVersion !== null ? BigInt(object.blockVersion.toString()) : BigInt(0); message.p2pVersion = object.p2pVersion !== undefined && object.p2pVersion !== null ? BigInt(object.p2pVersion.toString()) : BigInt(0); + message.abciVersion = object.abciVersion ?? ""; return message; }, fromAmino(object: RequestInfoAmino): RequestInfo { @@ -1808,6 +2103,9 @@ export const RequestInfo = { if (object.p2p_version !== undefined && object.p2p_version !== null) { message.p2pVersion = BigInt(object.p2p_version); } + if (object.abci_version !== undefined && object.abci_version !== null) { + message.abciVersion = object.abci_version; + } return message; }, toAmino(message: RequestInfo): RequestInfoAmino { @@ -1815,6 +2113,7 @@ export const RequestInfo = { obj.version = message.version === "" ? undefined : message.version; obj.block_version = message.blockVersion !== BigInt(0) ? message.blockVersion.toString() : undefined; obj.p2p_version = message.p2pVersion !== BigInt(0) ? message.p2pVersion.toString() : undefined; + obj.abci_version = message.abciVersion === "" ? undefined : message.abciVersion; return obj; }, fromAminoMsg(object: RequestInfoAminoMsg): RequestInfo { @@ -1833,81 +2132,6 @@ export const RequestInfo = { }; } }; -function createBaseRequestSetOption(): RequestSetOption { - return { - key: "", - value: "" - }; -} -export const RequestSetOption = { - typeUrl: "/tendermint.abci.RequestSetOption", - encode(message: RequestSetOption, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.key !== "") { - writer.uint32(10).string(message.key); - } - if (message.value !== "") { - writer.uint32(18).string(message.value); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): RequestSetOption { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRequestSetOption(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.string(); - break; - case 2: - message.value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): RequestSetOption { - const message = createBaseRequestSetOption(); - message.key = object.key ?? ""; - message.value = object.value ?? ""; - return message; - }, - fromAmino(object: RequestSetOptionAmino): RequestSetOption { - const message = createBaseRequestSetOption(); - if (object.key !== undefined && object.key !== null) { - message.key = object.key; - } - if (object.value !== undefined && object.value !== null) { - message.value = object.value; - } - return message; - }, - toAmino(message: RequestSetOption): RequestSetOptionAmino { - const obj: any = {}; - obj.key = message.key === "" ? undefined : message.key; - obj.value = message.value === "" ? undefined : message.value; - return obj; - }, - fromAminoMsg(object: RequestSetOptionAminoMsg): RequestSetOption { - return RequestSetOption.fromAmino(object.value); - }, - fromProtoMsg(message: RequestSetOptionProtoMsg): RequestSetOption { - return RequestSetOption.decode(message.value); - }, - toProto(message: RequestSetOption): Uint8Array { - return RequestSetOption.encode(message).finish(); - }, - toProtoMsg(message: RequestSetOption): RequestSetOptionProtoMsg { - return { - typeUrl: "/tendermint.abci.RequestSetOption", - value: RequestSetOption.encode(message).finish() - }; - } -}; function createBaseRequestInitChain(): RequestInitChain { return { time: new Date(), @@ -2132,49 +2356,35 @@ export const RequestQuery = { }; } }; -function createBaseRequestBeginBlock(): RequestBeginBlock { +function createBaseRequestCheckTx(): RequestCheckTx { return { - hash: new Uint8Array(), - header: Header.fromPartial({}), - lastCommitInfo: LastCommitInfo.fromPartial({}), - byzantineValidators: [] + tx: new Uint8Array(), + type: 0 }; } -export const RequestBeginBlock = { - typeUrl: "/tendermint.abci.RequestBeginBlock", - encode(message: RequestBeginBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.hash.length !== 0) { - writer.uint32(10).bytes(message.hash); - } - if (message.header !== undefined) { - Header.encode(message.header, writer.uint32(18).fork()).ldelim(); - } - if (message.lastCommitInfo !== undefined) { - LastCommitInfo.encode(message.lastCommitInfo, writer.uint32(26).fork()).ldelim(); +export const RequestCheckTx = { + typeUrl: "/tendermint.abci.RequestCheckTx", + encode(message: RequestCheckTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.tx.length !== 0) { + writer.uint32(10).bytes(message.tx); } - for (const v of message.byzantineValidators) { - Evidence.encode(v!, writer.uint32(34).fork()).ldelim(); + if (message.type !== 0) { + writer.uint32(16).int32(message.type); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): RequestBeginBlock { + decode(input: BinaryReader | Uint8Array, length?: number): RequestCheckTx { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRequestBeginBlock(); + const message = createBaseRequestCheckTx(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.hash = reader.bytes(); + message.tx = reader.bytes(); break; case 2: - message.header = Header.decode(reader, reader.uint32()); - break; - case 3: - message.lastCommitInfo = LastCommitInfo.decode(reader, reader.uint32()); - break; - case 4: - message.byzantineValidators.push(Evidence.decode(reader, reader.uint32())); + message.type = (reader.int32() as any); break; default: reader.skipType(tag & 7); @@ -2183,113 +2393,26 @@ export const RequestBeginBlock = { } return message; }, - fromPartial(object: Partial): RequestBeginBlock { - const message = createBaseRequestBeginBlock(); - message.hash = object.hash ?? new Uint8Array(); - message.header = object.header !== undefined && object.header !== null ? Header.fromPartial(object.header) : undefined; - message.lastCommitInfo = object.lastCommitInfo !== undefined && object.lastCommitInfo !== null ? LastCommitInfo.fromPartial(object.lastCommitInfo) : undefined; - message.byzantineValidators = object.byzantineValidators?.map(e => Evidence.fromPartial(e)) || []; + fromPartial(object: Partial): RequestCheckTx { + const message = createBaseRequestCheckTx(); + message.tx = object.tx ?? new Uint8Array(); + message.type = object.type ?? 0; return message; }, - fromAmino(object: RequestBeginBlockAmino): RequestBeginBlock { - const message = createBaseRequestBeginBlock(); - if (object.hash !== undefined && object.hash !== null) { - message.hash = bytesFromBase64(object.hash); - } - if (object.header !== undefined && object.header !== null) { - message.header = Header.fromAmino(object.header); + fromAmino(object: RequestCheckTxAmino): RequestCheckTx { + const message = createBaseRequestCheckTx(); + if (object.tx !== undefined && object.tx !== null) { + message.tx = bytesFromBase64(object.tx); } - if (object.last_commit_info !== undefined && object.last_commit_info !== null) { - message.lastCommitInfo = LastCommitInfo.fromAmino(object.last_commit_info); + if (object.type !== undefined && object.type !== null) { + message.type = object.type; } - message.byzantineValidators = object.byzantine_validators?.map(e => Evidence.fromAmino(e)) || []; return message; }, - toAmino(message: RequestBeginBlock): RequestBeginBlockAmino { + toAmino(message: RequestCheckTx): RequestCheckTxAmino { const obj: any = {}; - obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; - obj.header = message.header ? Header.toAmino(message.header) : undefined; - obj.last_commit_info = message.lastCommitInfo ? LastCommitInfo.toAmino(message.lastCommitInfo) : undefined; - if (message.byzantineValidators) { - obj.byzantine_validators = message.byzantineValidators.map(e => e ? Evidence.toAmino(e) : undefined); - } else { - obj.byzantine_validators = message.byzantineValidators; - } - return obj; - }, - fromAminoMsg(object: RequestBeginBlockAminoMsg): RequestBeginBlock { - return RequestBeginBlock.fromAmino(object.value); - }, - fromProtoMsg(message: RequestBeginBlockProtoMsg): RequestBeginBlock { - return RequestBeginBlock.decode(message.value); - }, - toProto(message: RequestBeginBlock): Uint8Array { - return RequestBeginBlock.encode(message).finish(); - }, - toProtoMsg(message: RequestBeginBlock): RequestBeginBlockProtoMsg { - return { - typeUrl: "/tendermint.abci.RequestBeginBlock", - value: RequestBeginBlock.encode(message).finish() - }; - } -}; -function createBaseRequestCheckTx(): RequestCheckTx { - return { - tx: new Uint8Array(), - type: 0 - }; -} -export const RequestCheckTx = { - typeUrl: "/tendermint.abci.RequestCheckTx", - encode(message: RequestCheckTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.tx.length !== 0) { - writer.uint32(10).bytes(message.tx); - } - if (message.type !== 0) { - writer.uint32(16).int32(message.type); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): RequestCheckTx { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRequestCheckTx(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tx = reader.bytes(); - break; - case 2: - message.type = (reader.int32() as any); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): RequestCheckTx { - const message = createBaseRequestCheckTx(); - message.tx = object.tx ?? new Uint8Array(); - message.type = object.type ?? 0; - return message; - }, - fromAmino(object: RequestCheckTxAmino): RequestCheckTx { - const message = createBaseRequestCheckTx(); - if (object.tx !== undefined && object.tx !== null) { - message.tx = bytesFromBase64(object.tx); - } - if (object.type !== undefined && object.type !== null) { - message.type = object.type; - } - return message; - }, - toAmino(message: RequestCheckTx): RequestCheckTxAmino { - const obj: any = {}; - obj.tx = message.tx ? base64FromBytes(message.tx) : undefined; - obj.type = message.type === 0 ? undefined : message.type; + obj.tx = message.tx ? base64FromBytes(message.tx) : undefined; + obj.type = message.type === 0 ? undefined : message.type; return obj; }, fromAminoMsg(object: RequestCheckTxAminoMsg): RequestCheckTx { @@ -2308,132 +2431,6 @@ export const RequestCheckTx = { }; } }; -function createBaseRequestDeliverTx(): RequestDeliverTx { - return { - tx: new Uint8Array() - }; -} -export const RequestDeliverTx = { - typeUrl: "/tendermint.abci.RequestDeliverTx", - encode(message: RequestDeliverTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.tx.length !== 0) { - writer.uint32(10).bytes(message.tx); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): RequestDeliverTx { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRequestDeliverTx(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tx = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): RequestDeliverTx { - const message = createBaseRequestDeliverTx(); - message.tx = object.tx ?? new Uint8Array(); - return message; - }, - fromAmino(object: RequestDeliverTxAmino): RequestDeliverTx { - const message = createBaseRequestDeliverTx(); - if (object.tx !== undefined && object.tx !== null) { - message.tx = bytesFromBase64(object.tx); - } - return message; - }, - toAmino(message: RequestDeliverTx): RequestDeliverTxAmino { - const obj: any = {}; - obj.tx = message.tx ? base64FromBytes(message.tx) : undefined; - return obj; - }, - fromAminoMsg(object: RequestDeliverTxAminoMsg): RequestDeliverTx { - return RequestDeliverTx.fromAmino(object.value); - }, - fromProtoMsg(message: RequestDeliverTxProtoMsg): RequestDeliverTx { - return RequestDeliverTx.decode(message.value); - }, - toProto(message: RequestDeliverTx): Uint8Array { - return RequestDeliverTx.encode(message).finish(); - }, - toProtoMsg(message: RequestDeliverTx): RequestDeliverTxProtoMsg { - return { - typeUrl: "/tendermint.abci.RequestDeliverTx", - value: RequestDeliverTx.encode(message).finish() - }; - } -}; -function createBaseRequestEndBlock(): RequestEndBlock { - return { - height: BigInt(0) - }; -} -export const RequestEndBlock = { - typeUrl: "/tendermint.abci.RequestEndBlock", - encode(message: RequestEndBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.height !== BigInt(0)) { - writer.uint32(8).int64(message.height); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): RequestEndBlock { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRequestEndBlock(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): RequestEndBlock { - const message = createBaseRequestEndBlock(); - message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); - return message; - }, - fromAmino(object: RequestEndBlockAmino): RequestEndBlock { - const message = createBaseRequestEndBlock(); - if (object.height !== undefined && object.height !== null) { - message.height = BigInt(object.height); - } - return message; - }, - toAmino(message: RequestEndBlock): RequestEndBlockAmino { - const obj: any = {}; - obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; - return obj; - }, - fromAminoMsg(object: RequestEndBlockAminoMsg): RequestEndBlock { - return RequestEndBlock.fromAmino(object.value); - }, - fromProtoMsg(message: RequestEndBlockProtoMsg): RequestEndBlock { - return RequestEndBlock.decode(message.value); - }, - toProto(message: RequestEndBlock): Uint8Array { - return RequestEndBlock.encode(message).finish(); - }, - toProtoMsg(message: RequestEndBlock): RequestEndBlockProtoMsg { - return { - typeUrl: "/tendermint.abci.RequestEndBlock", - value: RequestEndBlock.encode(message).finish() - }; - } -}; function createBaseRequestCommit(): RequestCommit { return {}; } @@ -2783,133 +2780,77 @@ export const RequestApplySnapshotChunk = { }; } }; -function createBaseResponse(): Response { +function createBaseRequestPrepareProposal(): RequestPrepareProposal { return { - exception: undefined, - echo: undefined, - flush: undefined, - info: undefined, - setOption: undefined, - initChain: undefined, - query: undefined, - beginBlock: undefined, - checkTx: undefined, - deliverTx: undefined, - endBlock: undefined, - commit: undefined, - listSnapshots: undefined, - offerSnapshot: undefined, - loadSnapshotChunk: undefined, - applySnapshotChunk: undefined + maxTxBytes: BigInt(0), + txs: [], + localLastCommit: ExtendedCommitInfo.fromPartial({}), + misbehavior: [], + height: BigInt(0), + time: new Date(), + nextValidatorsHash: new Uint8Array(), + proposerAddress: new Uint8Array() }; } -export const Response = { - typeUrl: "/tendermint.abci.Response", - encode(message: Response, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.exception !== undefined) { - ResponseException.encode(message.exception, writer.uint32(10).fork()).ldelim(); - } - if (message.echo !== undefined) { - ResponseEcho.encode(message.echo, writer.uint32(18).fork()).ldelim(); - } - if (message.flush !== undefined) { - ResponseFlush.encode(message.flush, writer.uint32(26).fork()).ldelim(); - } - if (message.info !== undefined) { - ResponseInfo.encode(message.info, writer.uint32(34).fork()).ldelim(); - } - if (message.setOption !== undefined) { - ResponseSetOption.encode(message.setOption, writer.uint32(42).fork()).ldelim(); - } - if (message.initChain !== undefined) { - ResponseInitChain.encode(message.initChain, writer.uint32(50).fork()).ldelim(); - } - if (message.query !== undefined) { - ResponseQuery.encode(message.query, writer.uint32(58).fork()).ldelim(); +export const RequestPrepareProposal = { + typeUrl: "/tendermint.abci.RequestPrepareProposal", + encode(message: RequestPrepareProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.maxTxBytes !== BigInt(0)) { + writer.uint32(8).int64(message.maxTxBytes); } - if (message.beginBlock !== undefined) { - ResponseBeginBlock.encode(message.beginBlock, writer.uint32(66).fork()).ldelim(); + for (const v of message.txs) { + writer.uint32(18).bytes(v!); } - if (message.checkTx !== undefined) { - ResponseCheckTx.encode(message.checkTx, writer.uint32(74).fork()).ldelim(); - } - if (message.deliverTx !== undefined) { - ResponseDeliverTx.encode(message.deliverTx, writer.uint32(82).fork()).ldelim(); - } - if (message.endBlock !== undefined) { - ResponseEndBlock.encode(message.endBlock, writer.uint32(90).fork()).ldelim(); + if (message.localLastCommit !== undefined) { + ExtendedCommitInfo.encode(message.localLastCommit, writer.uint32(26).fork()).ldelim(); } - if (message.commit !== undefined) { - ResponseCommit.encode(message.commit, writer.uint32(98).fork()).ldelim(); + for (const v of message.misbehavior) { + Misbehavior.encode(v!, writer.uint32(34).fork()).ldelim(); } - if (message.listSnapshots !== undefined) { - ResponseListSnapshots.encode(message.listSnapshots, writer.uint32(106).fork()).ldelim(); + if (message.height !== BigInt(0)) { + writer.uint32(40).int64(message.height); } - if (message.offerSnapshot !== undefined) { - ResponseOfferSnapshot.encode(message.offerSnapshot, writer.uint32(114).fork()).ldelim(); + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(50).fork()).ldelim(); } - if (message.loadSnapshotChunk !== undefined) { - ResponseLoadSnapshotChunk.encode(message.loadSnapshotChunk, writer.uint32(122).fork()).ldelim(); + if (message.nextValidatorsHash.length !== 0) { + writer.uint32(58).bytes(message.nextValidatorsHash); } - if (message.applySnapshotChunk !== undefined) { - ResponseApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(130).fork()).ldelim(); + if (message.proposerAddress.length !== 0) { + writer.uint32(66).bytes(message.proposerAddress); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): Response { + decode(input: BinaryReader | Uint8Array, length?: number): RequestPrepareProposal { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponse(); + const message = createBaseRequestPrepareProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.exception = ResponseException.decode(reader, reader.uint32()); + message.maxTxBytes = reader.int64(); break; case 2: - message.echo = ResponseEcho.decode(reader, reader.uint32()); + message.txs.push(reader.bytes()); break; case 3: - message.flush = ResponseFlush.decode(reader, reader.uint32()); + message.localLastCommit = ExtendedCommitInfo.decode(reader, reader.uint32()); break; case 4: - message.info = ResponseInfo.decode(reader, reader.uint32()); + message.misbehavior.push(Misbehavior.decode(reader, reader.uint32())); break; case 5: - message.setOption = ResponseSetOption.decode(reader, reader.uint32()); + message.height = reader.int64(); break; case 6: - message.initChain = ResponseInitChain.decode(reader, reader.uint32()); + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); break; case 7: - message.query = ResponseQuery.decode(reader, reader.uint32()); + message.nextValidatorsHash = reader.bytes(); break; case 8: - message.beginBlock = ResponseBeginBlock.decode(reader, reader.uint32()); - break; - case 9: - message.checkTx = ResponseCheckTx.decode(reader, reader.uint32()); - break; - case 10: - message.deliverTx = ResponseDeliverTx.decode(reader, reader.uint32()); - break; - case 11: - message.endBlock = ResponseEndBlock.decode(reader, reader.uint32()); - break; - case 12: - message.commit = ResponseCommit.decode(reader, reader.uint32()); - break; - case 13: - message.listSnapshots = ResponseListSnapshots.decode(reader, reader.uint32()); - break; - case 14: - message.offerSnapshot = ResponseOfferSnapshot.decode(reader, reader.uint32()); - break; - case 15: - message.loadSnapshotChunk = ResponseLoadSnapshotChunk.decode(reader, reader.uint32()); - break; - case 16: - message.applySnapshotChunk = ResponseApplySnapshotChunk.decode(reader, reader.uint32()); + message.proposerAddress = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -2918,136 +2859,149 @@ export const Response = { } return message; }, - fromPartial(object: Partial): Response { - const message = createBaseResponse(); - message.exception = object.exception !== undefined && object.exception !== null ? ResponseException.fromPartial(object.exception) : undefined; - message.echo = object.echo !== undefined && object.echo !== null ? ResponseEcho.fromPartial(object.echo) : undefined; - message.flush = object.flush !== undefined && object.flush !== null ? ResponseFlush.fromPartial(object.flush) : undefined; - message.info = object.info !== undefined && object.info !== null ? ResponseInfo.fromPartial(object.info) : undefined; - message.setOption = object.setOption !== undefined && object.setOption !== null ? ResponseSetOption.fromPartial(object.setOption) : undefined; - message.initChain = object.initChain !== undefined && object.initChain !== null ? ResponseInitChain.fromPartial(object.initChain) : undefined; - message.query = object.query !== undefined && object.query !== null ? ResponseQuery.fromPartial(object.query) : undefined; - message.beginBlock = object.beginBlock !== undefined && object.beginBlock !== null ? ResponseBeginBlock.fromPartial(object.beginBlock) : undefined; - message.checkTx = object.checkTx !== undefined && object.checkTx !== null ? ResponseCheckTx.fromPartial(object.checkTx) : undefined; - message.deliverTx = object.deliverTx !== undefined && object.deliverTx !== null ? ResponseDeliverTx.fromPartial(object.deliverTx) : undefined; - message.endBlock = object.endBlock !== undefined && object.endBlock !== null ? ResponseEndBlock.fromPartial(object.endBlock) : undefined; - message.commit = object.commit !== undefined && object.commit !== null ? ResponseCommit.fromPartial(object.commit) : undefined; - message.listSnapshots = object.listSnapshots !== undefined && object.listSnapshots !== null ? ResponseListSnapshots.fromPartial(object.listSnapshots) : undefined; - message.offerSnapshot = object.offerSnapshot !== undefined && object.offerSnapshot !== null ? ResponseOfferSnapshot.fromPartial(object.offerSnapshot) : undefined; - message.loadSnapshotChunk = object.loadSnapshotChunk !== undefined && object.loadSnapshotChunk !== null ? ResponseLoadSnapshotChunk.fromPartial(object.loadSnapshotChunk) : undefined; - message.applySnapshotChunk = object.applySnapshotChunk !== undefined && object.applySnapshotChunk !== null ? ResponseApplySnapshotChunk.fromPartial(object.applySnapshotChunk) : undefined; + fromPartial(object: Partial): RequestPrepareProposal { + const message = createBaseRequestPrepareProposal(); + message.maxTxBytes = object.maxTxBytes !== undefined && object.maxTxBytes !== null ? BigInt(object.maxTxBytes.toString()) : BigInt(0); + message.txs = object.txs?.map(e => e) || []; + message.localLastCommit = object.localLastCommit !== undefined && object.localLastCommit !== null ? ExtendedCommitInfo.fromPartial(object.localLastCommit) : undefined; + message.misbehavior = object.misbehavior?.map(e => Misbehavior.fromPartial(e)) || []; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.time = object.time ?? undefined; + message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array(); + message.proposerAddress = object.proposerAddress ?? new Uint8Array(); return message; }, - fromAmino(object: ResponseAmino): Response { - const message = createBaseResponse(); - if (object.exception !== undefined && object.exception !== null) { - message.exception = ResponseException.fromAmino(object.exception); + fromAmino(object: RequestPrepareProposalAmino): RequestPrepareProposal { + const message = createBaseRequestPrepareProposal(); + if (object.max_tx_bytes !== undefined && object.max_tx_bytes !== null) { + message.maxTxBytes = BigInt(object.max_tx_bytes); } - if (object.echo !== undefined && object.echo !== null) { - message.echo = ResponseEcho.fromAmino(object.echo); + message.txs = object.txs?.map(e => bytesFromBase64(e)) || []; + if (object.local_last_commit !== undefined && object.local_last_commit !== null) { + message.localLastCommit = ExtendedCommitInfo.fromAmino(object.local_last_commit); } - if (object.flush !== undefined && object.flush !== null) { - message.flush = ResponseFlush.fromAmino(object.flush); - } - if (object.info !== undefined && object.info !== null) { - message.info = ResponseInfo.fromAmino(object.info); - } - if (object.set_option !== undefined && object.set_option !== null) { - message.setOption = ResponseSetOption.fromAmino(object.set_option); - } - if (object.init_chain !== undefined && object.init_chain !== null) { - message.initChain = ResponseInitChain.fromAmino(object.init_chain); - } - if (object.query !== undefined && object.query !== null) { - message.query = ResponseQuery.fromAmino(object.query); - } - if (object.begin_block !== undefined && object.begin_block !== null) { - message.beginBlock = ResponseBeginBlock.fromAmino(object.begin_block); - } - if (object.check_tx !== undefined && object.check_tx !== null) { - message.checkTx = ResponseCheckTx.fromAmino(object.check_tx); - } - if (object.deliver_tx !== undefined && object.deliver_tx !== null) { - message.deliverTx = ResponseDeliverTx.fromAmino(object.deliver_tx); - } - if (object.end_block !== undefined && object.end_block !== null) { - message.endBlock = ResponseEndBlock.fromAmino(object.end_block); - } - if (object.commit !== undefined && object.commit !== null) { - message.commit = ResponseCommit.fromAmino(object.commit); - } - if (object.list_snapshots !== undefined && object.list_snapshots !== null) { - message.listSnapshots = ResponseListSnapshots.fromAmino(object.list_snapshots); + message.misbehavior = object.misbehavior?.map(e => Misbehavior.fromAmino(e)) || []; + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); } - if (object.offer_snapshot !== undefined && object.offer_snapshot !== null) { - message.offerSnapshot = ResponseOfferSnapshot.fromAmino(object.offer_snapshot); + if (object.time !== undefined && object.time !== null) { + message.time = fromTimestamp(Timestamp.fromAmino(object.time)); } - if (object.load_snapshot_chunk !== undefined && object.load_snapshot_chunk !== null) { - message.loadSnapshotChunk = ResponseLoadSnapshotChunk.fromAmino(object.load_snapshot_chunk); + if (object.next_validators_hash !== undefined && object.next_validators_hash !== null) { + message.nextValidatorsHash = bytesFromBase64(object.next_validators_hash); } - if (object.apply_snapshot_chunk !== undefined && object.apply_snapshot_chunk !== null) { - message.applySnapshotChunk = ResponseApplySnapshotChunk.fromAmino(object.apply_snapshot_chunk); + if (object.proposer_address !== undefined && object.proposer_address !== null) { + message.proposerAddress = bytesFromBase64(object.proposer_address); } return message; }, - toAmino(message: Response): ResponseAmino { + toAmino(message: RequestPrepareProposal): RequestPrepareProposalAmino { const obj: any = {}; - obj.exception = message.exception ? ResponseException.toAmino(message.exception) : undefined; - obj.echo = message.echo ? ResponseEcho.toAmino(message.echo) : undefined; - obj.flush = message.flush ? ResponseFlush.toAmino(message.flush) : undefined; - obj.info = message.info ? ResponseInfo.toAmino(message.info) : undefined; - obj.set_option = message.setOption ? ResponseSetOption.toAmino(message.setOption) : undefined; - obj.init_chain = message.initChain ? ResponseInitChain.toAmino(message.initChain) : undefined; - obj.query = message.query ? ResponseQuery.toAmino(message.query) : undefined; - obj.begin_block = message.beginBlock ? ResponseBeginBlock.toAmino(message.beginBlock) : undefined; - obj.check_tx = message.checkTx ? ResponseCheckTx.toAmino(message.checkTx) : undefined; - obj.deliver_tx = message.deliverTx ? ResponseDeliverTx.toAmino(message.deliverTx) : undefined; - obj.end_block = message.endBlock ? ResponseEndBlock.toAmino(message.endBlock) : undefined; - obj.commit = message.commit ? ResponseCommit.toAmino(message.commit) : undefined; - obj.list_snapshots = message.listSnapshots ? ResponseListSnapshots.toAmino(message.listSnapshots) : undefined; - obj.offer_snapshot = message.offerSnapshot ? ResponseOfferSnapshot.toAmino(message.offerSnapshot) : undefined; - obj.load_snapshot_chunk = message.loadSnapshotChunk ? ResponseLoadSnapshotChunk.toAmino(message.loadSnapshotChunk) : undefined; - obj.apply_snapshot_chunk = message.applySnapshotChunk ? ResponseApplySnapshotChunk.toAmino(message.applySnapshotChunk) : undefined; + obj.max_tx_bytes = message.maxTxBytes !== BigInt(0) ? message.maxTxBytes.toString() : undefined; + if (message.txs) { + obj.txs = message.txs.map(e => base64FromBytes(e)); + } else { + obj.txs = message.txs; + } + obj.local_last_commit = message.localLastCommit ? ExtendedCommitInfo.toAmino(message.localLastCommit) : undefined; + if (message.misbehavior) { + obj.misbehavior = message.misbehavior.map(e => e ? Misbehavior.toAmino(e) : undefined); + } else { + obj.misbehavior = message.misbehavior; + } + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; + obj.next_validators_hash = message.nextValidatorsHash ? base64FromBytes(message.nextValidatorsHash) : undefined; + obj.proposer_address = message.proposerAddress ? base64FromBytes(message.proposerAddress) : undefined; return obj; }, - fromAminoMsg(object: ResponseAminoMsg): Response { - return Response.fromAmino(object.value); + fromAminoMsg(object: RequestPrepareProposalAminoMsg): RequestPrepareProposal { + return RequestPrepareProposal.fromAmino(object.value); }, - fromProtoMsg(message: ResponseProtoMsg): Response { - return Response.decode(message.value); + fromProtoMsg(message: RequestPrepareProposalProtoMsg): RequestPrepareProposal { + return RequestPrepareProposal.decode(message.value); }, - toProto(message: Response): Uint8Array { - return Response.encode(message).finish(); + toProto(message: RequestPrepareProposal): Uint8Array { + return RequestPrepareProposal.encode(message).finish(); }, - toProtoMsg(message: Response): ResponseProtoMsg { + toProtoMsg(message: RequestPrepareProposal): RequestPrepareProposalProtoMsg { return { - typeUrl: "/tendermint.abci.Response", - value: Response.encode(message).finish() + typeUrl: "/tendermint.abci.RequestPrepareProposal", + value: RequestPrepareProposal.encode(message).finish() }; } }; -function createBaseResponseException(): ResponseException { +function createBaseRequestProcessProposal(): RequestProcessProposal { return { - error: "" + txs: [], + proposedLastCommit: CommitInfo.fromPartial({}), + misbehavior: [], + hash: new Uint8Array(), + height: BigInt(0), + time: new Date(), + nextValidatorsHash: new Uint8Array(), + proposerAddress: new Uint8Array() }; } -export const ResponseException = { - typeUrl: "/tendermint.abci.ResponseException", - encode(message: ResponseException, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.error !== "") { - writer.uint32(10).string(message.error); +export const RequestProcessProposal = { + typeUrl: "/tendermint.abci.RequestProcessProposal", + encode(message: RequestProcessProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.txs) { + writer.uint32(10).bytes(v!); + } + if (message.proposedLastCommit !== undefined) { + CommitInfo.encode(message.proposedLastCommit, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.misbehavior) { + Misbehavior.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.hash.length !== 0) { + writer.uint32(34).bytes(message.hash); + } + if (message.height !== BigInt(0)) { + writer.uint32(40).int64(message.height); + } + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(50).fork()).ldelim(); + } + if (message.nextValidatorsHash.length !== 0) { + writer.uint32(58).bytes(message.nextValidatorsHash); + } + if (message.proposerAddress.length !== 0) { + writer.uint32(66).bytes(message.proposerAddress); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ResponseException { + decode(input: BinaryReader | Uint8Array, length?: number): RequestProcessProposal { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponseException(); + const message = createBaseRequestProcessProposal(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.error = reader.string(); + message.txs.push(reader.bytes()); + break; + case 2: + message.proposedLastCommit = CommitInfo.decode(reader, reader.uint32()); + break; + case 3: + message.misbehavior.push(Misbehavior.decode(reader, reader.uint32())); + break; + case 4: + message.hash = reader.bytes(); + break; + case 5: + message.height = reader.int64(); + break; + case 6: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 7: + message.nextValidatorsHash = reader.bytes(); + break; + case 8: + message.proposerAddress = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -3056,61 +3010,149 @@ export const ResponseException = { } return message; }, - fromPartial(object: Partial): ResponseException { - const message = createBaseResponseException(); - message.error = object.error ?? ""; + fromPartial(object: Partial): RequestProcessProposal { + const message = createBaseRequestProcessProposal(); + message.txs = object.txs?.map(e => e) || []; + message.proposedLastCommit = object.proposedLastCommit !== undefined && object.proposedLastCommit !== null ? CommitInfo.fromPartial(object.proposedLastCommit) : undefined; + message.misbehavior = object.misbehavior?.map(e => Misbehavior.fromPartial(e)) || []; + message.hash = object.hash ?? new Uint8Array(); + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.time = object.time ?? undefined; + message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array(); + message.proposerAddress = object.proposerAddress ?? new Uint8Array(); return message; }, - fromAmino(object: ResponseExceptionAmino): ResponseException { - const message = createBaseResponseException(); - if (object.error !== undefined && object.error !== null) { - message.error = object.error; + fromAmino(object: RequestProcessProposalAmino): RequestProcessProposal { + const message = createBaseRequestProcessProposal(); + message.txs = object.txs?.map(e => bytesFromBase64(e)) || []; + if (object.proposed_last_commit !== undefined && object.proposed_last_commit !== null) { + message.proposedLastCommit = CommitInfo.fromAmino(object.proposed_last_commit); + } + message.misbehavior = object.misbehavior?.map(e => Misbehavior.fromAmino(e)) || []; + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.time !== undefined && object.time !== null) { + message.time = fromTimestamp(Timestamp.fromAmino(object.time)); + } + if (object.next_validators_hash !== undefined && object.next_validators_hash !== null) { + message.nextValidatorsHash = bytesFromBase64(object.next_validators_hash); + } + if (object.proposer_address !== undefined && object.proposer_address !== null) { + message.proposerAddress = bytesFromBase64(object.proposer_address); } return message; }, - toAmino(message: ResponseException): ResponseExceptionAmino { + toAmino(message: RequestProcessProposal): RequestProcessProposalAmino { const obj: any = {}; - obj.error = message.error === "" ? undefined : message.error; + if (message.txs) { + obj.txs = message.txs.map(e => base64FromBytes(e)); + } else { + obj.txs = message.txs; + } + obj.proposed_last_commit = message.proposedLastCommit ? CommitInfo.toAmino(message.proposedLastCommit) : undefined; + if (message.misbehavior) { + obj.misbehavior = message.misbehavior.map(e => e ? Misbehavior.toAmino(e) : undefined); + } else { + obj.misbehavior = message.misbehavior; + } + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; + obj.next_validators_hash = message.nextValidatorsHash ? base64FromBytes(message.nextValidatorsHash) : undefined; + obj.proposer_address = message.proposerAddress ? base64FromBytes(message.proposerAddress) : undefined; return obj; }, - fromAminoMsg(object: ResponseExceptionAminoMsg): ResponseException { - return ResponseException.fromAmino(object.value); + fromAminoMsg(object: RequestProcessProposalAminoMsg): RequestProcessProposal { + return RequestProcessProposal.fromAmino(object.value); }, - fromProtoMsg(message: ResponseExceptionProtoMsg): ResponseException { - return ResponseException.decode(message.value); + fromProtoMsg(message: RequestProcessProposalProtoMsg): RequestProcessProposal { + return RequestProcessProposal.decode(message.value); }, - toProto(message: ResponseException): Uint8Array { - return ResponseException.encode(message).finish(); + toProto(message: RequestProcessProposal): Uint8Array { + return RequestProcessProposal.encode(message).finish(); }, - toProtoMsg(message: ResponseException): ResponseExceptionProtoMsg { + toProtoMsg(message: RequestProcessProposal): RequestProcessProposalProtoMsg { return { - typeUrl: "/tendermint.abci.ResponseException", - value: ResponseException.encode(message).finish() + typeUrl: "/tendermint.abci.RequestProcessProposal", + value: RequestProcessProposal.encode(message).finish() }; } }; -function createBaseResponseEcho(): ResponseEcho { +function createBaseRequestExtendVote(): RequestExtendVote { return { - message: "" + hash: new Uint8Array(), + height: BigInt(0), + time: new Date(), + txs: [], + proposedLastCommit: CommitInfo.fromPartial({}), + misbehavior: [], + nextValidatorsHash: new Uint8Array(), + proposerAddress: new Uint8Array() }; } -export const ResponseEcho = { - typeUrl: "/tendermint.abci.ResponseEcho", - encode(message: ResponseEcho, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.message !== "") { - writer.uint32(10).string(message.message); +export const RequestExtendVote = { + typeUrl: "/tendermint.abci.RequestExtendVote", + encode(message: RequestExtendVote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hash.length !== 0) { + writer.uint32(10).bytes(message.hash); + } + if (message.height !== BigInt(0)) { + writer.uint32(16).int64(message.height); + } + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(26).fork()).ldelim(); + } + for (const v of message.txs) { + writer.uint32(34).bytes(v!); + } + if (message.proposedLastCommit !== undefined) { + CommitInfo.encode(message.proposedLastCommit, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.misbehavior) { + Misbehavior.encode(v!, writer.uint32(50).fork()).ldelim(); + } + if (message.nextValidatorsHash.length !== 0) { + writer.uint32(58).bytes(message.nextValidatorsHash); + } + if (message.proposerAddress.length !== 0) { + writer.uint32(66).bytes(message.proposerAddress); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ResponseEcho { + decode(input: BinaryReader | Uint8Array, length?: number): RequestExtendVote { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponseEcho(); + const message = createBaseRequestExtendVote(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.message = reader.string(); + message.hash = reader.bytes(); + break; + case 2: + message.height = reader.int64(); + break; + case 3: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 4: + message.txs.push(reader.bytes()); + break; + case 5: + message.proposedLastCommit = CommitInfo.decode(reader, reader.uint32()); + break; + case 6: + message.misbehavior.push(Misbehavior.decode(reader, reader.uint32())); + break; + case 7: + message.nextValidatorsHash = reader.bytes(); + break; + case 8: + message.proposerAddress = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -3119,54 +3161,122 @@ export const ResponseEcho = { } return message; }, - fromPartial(object: Partial): ResponseEcho { - const message = createBaseResponseEcho(); - message.message = object.message ?? ""; + fromPartial(object: Partial): RequestExtendVote { + const message = createBaseRequestExtendVote(); + message.hash = object.hash ?? new Uint8Array(); + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.time = object.time ?? undefined; + message.txs = object.txs?.map(e => e) || []; + message.proposedLastCommit = object.proposedLastCommit !== undefined && object.proposedLastCommit !== null ? CommitInfo.fromPartial(object.proposedLastCommit) : undefined; + message.misbehavior = object.misbehavior?.map(e => Misbehavior.fromPartial(e)) || []; + message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array(); + message.proposerAddress = object.proposerAddress ?? new Uint8Array(); return message; }, - fromAmino(object: ResponseEchoAmino): ResponseEcho { - const message = createBaseResponseEcho(); - if (object.message !== undefined && object.message !== null) { - message.message = object.message; + fromAmino(object: RequestExtendVoteAmino): RequestExtendVote { + const message = createBaseRequestExtendVote(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.time !== undefined && object.time !== null) { + message.time = fromTimestamp(Timestamp.fromAmino(object.time)); + } + message.txs = object.txs?.map(e => bytesFromBase64(e)) || []; + if (object.proposed_last_commit !== undefined && object.proposed_last_commit !== null) { + message.proposedLastCommit = CommitInfo.fromAmino(object.proposed_last_commit); + } + message.misbehavior = object.misbehavior?.map(e => Misbehavior.fromAmino(e)) || []; + if (object.next_validators_hash !== undefined && object.next_validators_hash !== null) { + message.nextValidatorsHash = bytesFromBase64(object.next_validators_hash); + } + if (object.proposer_address !== undefined && object.proposer_address !== null) { + message.proposerAddress = bytesFromBase64(object.proposer_address); } return message; }, - toAmino(message: ResponseEcho): ResponseEchoAmino { + toAmino(message: RequestExtendVote): RequestExtendVoteAmino { const obj: any = {}; - obj.message = message.message === "" ? undefined : message.message; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; + if (message.txs) { + obj.txs = message.txs.map(e => base64FromBytes(e)); + } else { + obj.txs = message.txs; + } + obj.proposed_last_commit = message.proposedLastCommit ? CommitInfo.toAmino(message.proposedLastCommit) : undefined; + if (message.misbehavior) { + obj.misbehavior = message.misbehavior.map(e => e ? Misbehavior.toAmino(e) : undefined); + } else { + obj.misbehavior = message.misbehavior; + } + obj.next_validators_hash = message.nextValidatorsHash ? base64FromBytes(message.nextValidatorsHash) : undefined; + obj.proposer_address = message.proposerAddress ? base64FromBytes(message.proposerAddress) : undefined; return obj; }, - fromAminoMsg(object: ResponseEchoAminoMsg): ResponseEcho { - return ResponseEcho.fromAmino(object.value); + fromAminoMsg(object: RequestExtendVoteAminoMsg): RequestExtendVote { + return RequestExtendVote.fromAmino(object.value); }, - fromProtoMsg(message: ResponseEchoProtoMsg): ResponseEcho { - return ResponseEcho.decode(message.value); + fromProtoMsg(message: RequestExtendVoteProtoMsg): RequestExtendVote { + return RequestExtendVote.decode(message.value); }, - toProto(message: ResponseEcho): Uint8Array { - return ResponseEcho.encode(message).finish(); + toProto(message: RequestExtendVote): Uint8Array { + return RequestExtendVote.encode(message).finish(); }, - toProtoMsg(message: ResponseEcho): ResponseEchoProtoMsg { + toProtoMsg(message: RequestExtendVote): RequestExtendVoteProtoMsg { return { - typeUrl: "/tendermint.abci.ResponseEcho", - value: ResponseEcho.encode(message).finish() + typeUrl: "/tendermint.abci.RequestExtendVote", + value: RequestExtendVote.encode(message).finish() }; } }; -function createBaseResponseFlush(): ResponseFlush { - return {}; +function createBaseRequestVerifyVoteExtension(): RequestVerifyVoteExtension { + return { + hash: new Uint8Array(), + validatorAddress: new Uint8Array(), + height: BigInt(0), + voteExtension: new Uint8Array() + }; } -export const ResponseFlush = { - typeUrl: "/tendermint.abci.ResponseFlush", - encode(_: ResponseFlush, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const RequestVerifyVoteExtension = { + typeUrl: "/tendermint.abci.RequestVerifyVoteExtension", + encode(message: RequestVerifyVoteExtension, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.hash.length !== 0) { + writer.uint32(10).bytes(message.hash); + } + if (message.validatorAddress.length !== 0) { + writer.uint32(18).bytes(message.validatorAddress); + } + if (message.height !== BigInt(0)) { + writer.uint32(24).int64(message.height); + } + if (message.voteExtension.length !== 0) { + writer.uint32(34).bytes(message.voteExtension); + } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ResponseFlush { + decode(input: BinaryReader | Uint8Array, length?: number): RequestVerifyVoteExtension { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponseFlush(); + const message = createBaseRequestVerifyVoteExtension(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.hash = reader.bytes(); + break; + case 2: + message.validatorAddress = reader.bytes(); + break; + case 3: + message.height = reader.int64(); + break; + case 4: + message.voteExtension = reader.bytes(); + break; default: reader.skipType(tag & 7); break; @@ -3174,84 +3284,125 @@ export const ResponseFlush = { } return message; }, - fromPartial(_: Partial): ResponseFlush { - const message = createBaseResponseFlush(); + fromPartial(object: Partial): RequestVerifyVoteExtension { + const message = createBaseRequestVerifyVoteExtension(); + message.hash = object.hash ?? new Uint8Array(); + message.validatorAddress = object.validatorAddress ?? new Uint8Array(); + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.voteExtension = object.voteExtension ?? new Uint8Array(); return message; }, - fromAmino(_: ResponseFlushAmino): ResponseFlush { - const message = createBaseResponseFlush(); - return message; + fromAmino(object: RequestVerifyVoteExtensionAmino): RequestVerifyVoteExtension { + const message = createBaseRequestVerifyVoteExtension(); + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = bytesFromBase64(object.validator_address); + } + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.vote_extension !== undefined && object.vote_extension !== null) { + message.voteExtension = bytesFromBase64(object.vote_extension); + } + return message; }, - toAmino(_: ResponseFlush): ResponseFlushAmino { + toAmino(message: RequestVerifyVoteExtension): RequestVerifyVoteExtensionAmino { const obj: any = {}; + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; + obj.validator_address = message.validatorAddress ? base64FromBytes(message.validatorAddress) : undefined; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.vote_extension = message.voteExtension ? base64FromBytes(message.voteExtension) : undefined; return obj; }, - fromAminoMsg(object: ResponseFlushAminoMsg): ResponseFlush { - return ResponseFlush.fromAmino(object.value); + fromAminoMsg(object: RequestVerifyVoteExtensionAminoMsg): RequestVerifyVoteExtension { + return RequestVerifyVoteExtension.fromAmino(object.value); }, - fromProtoMsg(message: ResponseFlushProtoMsg): ResponseFlush { - return ResponseFlush.decode(message.value); + fromProtoMsg(message: RequestVerifyVoteExtensionProtoMsg): RequestVerifyVoteExtension { + return RequestVerifyVoteExtension.decode(message.value); }, - toProto(message: ResponseFlush): Uint8Array { - return ResponseFlush.encode(message).finish(); + toProto(message: RequestVerifyVoteExtension): Uint8Array { + return RequestVerifyVoteExtension.encode(message).finish(); }, - toProtoMsg(message: ResponseFlush): ResponseFlushProtoMsg { + toProtoMsg(message: RequestVerifyVoteExtension): RequestVerifyVoteExtensionProtoMsg { return { - typeUrl: "/tendermint.abci.ResponseFlush", - value: ResponseFlush.encode(message).finish() + typeUrl: "/tendermint.abci.RequestVerifyVoteExtension", + value: RequestVerifyVoteExtension.encode(message).finish() }; } }; -function createBaseResponseInfo(): ResponseInfo { +function createBaseRequestFinalizeBlock(): RequestFinalizeBlock { return { - data: "", - version: "", - appVersion: BigInt(0), - lastBlockHeight: BigInt(0), - lastBlockAppHash: new Uint8Array() + txs: [], + decidedLastCommit: CommitInfo.fromPartial({}), + misbehavior: [], + hash: new Uint8Array(), + height: BigInt(0), + time: new Date(), + nextValidatorsHash: new Uint8Array(), + proposerAddress: new Uint8Array() }; } -export const ResponseInfo = { - typeUrl: "/tendermint.abci.ResponseInfo", - encode(message: ResponseInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.data !== "") { - writer.uint32(10).string(message.data); +export const RequestFinalizeBlock = { + typeUrl: "/tendermint.abci.RequestFinalizeBlock", + encode(message: RequestFinalizeBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.txs) { + writer.uint32(10).bytes(v!); } - if (message.version !== "") { - writer.uint32(18).string(message.version); + if (message.decidedLastCommit !== undefined) { + CommitInfo.encode(message.decidedLastCommit, writer.uint32(18).fork()).ldelim(); } - if (message.appVersion !== BigInt(0)) { - writer.uint32(24).uint64(message.appVersion); + for (const v of message.misbehavior) { + Misbehavior.encode(v!, writer.uint32(26).fork()).ldelim(); } - if (message.lastBlockHeight !== BigInt(0)) { - writer.uint32(32).int64(message.lastBlockHeight); + if (message.hash.length !== 0) { + writer.uint32(34).bytes(message.hash); } - if (message.lastBlockAppHash.length !== 0) { - writer.uint32(42).bytes(message.lastBlockAppHash); + if (message.height !== BigInt(0)) { + writer.uint32(40).int64(message.height); + } + if (message.time !== undefined) { + Timestamp.encode(toTimestamp(message.time), writer.uint32(50).fork()).ldelim(); + } + if (message.nextValidatorsHash.length !== 0) { + writer.uint32(58).bytes(message.nextValidatorsHash); + } + if (message.proposerAddress.length !== 0) { + writer.uint32(66).bytes(message.proposerAddress); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ResponseInfo { + decode(input: BinaryReader | Uint8Array, length?: number): RequestFinalizeBlock { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponseInfo(); + const message = createBaseRequestFinalizeBlock(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.data = reader.string(); + message.txs.push(reader.bytes()); break; case 2: - message.version = reader.string(); + message.decidedLastCommit = CommitInfo.decode(reader, reader.uint32()); break; case 3: - message.appVersion = reader.uint64(); + message.misbehavior.push(Misbehavior.decode(reader, reader.uint32())); break; case 4: - message.lastBlockHeight = reader.int64(); + message.hash = reader.bytes(); break; case 5: - message.lastBlockAppHash = reader.bytes(); + message.height = reader.int64(); + break; + case 6: + message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 7: + message.nextValidatorsHash = reader.bytes(); + break; + case 8: + message.proposerAddress = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -3260,95 +3411,212 @@ export const ResponseInfo = { } return message; }, - fromPartial(object: Partial): ResponseInfo { - const message = createBaseResponseInfo(); - message.data = object.data ?? ""; - message.version = object.version ?? ""; - message.appVersion = object.appVersion !== undefined && object.appVersion !== null ? BigInt(object.appVersion.toString()) : BigInt(0); - message.lastBlockHeight = object.lastBlockHeight !== undefined && object.lastBlockHeight !== null ? BigInt(object.lastBlockHeight.toString()) : BigInt(0); - message.lastBlockAppHash = object.lastBlockAppHash ?? new Uint8Array(); + fromPartial(object: Partial): RequestFinalizeBlock { + const message = createBaseRequestFinalizeBlock(); + message.txs = object.txs?.map(e => e) || []; + message.decidedLastCommit = object.decidedLastCommit !== undefined && object.decidedLastCommit !== null ? CommitInfo.fromPartial(object.decidedLastCommit) : undefined; + message.misbehavior = object.misbehavior?.map(e => Misbehavior.fromPartial(e)) || []; + message.hash = object.hash ?? new Uint8Array(); + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.time = object.time ?? undefined; + message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array(); + message.proposerAddress = object.proposerAddress ?? new Uint8Array(); return message; }, - fromAmino(object: ResponseInfoAmino): ResponseInfo { - const message = createBaseResponseInfo(); - if (object.data !== undefined && object.data !== null) { - message.data = object.data; + fromAmino(object: RequestFinalizeBlockAmino): RequestFinalizeBlock { + const message = createBaseRequestFinalizeBlock(); + message.txs = object.txs?.map(e => bytesFromBase64(e)) || []; + if (object.decided_last_commit !== undefined && object.decided_last_commit !== null) { + message.decidedLastCommit = CommitInfo.fromAmino(object.decided_last_commit); } - if (object.version !== undefined && object.version !== null) { - message.version = object.version; + message.misbehavior = object.misbehavior?.map(e => Misbehavior.fromAmino(e)) || []; + if (object.hash !== undefined && object.hash !== null) { + message.hash = bytesFromBase64(object.hash); } - if (object.app_version !== undefined && object.app_version !== null) { - message.appVersion = BigInt(object.app_version); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); } - if (object.last_block_height !== undefined && object.last_block_height !== null) { - message.lastBlockHeight = BigInt(object.last_block_height); + if (object.time !== undefined && object.time !== null) { + message.time = fromTimestamp(Timestamp.fromAmino(object.time)); } - if (object.last_block_app_hash !== undefined && object.last_block_app_hash !== null) { - message.lastBlockAppHash = bytesFromBase64(object.last_block_app_hash); + if (object.next_validators_hash !== undefined && object.next_validators_hash !== null) { + message.nextValidatorsHash = bytesFromBase64(object.next_validators_hash); + } + if (object.proposer_address !== undefined && object.proposer_address !== null) { + message.proposerAddress = bytesFromBase64(object.proposer_address); } return message; }, - toAmino(message: ResponseInfo): ResponseInfoAmino { + toAmino(message: RequestFinalizeBlock): RequestFinalizeBlockAmino { const obj: any = {}; - obj.data = message.data === "" ? undefined : message.data; - obj.version = message.version === "" ? undefined : message.version; - obj.app_version = message.appVersion !== BigInt(0) ? message.appVersion.toString() : undefined; - obj.last_block_height = message.lastBlockHeight !== BigInt(0) ? message.lastBlockHeight.toString() : undefined; - obj.last_block_app_hash = message.lastBlockAppHash ? base64FromBytes(message.lastBlockAppHash) : undefined; + if (message.txs) { + obj.txs = message.txs.map(e => base64FromBytes(e)); + } else { + obj.txs = message.txs; + } + obj.decided_last_commit = message.decidedLastCommit ? CommitInfo.toAmino(message.decidedLastCommit) : undefined; + if (message.misbehavior) { + obj.misbehavior = message.misbehavior.map(e => e ? Misbehavior.toAmino(e) : undefined); + } else { + obj.misbehavior = message.misbehavior; + } + obj.hash = message.hash ? base64FromBytes(message.hash) : undefined; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.time = message.time ? Timestamp.toAmino(toTimestamp(message.time)) : undefined; + obj.next_validators_hash = message.nextValidatorsHash ? base64FromBytes(message.nextValidatorsHash) : undefined; + obj.proposer_address = message.proposerAddress ? base64FromBytes(message.proposerAddress) : undefined; return obj; }, - fromAminoMsg(object: ResponseInfoAminoMsg): ResponseInfo { - return ResponseInfo.fromAmino(object.value); + fromAminoMsg(object: RequestFinalizeBlockAminoMsg): RequestFinalizeBlock { + return RequestFinalizeBlock.fromAmino(object.value); }, - fromProtoMsg(message: ResponseInfoProtoMsg): ResponseInfo { - return ResponseInfo.decode(message.value); + fromProtoMsg(message: RequestFinalizeBlockProtoMsg): RequestFinalizeBlock { + return RequestFinalizeBlock.decode(message.value); }, - toProto(message: ResponseInfo): Uint8Array { - return ResponseInfo.encode(message).finish(); + toProto(message: RequestFinalizeBlock): Uint8Array { + return RequestFinalizeBlock.encode(message).finish(); }, - toProtoMsg(message: ResponseInfo): ResponseInfoProtoMsg { + toProtoMsg(message: RequestFinalizeBlock): RequestFinalizeBlockProtoMsg { return { - typeUrl: "/tendermint.abci.ResponseInfo", - value: ResponseInfo.encode(message).finish() + typeUrl: "/tendermint.abci.RequestFinalizeBlock", + value: RequestFinalizeBlock.encode(message).finish() }; } }; -function createBaseResponseSetOption(): ResponseSetOption { +function createBaseResponse(): Response { return { - code: 0, - log: "", - info: "" + exception: undefined, + echo: undefined, + flush: undefined, + info: undefined, + initChain: undefined, + query: undefined, + checkTx: undefined, + commit: undefined, + listSnapshots: undefined, + offerSnapshot: undefined, + loadSnapshotChunk: undefined, + applySnapshotChunk: undefined, + prepareProposal: undefined, + processProposal: undefined, + extendVote: undefined, + verifyVoteExtension: undefined, + finalizeBlock: undefined }; } -export const ResponseSetOption = { - typeUrl: "/tendermint.abci.ResponseSetOption", - encode(message: ResponseSetOption, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.code !== 0) { - writer.uint32(8).uint32(message.code); +export const Response = { + typeUrl: "/tendermint.abci.Response", + encode(message: Response, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.exception !== undefined) { + ResponseException.encode(message.exception, writer.uint32(10).fork()).ldelim(); } - if (message.log !== "") { - writer.uint32(26).string(message.log); + if (message.echo !== undefined) { + ResponseEcho.encode(message.echo, writer.uint32(18).fork()).ldelim(); } - if (message.info !== "") { - writer.uint32(34).string(message.info); + if (message.flush !== undefined) { + ResponseFlush.encode(message.flush, writer.uint32(26).fork()).ldelim(); + } + if (message.info !== undefined) { + ResponseInfo.encode(message.info, writer.uint32(34).fork()).ldelim(); + } + if (message.initChain !== undefined) { + ResponseInitChain.encode(message.initChain, writer.uint32(50).fork()).ldelim(); + } + if (message.query !== undefined) { + ResponseQuery.encode(message.query, writer.uint32(58).fork()).ldelim(); + } + if (message.checkTx !== undefined) { + ResponseCheckTx.encode(message.checkTx, writer.uint32(74).fork()).ldelim(); + } + if (message.commit !== undefined) { + ResponseCommit.encode(message.commit, writer.uint32(98).fork()).ldelim(); + } + if (message.listSnapshots !== undefined) { + ResponseListSnapshots.encode(message.listSnapshots, writer.uint32(106).fork()).ldelim(); + } + if (message.offerSnapshot !== undefined) { + ResponseOfferSnapshot.encode(message.offerSnapshot, writer.uint32(114).fork()).ldelim(); + } + if (message.loadSnapshotChunk !== undefined) { + ResponseLoadSnapshotChunk.encode(message.loadSnapshotChunk, writer.uint32(122).fork()).ldelim(); + } + if (message.applySnapshotChunk !== undefined) { + ResponseApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(130).fork()).ldelim(); + } + if (message.prepareProposal !== undefined) { + ResponsePrepareProposal.encode(message.prepareProposal, writer.uint32(138).fork()).ldelim(); + } + if (message.processProposal !== undefined) { + ResponseProcessProposal.encode(message.processProposal, writer.uint32(146).fork()).ldelim(); + } + if (message.extendVote !== undefined) { + ResponseExtendVote.encode(message.extendVote, writer.uint32(154).fork()).ldelim(); + } + if (message.verifyVoteExtension !== undefined) { + ResponseVerifyVoteExtension.encode(message.verifyVoteExtension, writer.uint32(162).fork()).ldelim(); + } + if (message.finalizeBlock !== undefined) { + ResponseFinalizeBlock.encode(message.finalizeBlock, writer.uint32(170).fork()).ldelim(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ResponseSetOption { + decode(input: BinaryReader | Uint8Array, length?: number): Response { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponseSetOption(); + const message = createBaseResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.code = reader.uint32(); + message.exception = ResponseException.decode(reader, reader.uint32()); + break; + case 2: + message.echo = ResponseEcho.decode(reader, reader.uint32()); break; case 3: - message.log = reader.string(); + message.flush = ResponseFlush.decode(reader, reader.uint32()); break; case 4: - message.info = reader.string(); + message.info = ResponseInfo.decode(reader, reader.uint32()); + break; + case 6: + message.initChain = ResponseInitChain.decode(reader, reader.uint32()); + break; + case 7: + message.query = ResponseQuery.decode(reader, reader.uint32()); + break; + case 9: + message.checkTx = ResponseCheckTx.decode(reader, reader.uint32()); + break; + case 12: + message.commit = ResponseCommit.decode(reader, reader.uint32()); + break; + case 13: + message.listSnapshots = ResponseListSnapshots.decode(reader, reader.uint32()); + break; + case 14: + message.offerSnapshot = ResponseOfferSnapshot.decode(reader, reader.uint32()); + break; + case 15: + message.loadSnapshotChunk = ResponseLoadSnapshotChunk.decode(reader, reader.uint32()); + break; + case 16: + message.applySnapshotChunk = ResponseApplySnapshotChunk.decode(reader, reader.uint32()); + break; + case 17: + message.prepareProposal = ResponsePrepareProposal.decode(reader, reader.uint32()); + break; + case 18: + message.processProposal = ResponseProcessProposal.decode(reader, reader.uint32()); + break; + case 19: + message.extendVote = ResponseExtendVote.decode(reader, reader.uint32()); + break; + case 20: + message.verifyVoteExtension = ResponseVerifyVoteExtension.decode(reader, reader.uint32()); + break; + case 21: + message.finalizeBlock = ResponseFinalizeBlock.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -3357,85 +3625,141 @@ export const ResponseSetOption = { } return message; }, - fromPartial(object: Partial): ResponseSetOption { - const message = createBaseResponseSetOption(); - message.code = object.code ?? 0; - message.log = object.log ?? ""; - message.info = object.info ?? ""; + fromPartial(object: Partial): Response { + const message = createBaseResponse(); + message.exception = object.exception !== undefined && object.exception !== null ? ResponseException.fromPartial(object.exception) : undefined; + message.echo = object.echo !== undefined && object.echo !== null ? ResponseEcho.fromPartial(object.echo) : undefined; + message.flush = object.flush !== undefined && object.flush !== null ? ResponseFlush.fromPartial(object.flush) : undefined; + message.info = object.info !== undefined && object.info !== null ? ResponseInfo.fromPartial(object.info) : undefined; + message.initChain = object.initChain !== undefined && object.initChain !== null ? ResponseInitChain.fromPartial(object.initChain) : undefined; + message.query = object.query !== undefined && object.query !== null ? ResponseQuery.fromPartial(object.query) : undefined; + message.checkTx = object.checkTx !== undefined && object.checkTx !== null ? ResponseCheckTx.fromPartial(object.checkTx) : undefined; + message.commit = object.commit !== undefined && object.commit !== null ? ResponseCommit.fromPartial(object.commit) : undefined; + message.listSnapshots = object.listSnapshots !== undefined && object.listSnapshots !== null ? ResponseListSnapshots.fromPartial(object.listSnapshots) : undefined; + message.offerSnapshot = object.offerSnapshot !== undefined && object.offerSnapshot !== null ? ResponseOfferSnapshot.fromPartial(object.offerSnapshot) : undefined; + message.loadSnapshotChunk = object.loadSnapshotChunk !== undefined && object.loadSnapshotChunk !== null ? ResponseLoadSnapshotChunk.fromPartial(object.loadSnapshotChunk) : undefined; + message.applySnapshotChunk = object.applySnapshotChunk !== undefined && object.applySnapshotChunk !== null ? ResponseApplySnapshotChunk.fromPartial(object.applySnapshotChunk) : undefined; + message.prepareProposal = object.prepareProposal !== undefined && object.prepareProposal !== null ? ResponsePrepareProposal.fromPartial(object.prepareProposal) : undefined; + message.processProposal = object.processProposal !== undefined && object.processProposal !== null ? ResponseProcessProposal.fromPartial(object.processProposal) : undefined; + message.extendVote = object.extendVote !== undefined && object.extendVote !== null ? ResponseExtendVote.fromPartial(object.extendVote) : undefined; + message.verifyVoteExtension = object.verifyVoteExtension !== undefined && object.verifyVoteExtension !== null ? ResponseVerifyVoteExtension.fromPartial(object.verifyVoteExtension) : undefined; + message.finalizeBlock = object.finalizeBlock !== undefined && object.finalizeBlock !== null ? ResponseFinalizeBlock.fromPartial(object.finalizeBlock) : undefined; return message; }, - fromAmino(object: ResponseSetOptionAmino): ResponseSetOption { - const message = createBaseResponseSetOption(); - if (object.code !== undefined && object.code !== null) { - message.code = object.code; + fromAmino(object: ResponseAmino): Response { + const message = createBaseResponse(); + if (object.exception !== undefined && object.exception !== null) { + message.exception = ResponseException.fromAmino(object.exception); } - if (object.log !== undefined && object.log !== null) { - message.log = object.log; + if (object.echo !== undefined && object.echo !== null) { + message.echo = ResponseEcho.fromAmino(object.echo); + } + if (object.flush !== undefined && object.flush !== null) { + message.flush = ResponseFlush.fromAmino(object.flush); } if (object.info !== undefined && object.info !== null) { - message.info = object.info; + message.info = ResponseInfo.fromAmino(object.info); } - return message; - }, - toAmino(message: ResponseSetOption): ResponseSetOptionAmino { - const obj: any = {}; - obj.code = message.code === 0 ? undefined : message.code; - obj.log = message.log === "" ? undefined : message.log; - obj.info = message.info === "" ? undefined : message.info; + if (object.init_chain !== undefined && object.init_chain !== null) { + message.initChain = ResponseInitChain.fromAmino(object.init_chain); + } + if (object.query !== undefined && object.query !== null) { + message.query = ResponseQuery.fromAmino(object.query); + } + if (object.check_tx !== undefined && object.check_tx !== null) { + message.checkTx = ResponseCheckTx.fromAmino(object.check_tx); + } + if (object.commit !== undefined && object.commit !== null) { + message.commit = ResponseCommit.fromAmino(object.commit); + } + if (object.list_snapshots !== undefined && object.list_snapshots !== null) { + message.listSnapshots = ResponseListSnapshots.fromAmino(object.list_snapshots); + } + if (object.offer_snapshot !== undefined && object.offer_snapshot !== null) { + message.offerSnapshot = ResponseOfferSnapshot.fromAmino(object.offer_snapshot); + } + if (object.load_snapshot_chunk !== undefined && object.load_snapshot_chunk !== null) { + message.loadSnapshotChunk = ResponseLoadSnapshotChunk.fromAmino(object.load_snapshot_chunk); + } + if (object.apply_snapshot_chunk !== undefined && object.apply_snapshot_chunk !== null) { + message.applySnapshotChunk = ResponseApplySnapshotChunk.fromAmino(object.apply_snapshot_chunk); + } + if (object.prepare_proposal !== undefined && object.prepare_proposal !== null) { + message.prepareProposal = ResponsePrepareProposal.fromAmino(object.prepare_proposal); + } + if (object.process_proposal !== undefined && object.process_proposal !== null) { + message.processProposal = ResponseProcessProposal.fromAmino(object.process_proposal); + } + if (object.extend_vote !== undefined && object.extend_vote !== null) { + message.extendVote = ResponseExtendVote.fromAmino(object.extend_vote); + } + if (object.verify_vote_extension !== undefined && object.verify_vote_extension !== null) { + message.verifyVoteExtension = ResponseVerifyVoteExtension.fromAmino(object.verify_vote_extension); + } + if (object.finalize_block !== undefined && object.finalize_block !== null) { + message.finalizeBlock = ResponseFinalizeBlock.fromAmino(object.finalize_block); + } + return message; + }, + toAmino(message: Response): ResponseAmino { + const obj: any = {}; + obj.exception = message.exception ? ResponseException.toAmino(message.exception) : undefined; + obj.echo = message.echo ? ResponseEcho.toAmino(message.echo) : undefined; + obj.flush = message.flush ? ResponseFlush.toAmino(message.flush) : undefined; + obj.info = message.info ? ResponseInfo.toAmino(message.info) : undefined; + obj.init_chain = message.initChain ? ResponseInitChain.toAmino(message.initChain) : undefined; + obj.query = message.query ? ResponseQuery.toAmino(message.query) : undefined; + obj.check_tx = message.checkTx ? ResponseCheckTx.toAmino(message.checkTx) : undefined; + obj.commit = message.commit ? ResponseCommit.toAmino(message.commit) : undefined; + obj.list_snapshots = message.listSnapshots ? ResponseListSnapshots.toAmino(message.listSnapshots) : undefined; + obj.offer_snapshot = message.offerSnapshot ? ResponseOfferSnapshot.toAmino(message.offerSnapshot) : undefined; + obj.load_snapshot_chunk = message.loadSnapshotChunk ? ResponseLoadSnapshotChunk.toAmino(message.loadSnapshotChunk) : undefined; + obj.apply_snapshot_chunk = message.applySnapshotChunk ? ResponseApplySnapshotChunk.toAmino(message.applySnapshotChunk) : undefined; + obj.prepare_proposal = message.prepareProposal ? ResponsePrepareProposal.toAmino(message.prepareProposal) : undefined; + obj.process_proposal = message.processProposal ? ResponseProcessProposal.toAmino(message.processProposal) : undefined; + obj.extend_vote = message.extendVote ? ResponseExtendVote.toAmino(message.extendVote) : undefined; + obj.verify_vote_extension = message.verifyVoteExtension ? ResponseVerifyVoteExtension.toAmino(message.verifyVoteExtension) : undefined; + obj.finalize_block = message.finalizeBlock ? ResponseFinalizeBlock.toAmino(message.finalizeBlock) : undefined; return obj; }, - fromAminoMsg(object: ResponseSetOptionAminoMsg): ResponseSetOption { - return ResponseSetOption.fromAmino(object.value); + fromAminoMsg(object: ResponseAminoMsg): Response { + return Response.fromAmino(object.value); }, - fromProtoMsg(message: ResponseSetOptionProtoMsg): ResponseSetOption { - return ResponseSetOption.decode(message.value); + fromProtoMsg(message: ResponseProtoMsg): Response { + return Response.decode(message.value); }, - toProto(message: ResponseSetOption): Uint8Array { - return ResponseSetOption.encode(message).finish(); + toProto(message: Response): Uint8Array { + return Response.encode(message).finish(); }, - toProtoMsg(message: ResponseSetOption): ResponseSetOptionProtoMsg { + toProtoMsg(message: Response): ResponseProtoMsg { return { - typeUrl: "/tendermint.abci.ResponseSetOption", - value: ResponseSetOption.encode(message).finish() + typeUrl: "/tendermint.abci.Response", + value: Response.encode(message).finish() }; } }; -function createBaseResponseInitChain(): ResponseInitChain { +function createBaseResponseException(): ResponseException { return { - consensusParams: undefined, - validators: [], - appHash: new Uint8Array() + error: "" }; } -export const ResponseInitChain = { - typeUrl: "/tendermint.abci.ResponseInitChain", - encode(message: ResponseInitChain, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.consensusParams !== undefined) { - ConsensusParams.encode(message.consensusParams, writer.uint32(10).fork()).ldelim(); - } - for (const v of message.validators) { - ValidatorUpdate.encode(v!, writer.uint32(18).fork()).ldelim(); - } - if (message.appHash.length !== 0) { - writer.uint32(26).bytes(message.appHash); +export const ResponseException = { + typeUrl: "/tendermint.abci.ResponseException", + encode(message: ResponseException, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.error !== "") { + writer.uint32(10).string(message.error); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ResponseInitChain { + decode(input: BinaryReader | Uint8Array, length?: number): ResponseException { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponseInitChain(); + const message = createBaseResponseException(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.consensusParams = ConsensusParams.decode(reader, reader.uint32()); - break; - case 2: - message.validators.push(ValidatorUpdate.decode(reader, reader.uint32())); - break; - case 3: - message.appHash = reader.bytes(); + message.error = reader.string(); break; default: reader.skipType(tag & 7); @@ -3444,129 +3768,202 @@ export const ResponseInitChain = { } return message; }, - fromPartial(object: Partial): ResponseInitChain { - const message = createBaseResponseInitChain(); - message.consensusParams = object.consensusParams !== undefined && object.consensusParams !== null ? ConsensusParams.fromPartial(object.consensusParams) : undefined; - message.validators = object.validators?.map(e => ValidatorUpdate.fromPartial(e)) || []; - message.appHash = object.appHash ?? new Uint8Array(); + fromPartial(object: Partial): ResponseException { + const message = createBaseResponseException(); + message.error = object.error ?? ""; return message; }, - fromAmino(object: ResponseInitChainAmino): ResponseInitChain { - const message = createBaseResponseInitChain(); - if (object.consensus_params !== undefined && object.consensus_params !== null) { - message.consensusParams = ConsensusParams.fromAmino(object.consensus_params); - } - message.validators = object.validators?.map(e => ValidatorUpdate.fromAmino(e)) || []; - if (object.app_hash !== undefined && object.app_hash !== null) { - message.appHash = bytesFromBase64(object.app_hash); + fromAmino(object: ResponseExceptionAmino): ResponseException { + const message = createBaseResponseException(); + if (object.error !== undefined && object.error !== null) { + message.error = object.error; } return message; }, - toAmino(message: ResponseInitChain): ResponseInitChainAmino { + toAmino(message: ResponseException): ResponseExceptionAmino { const obj: any = {}; - obj.consensus_params = message.consensusParams ? ConsensusParams.toAmino(message.consensusParams) : undefined; - if (message.validators) { - obj.validators = message.validators.map(e => e ? ValidatorUpdate.toAmino(e) : undefined); - } else { - obj.validators = message.validators; - } - obj.app_hash = message.appHash ? base64FromBytes(message.appHash) : undefined; + obj.error = message.error === "" ? undefined : message.error; return obj; }, - fromAminoMsg(object: ResponseInitChainAminoMsg): ResponseInitChain { - return ResponseInitChain.fromAmino(object.value); + fromAminoMsg(object: ResponseExceptionAminoMsg): ResponseException { + return ResponseException.fromAmino(object.value); }, - fromProtoMsg(message: ResponseInitChainProtoMsg): ResponseInitChain { - return ResponseInitChain.decode(message.value); + fromProtoMsg(message: ResponseExceptionProtoMsg): ResponseException { + return ResponseException.decode(message.value); }, - toProto(message: ResponseInitChain): Uint8Array { - return ResponseInitChain.encode(message).finish(); + toProto(message: ResponseException): Uint8Array { + return ResponseException.encode(message).finish(); }, - toProtoMsg(message: ResponseInitChain): ResponseInitChainProtoMsg { + toProtoMsg(message: ResponseException): ResponseExceptionProtoMsg { return { - typeUrl: "/tendermint.abci.ResponseInitChain", - value: ResponseInitChain.encode(message).finish() + typeUrl: "/tendermint.abci.ResponseException", + value: ResponseException.encode(message).finish() }; } }; -function createBaseResponseQuery(): ResponseQuery { +function createBaseResponseEcho(): ResponseEcho { return { - code: 0, - log: "", - info: "", - index: BigInt(0), - key: new Uint8Array(), - value: new Uint8Array(), - proofOps: undefined, - height: BigInt(0), - codespace: "" + message: "" }; } -export const ResponseQuery = { - typeUrl: "/tendermint.abci.ResponseQuery", - encode(message: ResponseQuery, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.code !== 0) { - writer.uint32(8).uint32(message.code); +export const ResponseEcho = { + typeUrl: "/tendermint.abci.ResponseEcho", + encode(message: ResponseEcho, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.message !== "") { + writer.uint32(10).string(message.message); } - if (message.log !== "") { - writer.uint32(26).string(message.log); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseEcho { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseEcho(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } } - if (message.info !== "") { - writer.uint32(34).string(message.info); + return message; + }, + fromPartial(object: Partial): ResponseEcho { + const message = createBaseResponseEcho(); + message.message = object.message ?? ""; + return message; + }, + fromAmino(object: ResponseEchoAmino): ResponseEcho { + const message = createBaseResponseEcho(); + if (object.message !== undefined && object.message !== null) { + message.message = object.message; } - if (message.index !== BigInt(0)) { - writer.uint32(40).int64(message.index); + return message; + }, + toAmino(message: ResponseEcho): ResponseEchoAmino { + const obj: any = {}; + obj.message = message.message === "" ? undefined : message.message; + return obj; + }, + fromAminoMsg(object: ResponseEchoAminoMsg): ResponseEcho { + return ResponseEcho.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseEchoProtoMsg): ResponseEcho { + return ResponseEcho.decode(message.value); + }, + toProto(message: ResponseEcho): Uint8Array { + return ResponseEcho.encode(message).finish(); + }, + toProtoMsg(message: ResponseEcho): ResponseEchoProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseEcho", + value: ResponseEcho.encode(message).finish() + }; + } +}; +function createBaseResponseFlush(): ResponseFlush { + return {}; +} +export const ResponseFlush = { + typeUrl: "/tendermint.abci.ResponseFlush", + encode(_: ResponseFlush, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseFlush { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseFlush(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } } - if (message.key.length !== 0) { - writer.uint32(50).bytes(message.key); + return message; + }, + fromPartial(_: Partial): ResponseFlush { + const message = createBaseResponseFlush(); + return message; + }, + fromAmino(_: ResponseFlushAmino): ResponseFlush { + const message = createBaseResponseFlush(); + return message; + }, + toAmino(_: ResponseFlush): ResponseFlushAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: ResponseFlushAminoMsg): ResponseFlush { + return ResponseFlush.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseFlushProtoMsg): ResponseFlush { + return ResponseFlush.decode(message.value); + }, + toProto(message: ResponseFlush): Uint8Array { + return ResponseFlush.encode(message).finish(); + }, + toProtoMsg(message: ResponseFlush): ResponseFlushProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseFlush", + value: ResponseFlush.encode(message).finish() + }; + } +}; +function createBaseResponseInfo(): ResponseInfo { + return { + data: "", + version: "", + appVersion: BigInt(0), + lastBlockHeight: BigInt(0), + lastBlockAppHash: new Uint8Array() + }; +} +export const ResponseInfo = { + typeUrl: "/tendermint.abci.ResponseInfo", + encode(message: ResponseInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.data !== "") { + writer.uint32(10).string(message.data); } - if (message.value.length !== 0) { - writer.uint32(58).bytes(message.value); + if (message.version !== "") { + writer.uint32(18).string(message.version); } - if (message.proofOps !== undefined) { - ProofOps.encode(message.proofOps, writer.uint32(66).fork()).ldelim(); + if (message.appVersion !== BigInt(0)) { + writer.uint32(24).uint64(message.appVersion); } - if (message.height !== BigInt(0)) { - writer.uint32(72).int64(message.height); + if (message.lastBlockHeight !== BigInt(0)) { + writer.uint32(32).int64(message.lastBlockHeight); } - if (message.codespace !== "") { - writer.uint32(82).string(message.codespace); + if (message.lastBlockAppHash.length !== 0) { + writer.uint32(42).bytes(message.lastBlockAppHash); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ResponseQuery { + decode(input: BinaryReader | Uint8Array, length?: number): ResponseInfo { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponseQuery(); + const message = createBaseResponseInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.code = reader.uint32(); + message.data = reader.string(); + break; + case 2: + message.version = reader.string(); break; case 3: - message.log = reader.string(); + message.appVersion = reader.uint64(); break; case 4: - message.info = reader.string(); + message.lastBlockHeight = reader.int64(); break; case 5: - message.index = reader.int64(); - break; - case 6: - message.key = reader.bytes(); - break; - case 7: - message.value = reader.bytes(); - break; - case 8: - message.proofOps = ProofOps.decode(reader, reader.uint32()); - break; - case 9: - message.height = reader.int64(); - break; - case 10: - message.codespace = reader.string(); + message.lastBlockAppHash = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -3575,101 +3972,95 @@ export const ResponseQuery = { } return message; }, - fromPartial(object: Partial): ResponseQuery { - const message = createBaseResponseQuery(); - message.code = object.code ?? 0; - message.log = object.log ?? ""; - message.info = object.info ?? ""; - message.index = object.index !== undefined && object.index !== null ? BigInt(object.index.toString()) : BigInt(0); - message.key = object.key ?? new Uint8Array(); - message.value = object.value ?? new Uint8Array(); - message.proofOps = object.proofOps !== undefined && object.proofOps !== null ? ProofOps.fromPartial(object.proofOps) : undefined; - message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); - message.codespace = object.codespace ?? ""; + fromPartial(object: Partial): ResponseInfo { + const message = createBaseResponseInfo(); + message.data = object.data ?? ""; + message.version = object.version ?? ""; + message.appVersion = object.appVersion !== undefined && object.appVersion !== null ? BigInt(object.appVersion.toString()) : BigInt(0); + message.lastBlockHeight = object.lastBlockHeight !== undefined && object.lastBlockHeight !== null ? BigInt(object.lastBlockHeight.toString()) : BigInt(0); + message.lastBlockAppHash = object.lastBlockAppHash ?? new Uint8Array(); return message; }, - fromAmino(object: ResponseQueryAmino): ResponseQuery { - const message = createBaseResponseQuery(); - if (object.code !== undefined && object.code !== null) { - message.code = object.code; - } - if (object.log !== undefined && object.log !== null) { - message.log = object.log; - } - if (object.info !== undefined && object.info !== null) { - message.info = object.info; - } - if (object.index !== undefined && object.index !== null) { - message.index = BigInt(object.index); - } - if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); + fromAmino(object: ResponseInfoAmino): ResponseInfo { + const message = createBaseResponseInfo(); + if (object.data !== undefined && object.data !== null) { + message.data = object.data; } - if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); + if (object.version !== undefined && object.version !== null) { + message.version = object.version; } - if (object.proof_ops !== undefined && object.proof_ops !== null) { - message.proofOps = ProofOps.fromAmino(object.proof_ops); + if (object.app_version !== undefined && object.app_version !== null) { + message.appVersion = BigInt(object.app_version); } - if (object.height !== undefined && object.height !== null) { - message.height = BigInt(object.height); + if (object.last_block_height !== undefined && object.last_block_height !== null) { + message.lastBlockHeight = BigInt(object.last_block_height); } - if (object.codespace !== undefined && object.codespace !== null) { - message.codespace = object.codespace; + if (object.last_block_app_hash !== undefined && object.last_block_app_hash !== null) { + message.lastBlockAppHash = bytesFromBase64(object.last_block_app_hash); } return message; }, - toAmino(message: ResponseQuery): ResponseQueryAmino { + toAmino(message: ResponseInfo): ResponseInfoAmino { const obj: any = {}; - obj.code = message.code === 0 ? undefined : message.code; - obj.log = message.log === "" ? undefined : message.log; - obj.info = message.info === "" ? undefined : message.info; - obj.index = message.index !== BigInt(0) ? message.index.toString() : undefined; - obj.key = message.key ? base64FromBytes(message.key) : undefined; - obj.value = message.value ? base64FromBytes(message.value) : undefined; - obj.proof_ops = message.proofOps ? ProofOps.toAmino(message.proofOps) : undefined; - obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; - obj.codespace = message.codespace === "" ? undefined : message.codespace; + obj.data = message.data === "" ? undefined : message.data; + obj.version = message.version === "" ? undefined : message.version; + obj.app_version = message.appVersion !== BigInt(0) ? message.appVersion.toString() : undefined; + obj.last_block_height = message.lastBlockHeight !== BigInt(0) ? message.lastBlockHeight.toString() : undefined; + obj.last_block_app_hash = message.lastBlockAppHash ? base64FromBytes(message.lastBlockAppHash) : undefined; return obj; }, - fromAminoMsg(object: ResponseQueryAminoMsg): ResponseQuery { - return ResponseQuery.fromAmino(object.value); + fromAminoMsg(object: ResponseInfoAminoMsg): ResponseInfo { + return ResponseInfo.fromAmino(object.value); }, - fromProtoMsg(message: ResponseQueryProtoMsg): ResponseQuery { - return ResponseQuery.decode(message.value); + fromProtoMsg(message: ResponseInfoProtoMsg): ResponseInfo { + return ResponseInfo.decode(message.value); }, - toProto(message: ResponseQuery): Uint8Array { - return ResponseQuery.encode(message).finish(); + toProto(message: ResponseInfo): Uint8Array { + return ResponseInfo.encode(message).finish(); }, - toProtoMsg(message: ResponseQuery): ResponseQueryProtoMsg { + toProtoMsg(message: ResponseInfo): ResponseInfoProtoMsg { return { - typeUrl: "/tendermint.abci.ResponseQuery", - value: ResponseQuery.encode(message).finish() + typeUrl: "/tendermint.abci.ResponseInfo", + value: ResponseInfo.encode(message).finish() }; } }; -function createBaseResponseBeginBlock(): ResponseBeginBlock { +function createBaseResponseInitChain(): ResponseInitChain { return { - events: [] + consensusParams: undefined, + validators: [], + appHash: new Uint8Array() }; } -export const ResponseBeginBlock = { - typeUrl: "/tendermint.abci.ResponseBeginBlock", - encode(message: ResponseBeginBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - for (const v of message.events) { - Event.encode(v!, writer.uint32(10).fork()).ldelim(); +export const ResponseInitChain = { + typeUrl: "/tendermint.abci.ResponseInitChain", + encode(message: ResponseInitChain, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.consensusParams !== undefined) { + ConsensusParams.encode(message.consensusParams, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.validators) { + ValidatorUpdate.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.appHash.length !== 0) { + writer.uint32(26).bytes(message.appHash); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ResponseBeginBlock { + decode(input: BinaryReader | Uint8Array, length?: number): ResponseInitChain { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponseBeginBlock(); + const message = createBaseResponseInitChain(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.events.push(Event.decode(reader, reader.uint32())); + message.consensusParams = ConsensusParams.decode(reader, reader.uint32()); + break; + case 2: + message.validators.push(ValidatorUpdate.decode(reader, reader.uint32())); + break; + case 3: + message.appHash = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -3678,107 +4069,106 @@ export const ResponseBeginBlock = { } return message; }, - fromPartial(object: Partial): ResponseBeginBlock { - const message = createBaseResponseBeginBlock(); - message.events = object.events?.map(e => Event.fromPartial(e)) || []; + fromPartial(object: Partial): ResponseInitChain { + const message = createBaseResponseInitChain(); + message.consensusParams = object.consensusParams !== undefined && object.consensusParams !== null ? ConsensusParams.fromPartial(object.consensusParams) : undefined; + message.validators = object.validators?.map(e => ValidatorUpdate.fromPartial(e)) || []; + message.appHash = object.appHash ?? new Uint8Array(); return message; }, - fromAmino(object: ResponseBeginBlockAmino): ResponseBeginBlock { - const message = createBaseResponseBeginBlock(); - message.events = object.events?.map(e => Event.fromAmino(e)) || []; + fromAmino(object: ResponseInitChainAmino): ResponseInitChain { + const message = createBaseResponseInitChain(); + if (object.consensus_params !== undefined && object.consensus_params !== null) { + message.consensusParams = ConsensusParams.fromAmino(object.consensus_params); + } + message.validators = object.validators?.map(e => ValidatorUpdate.fromAmino(e)) || []; + if (object.app_hash !== undefined && object.app_hash !== null) { + message.appHash = bytesFromBase64(object.app_hash); + } return message; }, - toAmino(message: ResponseBeginBlock): ResponseBeginBlockAmino { - const obj: any = {}; - if (message.events) { - obj.events = message.events.map(e => e ? Event.toAmino(e) : undefined); + toAmino(message: ResponseInitChain): ResponseInitChainAmino { + const obj: any = {}; + obj.consensus_params = message.consensusParams ? ConsensusParams.toAmino(message.consensusParams) : undefined; + if (message.validators) { + obj.validators = message.validators.map(e => e ? ValidatorUpdate.toAmino(e) : undefined); } else { - obj.events = message.events; + obj.validators = message.validators; } + obj.app_hash = message.appHash ? base64FromBytes(message.appHash) : undefined; return obj; }, - fromAminoMsg(object: ResponseBeginBlockAminoMsg): ResponseBeginBlock { - return ResponseBeginBlock.fromAmino(object.value); + fromAminoMsg(object: ResponseInitChainAminoMsg): ResponseInitChain { + return ResponseInitChain.fromAmino(object.value); }, - fromProtoMsg(message: ResponseBeginBlockProtoMsg): ResponseBeginBlock { - return ResponseBeginBlock.decode(message.value); + fromProtoMsg(message: ResponseInitChainProtoMsg): ResponseInitChain { + return ResponseInitChain.decode(message.value); }, - toProto(message: ResponseBeginBlock): Uint8Array { - return ResponseBeginBlock.encode(message).finish(); + toProto(message: ResponseInitChain): Uint8Array { + return ResponseInitChain.encode(message).finish(); }, - toProtoMsg(message: ResponseBeginBlock): ResponseBeginBlockProtoMsg { + toProtoMsg(message: ResponseInitChain): ResponseInitChainProtoMsg { return { - typeUrl: "/tendermint.abci.ResponseBeginBlock", - value: ResponseBeginBlock.encode(message).finish() + typeUrl: "/tendermint.abci.ResponseInitChain", + value: ResponseInitChain.encode(message).finish() }; } }; -function createBaseResponseCheckTx(): ResponseCheckTx { +function createBaseResponseQuery(): ResponseQuery { return { code: 0, - data: new Uint8Array(), log: "", info: "", - gasWanted: BigInt(0), - gasUsed: BigInt(0), - events: [], - codespace: "", - sender: "", - priority: BigInt(0), - mempoolError: "" + index: BigInt(0), + key: new Uint8Array(), + value: new Uint8Array(), + proofOps: undefined, + height: BigInt(0), + codespace: "" }; } -export const ResponseCheckTx = { - typeUrl: "/tendermint.abci.ResponseCheckTx", - encode(message: ResponseCheckTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const ResponseQuery = { + typeUrl: "/tendermint.abci.ResponseQuery", + encode(message: ResponseQuery, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.code !== 0) { writer.uint32(8).uint32(message.code); } - if (message.data.length !== 0) { - writer.uint32(18).bytes(message.data); - } if (message.log !== "") { writer.uint32(26).string(message.log); } if (message.info !== "") { writer.uint32(34).string(message.info); } - if (message.gasWanted !== BigInt(0)) { - writer.uint32(40).int64(message.gasWanted); - } - if (message.gasUsed !== BigInt(0)) { - writer.uint32(48).int64(message.gasUsed); + if (message.index !== BigInt(0)) { + writer.uint32(40).int64(message.index); } - for (const v of message.events) { - Event.encode(v!, writer.uint32(58).fork()).ldelim(); + if (message.key.length !== 0) { + writer.uint32(50).bytes(message.key); } - if (message.codespace !== "") { - writer.uint32(66).string(message.codespace); + if (message.value.length !== 0) { + writer.uint32(58).bytes(message.value); } - if (message.sender !== "") { - writer.uint32(74).string(message.sender); + if (message.proofOps !== undefined) { + ProofOps.encode(message.proofOps, writer.uint32(66).fork()).ldelim(); } - if (message.priority !== BigInt(0)) { - writer.uint32(80).int64(message.priority); + if (message.height !== BigInt(0)) { + writer.uint32(72).int64(message.height); } - if (message.mempoolError !== "") { - writer.uint32(90).string(message.mempoolError); + if (message.codespace !== "") { + writer.uint32(82).string(message.codespace); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ResponseCheckTx { + decode(input: BinaryReader | Uint8Array, length?: number): ResponseQuery { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponseCheckTx(); + const message = createBaseResponseQuery(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.code = reader.uint32(); break; - case 2: - message.data = reader.bytes(); - break; case 3: message.log = reader.string(); break; @@ -3786,25 +4176,22 @@ export const ResponseCheckTx = { message.info = reader.string(); break; case 5: - message.gasWanted = reader.int64(); + message.index = reader.int64(); break; case 6: - message.gasUsed = reader.int64(); + message.key = reader.bytes(); break; case 7: - message.events.push(Event.decode(reader, reader.uint32())); + message.value = reader.bytes(); break; case 8: - message.codespace = reader.string(); + message.proofOps = ProofOps.decode(reader, reader.uint32()); break; case 9: - message.sender = reader.string(); + message.height = reader.int64(); break; case 10: - message.priority = reader.int64(); - break; - case 11: - message.mempoolError = reader.string(); + message.codespace = reader.string(); break; default: reader.skipType(tag & 7); @@ -3813,92 +4200,80 @@ export const ResponseCheckTx = { } return message; }, - fromPartial(object: Partial): ResponseCheckTx { - const message = createBaseResponseCheckTx(); + fromPartial(object: Partial): ResponseQuery { + const message = createBaseResponseQuery(); message.code = object.code ?? 0; - message.data = object.data ?? new Uint8Array(); message.log = object.log ?? ""; message.info = object.info ?? ""; - message.gasWanted = object.gasWanted !== undefined && object.gasWanted !== null ? BigInt(object.gasWanted.toString()) : BigInt(0); - message.gasUsed = object.gasUsed !== undefined && object.gasUsed !== null ? BigInt(object.gasUsed.toString()) : BigInt(0); - message.events = object.events?.map(e => Event.fromPartial(e)) || []; + message.index = object.index !== undefined && object.index !== null ? BigInt(object.index.toString()) : BigInt(0); + message.key = object.key ?? new Uint8Array(); + message.value = object.value ?? new Uint8Array(); + message.proofOps = object.proofOps !== undefined && object.proofOps !== null ? ProofOps.fromPartial(object.proofOps) : undefined; + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); message.codespace = object.codespace ?? ""; - message.sender = object.sender ?? ""; - message.priority = object.priority !== undefined && object.priority !== null ? BigInt(object.priority.toString()) : BigInt(0); - message.mempoolError = object.mempoolError ?? ""; return message; }, - fromAmino(object: ResponseCheckTxAmino): ResponseCheckTx { - const message = createBaseResponseCheckTx(); + fromAmino(object: ResponseQueryAmino): ResponseQuery { + const message = createBaseResponseQuery(); if (object.code !== undefined && object.code !== null) { message.code = object.code; } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } if (object.log !== undefined && object.log !== null) { message.log = object.log; } if (object.info !== undefined && object.info !== null) { message.info = object.info; } - if (object.gas_wanted !== undefined && object.gas_wanted !== null) { - message.gasWanted = BigInt(object.gas_wanted); + if (object.index !== undefined && object.index !== null) { + message.index = BigInt(object.index); } - if (object.gas_used !== undefined && object.gas_used !== null) { - message.gasUsed = BigInt(object.gas_used); + if (object.key !== undefined && object.key !== null) { + message.key = bytesFromBase64(object.key); } - message.events = object.events?.map(e => Event.fromAmino(e)) || []; - if (object.codespace !== undefined && object.codespace !== null) { - message.codespace = object.codespace; + if (object.value !== undefined && object.value !== null) { + message.value = bytesFromBase64(object.value); } - if (object.sender !== undefined && object.sender !== null) { - message.sender = object.sender; + if (object.proof_ops !== undefined && object.proof_ops !== null) { + message.proofOps = ProofOps.fromAmino(object.proof_ops); } - if (object.priority !== undefined && object.priority !== null) { - message.priority = BigInt(object.priority); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); } - if (object.mempool_error !== undefined && object.mempool_error !== null) { - message.mempoolError = object.mempool_error; + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = object.codespace; } return message; }, - toAmino(message: ResponseCheckTx): ResponseCheckTxAmino { + toAmino(message: ResponseQuery): ResponseQueryAmino { const obj: any = {}; obj.code = message.code === 0 ? undefined : message.code; - obj.data = message.data ? base64FromBytes(message.data) : undefined; obj.log = message.log === "" ? undefined : message.log; obj.info = message.info === "" ? undefined : message.info; - obj.gas_wanted = message.gasWanted !== BigInt(0) ? message.gasWanted.toString() : undefined; - obj.gas_used = message.gasUsed !== BigInt(0) ? message.gasUsed.toString() : undefined; - if (message.events) { - obj.events = message.events.map(e => e ? Event.toAmino(e) : undefined); - } else { - obj.events = message.events; - } + obj.index = message.index !== BigInt(0) ? message.index.toString() : undefined; + obj.key = message.key ? base64FromBytes(message.key) : undefined; + obj.value = message.value ? base64FromBytes(message.value) : undefined; + obj.proof_ops = message.proofOps ? ProofOps.toAmino(message.proofOps) : undefined; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; obj.codespace = message.codespace === "" ? undefined : message.codespace; - obj.sender = message.sender === "" ? undefined : message.sender; - obj.priority = message.priority !== BigInt(0) ? message.priority.toString() : undefined; - obj.mempool_error = message.mempoolError === "" ? undefined : message.mempoolError; return obj; }, - fromAminoMsg(object: ResponseCheckTxAminoMsg): ResponseCheckTx { - return ResponseCheckTx.fromAmino(object.value); + fromAminoMsg(object: ResponseQueryAminoMsg): ResponseQuery { + return ResponseQuery.fromAmino(object.value); }, - fromProtoMsg(message: ResponseCheckTxProtoMsg): ResponseCheckTx { - return ResponseCheckTx.decode(message.value); + fromProtoMsg(message: ResponseQueryProtoMsg): ResponseQuery { + return ResponseQuery.decode(message.value); }, - toProto(message: ResponseCheckTx): Uint8Array { - return ResponseCheckTx.encode(message).finish(); + toProto(message: ResponseQuery): Uint8Array { + return ResponseQuery.encode(message).finish(); }, - toProtoMsg(message: ResponseCheckTx): ResponseCheckTxProtoMsg { + toProtoMsg(message: ResponseQuery): ResponseQueryProtoMsg { return { - typeUrl: "/tendermint.abci.ResponseCheckTx", - value: ResponseCheckTx.encode(message).finish() + typeUrl: "/tendermint.abci.ResponseQuery", + value: ResponseQuery.encode(message).finish() }; } }; -function createBaseResponseDeliverTx(): ResponseDeliverTx { +function createBaseResponseCheckTx(): ResponseCheckTx { return { code: 0, data: new Uint8Array(), @@ -3910,9 +4285,9 @@ function createBaseResponseDeliverTx(): ResponseDeliverTx { codespace: "" }; } -export const ResponseDeliverTx = { - typeUrl: "/tendermint.abci.ResponseDeliverTx", - encode(message: ResponseDeliverTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const ResponseCheckTx = { + typeUrl: "/tendermint.abci.ResponseCheckTx", + encode(message: ResponseCheckTx, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.code !== 0) { writer.uint32(8).uint32(message.code); } @@ -3939,10 +4314,10 @@ export const ResponseDeliverTx = { } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ResponseDeliverTx { + decode(input: BinaryReader | Uint8Array, length?: number): ResponseCheckTx { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponseDeliverTx(); + const message = createBaseResponseCheckTx(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3958,132 +4333,18 @@ export const ResponseDeliverTx = { case 4: message.info = reader.string(); break; - case 5: - message.gasWanted = reader.int64(); - break; - case 6: - message.gasUsed = reader.int64(); - break; - case 7: - message.events.push(Event.decode(reader, reader.uint32())); - break; - case 8: - message.codespace = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - fromPartial(object: Partial): ResponseDeliverTx { - const message = createBaseResponseDeliverTx(); - message.code = object.code ?? 0; - message.data = object.data ?? new Uint8Array(); - message.log = object.log ?? ""; - message.info = object.info ?? ""; - message.gasWanted = object.gasWanted !== undefined && object.gasWanted !== null ? BigInt(object.gasWanted.toString()) : BigInt(0); - message.gasUsed = object.gasUsed !== undefined && object.gasUsed !== null ? BigInt(object.gasUsed.toString()) : BigInt(0); - message.events = object.events?.map(e => Event.fromPartial(e)) || []; - message.codespace = object.codespace ?? ""; - return message; - }, - fromAmino(object: ResponseDeliverTxAmino): ResponseDeliverTx { - const message = createBaseResponseDeliverTx(); - if (object.code !== undefined && object.code !== null) { - message.code = object.code; - } - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } - if (object.log !== undefined && object.log !== null) { - message.log = object.log; - } - if (object.info !== undefined && object.info !== null) { - message.info = object.info; - } - if (object.gas_wanted !== undefined && object.gas_wanted !== null) { - message.gasWanted = BigInt(object.gas_wanted); - } - if (object.gas_used !== undefined && object.gas_used !== null) { - message.gasUsed = BigInt(object.gas_used); - } - message.events = object.events?.map(e => Event.fromAmino(e)) || []; - if (object.codespace !== undefined && object.codespace !== null) { - message.codespace = object.codespace; - } - return message; - }, - toAmino(message: ResponseDeliverTx): ResponseDeliverTxAmino { - const obj: any = {}; - obj.code = message.code === 0 ? undefined : message.code; - obj.data = message.data ? base64FromBytes(message.data) : undefined; - obj.log = message.log === "" ? undefined : message.log; - obj.info = message.info === "" ? undefined : message.info; - obj.gas_wanted = message.gasWanted !== BigInt(0) ? message.gasWanted.toString() : undefined; - obj.gas_used = message.gasUsed !== BigInt(0) ? message.gasUsed.toString() : undefined; - if (message.events) { - obj.events = message.events.map(e => e ? Event.toAmino(e) : undefined); - } else { - obj.events = message.events; - } - obj.codespace = message.codespace === "" ? undefined : message.codespace; - return obj; - }, - fromAminoMsg(object: ResponseDeliverTxAminoMsg): ResponseDeliverTx { - return ResponseDeliverTx.fromAmino(object.value); - }, - fromProtoMsg(message: ResponseDeliverTxProtoMsg): ResponseDeliverTx { - return ResponseDeliverTx.decode(message.value); - }, - toProto(message: ResponseDeliverTx): Uint8Array { - return ResponseDeliverTx.encode(message).finish(); - }, - toProtoMsg(message: ResponseDeliverTx): ResponseDeliverTxProtoMsg { - return { - typeUrl: "/tendermint.abci.ResponseDeliverTx", - value: ResponseDeliverTx.encode(message).finish() - }; - } -}; -function createBaseResponseEndBlock(): ResponseEndBlock { - return { - validatorUpdates: [], - consensusParamUpdates: undefined, - events: [] - }; -} -export const ResponseEndBlock = { - typeUrl: "/tendermint.abci.ResponseEndBlock", - encode(message: ResponseEndBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - for (const v of message.validatorUpdates) { - ValidatorUpdate.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.consensusParamUpdates !== undefined) { - ConsensusParams.encode(message.consensusParamUpdates, writer.uint32(18).fork()).ldelim(); - } - for (const v of message.events) { - Event.encode(v!, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - decode(input: BinaryReader | Uint8Array, length?: number): ResponseEndBlock { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResponseEndBlock(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.validatorUpdates.push(ValidatorUpdate.decode(reader, reader.uint32())); + case 5: + message.gasWanted = reader.int64(); break; - case 2: - message.consensusParamUpdates = ConsensusParams.decode(reader, reader.uint32()); + case 6: + message.gasUsed = reader.int64(); break; - case 3: + case 7: message.events.push(Event.decode(reader, reader.uint32())); break; + case 8: + message.codespace = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -4091,65 +4352,84 @@ export const ResponseEndBlock = { } return message; }, - fromPartial(object: Partial): ResponseEndBlock { - const message = createBaseResponseEndBlock(); - message.validatorUpdates = object.validatorUpdates?.map(e => ValidatorUpdate.fromPartial(e)) || []; - message.consensusParamUpdates = object.consensusParamUpdates !== undefined && object.consensusParamUpdates !== null ? ConsensusParams.fromPartial(object.consensusParamUpdates) : undefined; + fromPartial(object: Partial): ResponseCheckTx { + const message = createBaseResponseCheckTx(); + message.code = object.code ?? 0; + message.data = object.data ?? new Uint8Array(); + message.log = object.log ?? ""; + message.info = object.info ?? ""; + message.gasWanted = object.gasWanted !== undefined && object.gasWanted !== null ? BigInt(object.gasWanted.toString()) : BigInt(0); + message.gasUsed = object.gasUsed !== undefined && object.gasUsed !== null ? BigInt(object.gasUsed.toString()) : BigInt(0); message.events = object.events?.map(e => Event.fromPartial(e)) || []; + message.codespace = object.codespace ?? ""; return message; }, - fromAmino(object: ResponseEndBlockAmino): ResponseEndBlock { - const message = createBaseResponseEndBlock(); - message.validatorUpdates = object.validator_updates?.map(e => ValidatorUpdate.fromAmino(e)) || []; - if (object.consensus_param_updates !== undefined && object.consensus_param_updates !== null) { - message.consensusParamUpdates = ConsensusParams.fromAmino(object.consensus_param_updates); + fromAmino(object: ResponseCheckTxAmino): ResponseCheckTx { + const message = createBaseResponseCheckTx(); + if (object.code !== undefined && object.code !== null) { + message.code = object.code; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } + if (object.gas_wanted !== undefined && object.gas_wanted !== null) { + message.gasWanted = BigInt(object.gas_wanted); + } + if (object.gas_used !== undefined && object.gas_used !== null) { + message.gasUsed = BigInt(object.gas_used); } message.events = object.events?.map(e => Event.fromAmino(e)) || []; + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = object.codespace; + } return message; }, - toAmino(message: ResponseEndBlock): ResponseEndBlockAmino { + toAmino(message: ResponseCheckTx): ResponseCheckTxAmino { const obj: any = {}; - if (message.validatorUpdates) { - obj.validator_updates = message.validatorUpdates.map(e => e ? ValidatorUpdate.toAmino(e) : undefined); - } else { - obj.validator_updates = message.validatorUpdates; - } - obj.consensus_param_updates = message.consensusParamUpdates ? ConsensusParams.toAmino(message.consensusParamUpdates) : undefined; + obj.code = message.code === 0 ? undefined : message.code; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + obj.log = message.log === "" ? undefined : message.log; + obj.info = message.info === "" ? undefined : message.info; + obj.gas_wanted = message.gasWanted !== BigInt(0) ? message.gasWanted.toString() : undefined; + obj.gas_used = message.gasUsed !== BigInt(0) ? message.gasUsed.toString() : undefined; if (message.events) { obj.events = message.events.map(e => e ? Event.toAmino(e) : undefined); } else { obj.events = message.events; } + obj.codespace = message.codespace === "" ? undefined : message.codespace; return obj; }, - fromAminoMsg(object: ResponseEndBlockAminoMsg): ResponseEndBlock { - return ResponseEndBlock.fromAmino(object.value); + fromAminoMsg(object: ResponseCheckTxAminoMsg): ResponseCheckTx { + return ResponseCheckTx.fromAmino(object.value); }, - fromProtoMsg(message: ResponseEndBlockProtoMsg): ResponseEndBlock { - return ResponseEndBlock.decode(message.value); + fromProtoMsg(message: ResponseCheckTxProtoMsg): ResponseCheckTx { + return ResponseCheckTx.decode(message.value); }, - toProto(message: ResponseEndBlock): Uint8Array { - return ResponseEndBlock.encode(message).finish(); + toProto(message: ResponseCheckTx): Uint8Array { + return ResponseCheckTx.encode(message).finish(); }, - toProtoMsg(message: ResponseEndBlock): ResponseEndBlockProtoMsg { + toProtoMsg(message: ResponseCheckTx): ResponseCheckTxProtoMsg { return { - typeUrl: "/tendermint.abci.ResponseEndBlock", - value: ResponseEndBlock.encode(message).finish() + typeUrl: "/tendermint.abci.ResponseCheckTx", + value: ResponseCheckTx.encode(message).finish() }; } }; function createBaseResponseCommit(): ResponseCommit { return { - data: new Uint8Array(), retainHeight: BigInt(0) }; } export const ResponseCommit = { typeUrl: "/tendermint.abci.ResponseCommit", encode(message: ResponseCommit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.data.length !== 0) { - writer.uint32(18).bytes(message.data); - } if (message.retainHeight !== BigInt(0)) { writer.uint32(24).int64(message.retainHeight); } @@ -4162,9 +4442,6 @@ export const ResponseCommit = { while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 2: - message.data = reader.bytes(); - break; case 3: message.retainHeight = reader.int64(); break; @@ -4177,15 +4454,11 @@ export const ResponseCommit = { }, fromPartial(object: Partial): ResponseCommit { const message = createBaseResponseCommit(); - message.data = object.data ?? new Uint8Array(); message.retainHeight = object.retainHeight !== undefined && object.retainHeight !== null ? BigInt(object.retainHeight.toString()) : BigInt(0); return message; }, fromAmino(object: ResponseCommitAmino): ResponseCommit { const message = createBaseResponseCommit(); - if (object.data !== undefined && object.data !== null) { - message.data = bytesFromBase64(object.data); - } if (object.retain_height !== undefined && object.retain_height !== null) { message.retainHeight = BigInt(object.retain_height); } @@ -4193,7 +4466,6 @@ export const ResponseCommit = { }, toAmino(message: ResponseCommit): ResponseCommitAmino { const obj: any = {}; - obj.data = message.data ? base64FromBytes(message.data) : undefined; obj.retain_height = message.retainHeight !== BigInt(0) ? message.retainHeight.toString() : undefined; return obj; }, @@ -4504,49 +4776,310 @@ export const ResponseApplySnapshotChunk = { }; } }; -function createBaseConsensusParams(): ConsensusParams { +function createBaseResponsePrepareProposal(): ResponsePrepareProposal { return { - block: undefined, - evidence: undefined, - validator: undefined, - version: undefined + txs: [] }; } -export const ConsensusParams = { - typeUrl: "/tendermint.abci.ConsensusParams", - encode(message: ConsensusParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.block !== undefined) { - BlockParams.encode(message.block, writer.uint32(10).fork()).ldelim(); +export const ResponsePrepareProposal = { + typeUrl: "/tendermint.abci.ResponsePrepareProposal", + encode(message: ResponsePrepareProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.txs) { + writer.uint32(10).bytes(v!); } - if (message.evidence !== undefined) { - EvidenceParams.encode(message.evidence, writer.uint32(18).fork()).ldelim(); + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponsePrepareProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponsePrepareProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txs.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } } - if (message.validator !== undefined) { - ValidatorParams.encode(message.validator, writer.uint32(26).fork()).ldelim(); + return message; + }, + fromPartial(object: Partial): ResponsePrepareProposal { + const message = createBaseResponsePrepareProposal(); + message.txs = object.txs?.map(e => e) || []; + return message; + }, + fromAmino(object: ResponsePrepareProposalAmino): ResponsePrepareProposal { + const message = createBaseResponsePrepareProposal(); + message.txs = object.txs?.map(e => bytesFromBase64(e)) || []; + return message; + }, + toAmino(message: ResponsePrepareProposal): ResponsePrepareProposalAmino { + const obj: any = {}; + if (message.txs) { + obj.txs = message.txs.map(e => base64FromBytes(e)); + } else { + obj.txs = message.txs; + } + return obj; + }, + fromAminoMsg(object: ResponsePrepareProposalAminoMsg): ResponsePrepareProposal { + return ResponsePrepareProposal.fromAmino(object.value); + }, + fromProtoMsg(message: ResponsePrepareProposalProtoMsg): ResponsePrepareProposal { + return ResponsePrepareProposal.decode(message.value); + }, + toProto(message: ResponsePrepareProposal): Uint8Array { + return ResponsePrepareProposal.encode(message).finish(); + }, + toProtoMsg(message: ResponsePrepareProposal): ResponsePrepareProposalProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponsePrepareProposal", + value: ResponsePrepareProposal.encode(message).finish() + }; + } +}; +function createBaseResponseProcessProposal(): ResponseProcessProposal { + return { + status: 0 + }; +} +export const ResponseProcessProposal = { + typeUrl: "/tendermint.abci.ResponseProcessProposal", + encode(message: ResponseProcessProposal, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.status !== 0) { + writer.uint32(8).int32(message.status); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseProcessProposal { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseProcessProposal(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.status = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ResponseProcessProposal { + const message = createBaseResponseProcessProposal(); + message.status = object.status ?? 0; + return message; + }, + fromAmino(object: ResponseProcessProposalAmino): ResponseProcessProposal { + const message = createBaseResponseProcessProposal(); + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + return message; + }, + toAmino(message: ResponseProcessProposal): ResponseProcessProposalAmino { + const obj: any = {}; + obj.status = message.status === 0 ? undefined : message.status; + return obj; + }, + fromAminoMsg(object: ResponseProcessProposalAminoMsg): ResponseProcessProposal { + return ResponseProcessProposal.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseProcessProposalProtoMsg): ResponseProcessProposal { + return ResponseProcessProposal.decode(message.value); + }, + toProto(message: ResponseProcessProposal): Uint8Array { + return ResponseProcessProposal.encode(message).finish(); + }, + toProtoMsg(message: ResponseProcessProposal): ResponseProcessProposalProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseProcessProposal", + value: ResponseProcessProposal.encode(message).finish() + }; + } +}; +function createBaseResponseExtendVote(): ResponseExtendVote { + return { + voteExtension: new Uint8Array() + }; +} +export const ResponseExtendVote = { + typeUrl: "/tendermint.abci.ResponseExtendVote", + encode(message: ResponseExtendVote, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.voteExtension.length !== 0) { + writer.uint32(10).bytes(message.voteExtension); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseExtendVote { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseExtendVote(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.voteExtension = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ResponseExtendVote { + const message = createBaseResponseExtendVote(); + message.voteExtension = object.voteExtension ?? new Uint8Array(); + return message; + }, + fromAmino(object: ResponseExtendVoteAmino): ResponseExtendVote { + const message = createBaseResponseExtendVote(); + if (object.vote_extension !== undefined && object.vote_extension !== null) { + message.voteExtension = bytesFromBase64(object.vote_extension); + } + return message; + }, + toAmino(message: ResponseExtendVote): ResponseExtendVoteAmino { + const obj: any = {}; + obj.vote_extension = message.voteExtension ? base64FromBytes(message.voteExtension) : undefined; + return obj; + }, + fromAminoMsg(object: ResponseExtendVoteAminoMsg): ResponseExtendVote { + return ResponseExtendVote.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseExtendVoteProtoMsg): ResponseExtendVote { + return ResponseExtendVote.decode(message.value); + }, + toProto(message: ResponseExtendVote): Uint8Array { + return ResponseExtendVote.encode(message).finish(); + }, + toProtoMsg(message: ResponseExtendVote): ResponseExtendVoteProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseExtendVote", + value: ResponseExtendVote.encode(message).finish() + }; + } +}; +function createBaseResponseVerifyVoteExtension(): ResponseVerifyVoteExtension { + return { + status: 0 + }; +} +export const ResponseVerifyVoteExtension = { + typeUrl: "/tendermint.abci.ResponseVerifyVoteExtension", + encode(message: ResponseVerifyVoteExtension, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.status !== 0) { + writer.uint32(8).int32(message.status); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ResponseVerifyVoteExtension { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponseVerifyVoteExtension(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.status = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ResponseVerifyVoteExtension { + const message = createBaseResponseVerifyVoteExtension(); + message.status = object.status ?? 0; + return message; + }, + fromAmino(object: ResponseVerifyVoteExtensionAmino): ResponseVerifyVoteExtension { + const message = createBaseResponseVerifyVoteExtension(); + if (object.status !== undefined && object.status !== null) { + message.status = object.status; + } + return message; + }, + toAmino(message: ResponseVerifyVoteExtension): ResponseVerifyVoteExtensionAmino { + const obj: any = {}; + obj.status = message.status === 0 ? undefined : message.status; + return obj; + }, + fromAminoMsg(object: ResponseVerifyVoteExtensionAminoMsg): ResponseVerifyVoteExtension { + return ResponseVerifyVoteExtension.fromAmino(object.value); + }, + fromProtoMsg(message: ResponseVerifyVoteExtensionProtoMsg): ResponseVerifyVoteExtension { + return ResponseVerifyVoteExtension.decode(message.value); + }, + toProto(message: ResponseVerifyVoteExtension): Uint8Array { + return ResponseVerifyVoteExtension.encode(message).finish(); + }, + toProtoMsg(message: ResponseVerifyVoteExtension): ResponseVerifyVoteExtensionProtoMsg { + return { + typeUrl: "/tendermint.abci.ResponseVerifyVoteExtension", + value: ResponseVerifyVoteExtension.encode(message).finish() + }; + } +}; +function createBaseResponseFinalizeBlock(): ResponseFinalizeBlock { + return { + events: [], + txResults: [], + validatorUpdates: [], + consensusParamUpdates: undefined, + appHash: new Uint8Array() + }; +} +export const ResponseFinalizeBlock = { + typeUrl: "/tendermint.abci.ResponseFinalizeBlock", + encode(message: ResponseFinalizeBlock, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + for (const v of message.events) { + Event.encode(v!, writer.uint32(10).fork()).ldelim(); + } + for (const v of message.txResults) { + ExecTxResult.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.validatorUpdates) { + ValidatorUpdate.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.consensusParamUpdates !== undefined) { + ConsensusParams.encode(message.consensusParamUpdates, writer.uint32(34).fork()).ldelim(); } - if (message.version !== undefined) { - VersionParams.encode(message.version, writer.uint32(34).fork()).ldelim(); + if (message.appHash.length !== 0) { + writer.uint32(42).bytes(message.appHash); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ConsensusParams { + decode(input: BinaryReader | Uint8Array, length?: number): ResponseFinalizeBlock { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseConsensusParams(); + const message = createBaseResponseFinalizeBlock(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.block = BlockParams.decode(reader, reader.uint32()); + message.events.push(Event.decode(reader, reader.uint32())); break; case 2: - message.evidence = EvidenceParams.decode(reader, reader.uint32()); + message.txResults.push(ExecTxResult.decode(reader, reader.uint32())); break; case 3: - message.validator = ValidatorParams.decode(reader, reader.uint32()); + message.validatorUpdates.push(ValidatorUpdate.decode(reader, reader.uint32())); break; case 4: - message.version = VersionParams.decode(reader, reader.uint32()); + message.consensusParamUpdates = ConsensusParams.decode(reader, reader.uint32()); + break; + case 5: + message.appHash = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -4555,83 +5088,94 @@ export const ConsensusParams = { } return message; }, - fromPartial(object: Partial): ConsensusParams { - const message = createBaseConsensusParams(); - message.block = object.block !== undefined && object.block !== null ? BlockParams.fromPartial(object.block) : undefined; - message.evidence = object.evidence !== undefined && object.evidence !== null ? EvidenceParams.fromPartial(object.evidence) : undefined; - message.validator = object.validator !== undefined && object.validator !== null ? ValidatorParams.fromPartial(object.validator) : undefined; - message.version = object.version !== undefined && object.version !== null ? VersionParams.fromPartial(object.version) : undefined; - return message; - }, - fromAmino(object: ConsensusParamsAmino): ConsensusParams { - const message = createBaseConsensusParams(); - if (object.block !== undefined && object.block !== null) { - message.block = BlockParams.fromAmino(object.block); - } - if (object.evidence !== undefined && object.evidence !== null) { - message.evidence = EvidenceParams.fromAmino(object.evidence); + fromPartial(object: Partial): ResponseFinalizeBlock { + const message = createBaseResponseFinalizeBlock(); + message.events = object.events?.map(e => Event.fromPartial(e)) || []; + message.txResults = object.txResults?.map(e => ExecTxResult.fromPartial(e)) || []; + message.validatorUpdates = object.validatorUpdates?.map(e => ValidatorUpdate.fromPartial(e)) || []; + message.consensusParamUpdates = object.consensusParamUpdates !== undefined && object.consensusParamUpdates !== null ? ConsensusParams.fromPartial(object.consensusParamUpdates) : undefined; + message.appHash = object.appHash ?? new Uint8Array(); + return message; + }, + fromAmino(object: ResponseFinalizeBlockAmino): ResponseFinalizeBlock { + const message = createBaseResponseFinalizeBlock(); + message.events = object.events?.map(e => Event.fromAmino(e)) || []; + message.txResults = object.tx_results?.map(e => ExecTxResult.fromAmino(e)) || []; + message.validatorUpdates = object.validator_updates?.map(e => ValidatorUpdate.fromAmino(e)) || []; + if (object.consensus_param_updates !== undefined && object.consensus_param_updates !== null) { + message.consensusParamUpdates = ConsensusParams.fromAmino(object.consensus_param_updates); + } + if (object.app_hash !== undefined && object.app_hash !== null) { + message.appHash = bytesFromBase64(object.app_hash); + } + return message; + }, + toAmino(message: ResponseFinalizeBlock): ResponseFinalizeBlockAmino { + const obj: any = {}; + if (message.events) { + obj.events = message.events.map(e => e ? Event.toAmino(e) : undefined); + } else { + obj.events = message.events; } - if (object.validator !== undefined && object.validator !== null) { - message.validator = ValidatorParams.fromAmino(object.validator); + if (message.txResults) { + obj.tx_results = message.txResults.map(e => e ? ExecTxResult.toAmino(e) : undefined); + } else { + obj.tx_results = message.txResults; } - if (object.version !== undefined && object.version !== null) { - message.version = VersionParams.fromAmino(object.version); + if (message.validatorUpdates) { + obj.validator_updates = message.validatorUpdates.map(e => e ? ValidatorUpdate.toAmino(e) : undefined); + } else { + obj.validator_updates = message.validatorUpdates; } - return message; - }, - toAmino(message: ConsensusParams): ConsensusParamsAmino { - const obj: any = {}; - obj.block = message.block ? BlockParams.toAmino(message.block) : undefined; - obj.evidence = message.evidence ? EvidenceParams.toAmino(message.evidence) : undefined; - obj.validator = message.validator ? ValidatorParams.toAmino(message.validator) : undefined; - obj.version = message.version ? VersionParams.toAmino(message.version) : undefined; + obj.consensus_param_updates = message.consensusParamUpdates ? ConsensusParams.toAmino(message.consensusParamUpdates) : undefined; + obj.app_hash = message.appHash ? base64FromBytes(message.appHash) : undefined; return obj; }, - fromAminoMsg(object: ConsensusParamsAminoMsg): ConsensusParams { - return ConsensusParams.fromAmino(object.value); + fromAminoMsg(object: ResponseFinalizeBlockAminoMsg): ResponseFinalizeBlock { + return ResponseFinalizeBlock.fromAmino(object.value); }, - fromProtoMsg(message: ConsensusParamsProtoMsg): ConsensusParams { - return ConsensusParams.decode(message.value); + fromProtoMsg(message: ResponseFinalizeBlockProtoMsg): ResponseFinalizeBlock { + return ResponseFinalizeBlock.decode(message.value); }, - toProto(message: ConsensusParams): Uint8Array { - return ConsensusParams.encode(message).finish(); + toProto(message: ResponseFinalizeBlock): Uint8Array { + return ResponseFinalizeBlock.encode(message).finish(); }, - toProtoMsg(message: ConsensusParams): ConsensusParamsProtoMsg { + toProtoMsg(message: ResponseFinalizeBlock): ResponseFinalizeBlockProtoMsg { return { - typeUrl: "/tendermint.abci.ConsensusParams", - value: ConsensusParams.encode(message).finish() + typeUrl: "/tendermint.abci.ResponseFinalizeBlock", + value: ResponseFinalizeBlock.encode(message).finish() }; } }; -function createBaseBlockParams(): BlockParams { +function createBaseCommitInfo(): CommitInfo { return { - maxBytes: BigInt(0), - maxGas: BigInt(0) + round: 0, + votes: [] }; } -export const BlockParams = { - typeUrl: "/tendermint.abci.BlockParams", - encode(message: BlockParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.maxBytes !== BigInt(0)) { - writer.uint32(8).int64(message.maxBytes); +export const CommitInfo = { + typeUrl: "/tendermint.abci.CommitInfo", + encode(message: CommitInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.round !== 0) { + writer.uint32(8).int32(message.round); } - if (message.maxGas !== BigInt(0)) { - writer.uint32(16).int64(message.maxGas); + for (const v of message.votes) { + VoteInfo.encode(v!, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): BlockParams { + decode(input: BinaryReader | Uint8Array, length?: number): CommitInfo { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBlockParams(); + const message = createBaseCommitInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.maxBytes = reader.int64(); + message.round = reader.int32(); break; case 2: - message.maxGas = reader.int64(); + message.votes.push(VoteInfo.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4640,65 +5184,67 @@ export const BlockParams = { } return message; }, - fromPartial(object: Partial): BlockParams { - const message = createBaseBlockParams(); - message.maxBytes = object.maxBytes !== undefined && object.maxBytes !== null ? BigInt(object.maxBytes.toString()) : BigInt(0); - message.maxGas = object.maxGas !== undefined && object.maxGas !== null ? BigInt(object.maxGas.toString()) : BigInt(0); + fromPartial(object: Partial): CommitInfo { + const message = createBaseCommitInfo(); + message.round = object.round ?? 0; + message.votes = object.votes?.map(e => VoteInfo.fromPartial(e)) || []; return message; }, - fromAmino(object: BlockParamsAmino): BlockParams { - const message = createBaseBlockParams(); - if (object.max_bytes !== undefined && object.max_bytes !== null) { - message.maxBytes = BigInt(object.max_bytes); - } - if (object.max_gas !== undefined && object.max_gas !== null) { - message.maxGas = BigInt(object.max_gas); + fromAmino(object: CommitInfoAmino): CommitInfo { + const message = createBaseCommitInfo(); + if (object.round !== undefined && object.round !== null) { + message.round = object.round; } + message.votes = object.votes?.map(e => VoteInfo.fromAmino(e)) || []; return message; }, - toAmino(message: BlockParams): BlockParamsAmino { + toAmino(message: CommitInfo): CommitInfoAmino { const obj: any = {}; - obj.max_bytes = message.maxBytes !== BigInt(0) ? message.maxBytes.toString() : undefined; - obj.max_gas = message.maxGas !== BigInt(0) ? message.maxGas.toString() : undefined; + obj.round = message.round === 0 ? undefined : message.round; + if (message.votes) { + obj.votes = message.votes.map(e => e ? VoteInfo.toAmino(e) : undefined); + } else { + obj.votes = message.votes; + } return obj; }, - fromAminoMsg(object: BlockParamsAminoMsg): BlockParams { - return BlockParams.fromAmino(object.value); + fromAminoMsg(object: CommitInfoAminoMsg): CommitInfo { + return CommitInfo.fromAmino(object.value); }, - fromProtoMsg(message: BlockParamsProtoMsg): BlockParams { - return BlockParams.decode(message.value); + fromProtoMsg(message: CommitInfoProtoMsg): CommitInfo { + return CommitInfo.decode(message.value); }, - toProto(message: BlockParams): Uint8Array { - return BlockParams.encode(message).finish(); + toProto(message: CommitInfo): Uint8Array { + return CommitInfo.encode(message).finish(); }, - toProtoMsg(message: BlockParams): BlockParamsProtoMsg { + toProtoMsg(message: CommitInfo): CommitInfoProtoMsg { return { - typeUrl: "/tendermint.abci.BlockParams", - value: BlockParams.encode(message).finish() + typeUrl: "/tendermint.abci.CommitInfo", + value: CommitInfo.encode(message).finish() }; } }; -function createBaseLastCommitInfo(): LastCommitInfo { +function createBaseExtendedCommitInfo(): ExtendedCommitInfo { return { round: 0, votes: [] }; } -export const LastCommitInfo = { - typeUrl: "/tendermint.abci.LastCommitInfo", - encode(message: LastCommitInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const ExtendedCommitInfo = { + typeUrl: "/tendermint.abci.ExtendedCommitInfo", + encode(message: ExtendedCommitInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.round !== 0) { writer.uint32(8).int32(message.round); } for (const v of message.votes) { - VoteInfo.encode(v!, writer.uint32(18).fork()).ldelim(); + ExtendedVoteInfo.encode(v!, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): LastCommitInfo { + decode(input: BinaryReader | Uint8Array, length?: number): ExtendedCommitInfo { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLastCommitInfo(); + const message = createBaseExtendedCommitInfo(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4706,7 +5252,7 @@ export const LastCommitInfo = { message.round = reader.int32(); break; case 2: - message.votes.push(VoteInfo.decode(reader, reader.uint32())); + message.votes.push(ExtendedVoteInfo.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4715,43 +5261,43 @@ export const LastCommitInfo = { } return message; }, - fromPartial(object: Partial): LastCommitInfo { - const message = createBaseLastCommitInfo(); + fromPartial(object: Partial): ExtendedCommitInfo { + const message = createBaseExtendedCommitInfo(); message.round = object.round ?? 0; - message.votes = object.votes?.map(e => VoteInfo.fromPartial(e)) || []; + message.votes = object.votes?.map(e => ExtendedVoteInfo.fromPartial(e)) || []; return message; }, - fromAmino(object: LastCommitInfoAmino): LastCommitInfo { - const message = createBaseLastCommitInfo(); + fromAmino(object: ExtendedCommitInfoAmino): ExtendedCommitInfo { + const message = createBaseExtendedCommitInfo(); if (object.round !== undefined && object.round !== null) { message.round = object.round; } - message.votes = object.votes?.map(e => VoteInfo.fromAmino(e)) || []; + message.votes = object.votes?.map(e => ExtendedVoteInfo.fromAmino(e)) || []; return message; }, - toAmino(message: LastCommitInfo): LastCommitInfoAmino { + toAmino(message: ExtendedCommitInfo): ExtendedCommitInfoAmino { const obj: any = {}; obj.round = message.round === 0 ? undefined : message.round; if (message.votes) { - obj.votes = message.votes.map(e => e ? VoteInfo.toAmino(e) : undefined); + obj.votes = message.votes.map(e => e ? ExtendedVoteInfo.toAmino(e) : undefined); } else { obj.votes = message.votes; } return obj; }, - fromAminoMsg(object: LastCommitInfoAminoMsg): LastCommitInfo { - return LastCommitInfo.fromAmino(object.value); + fromAminoMsg(object: ExtendedCommitInfoAminoMsg): ExtendedCommitInfo { + return ExtendedCommitInfo.fromAmino(object.value); }, - fromProtoMsg(message: LastCommitInfoProtoMsg): LastCommitInfo { - return LastCommitInfo.decode(message.value); + fromProtoMsg(message: ExtendedCommitInfoProtoMsg): ExtendedCommitInfo { + return ExtendedCommitInfo.decode(message.value); }, - toProto(message: LastCommitInfo): Uint8Array { - return LastCommitInfo.encode(message).finish(); + toProto(message: ExtendedCommitInfo): Uint8Array { + return ExtendedCommitInfo.encode(message).finish(); }, - toProtoMsg(message: LastCommitInfo): LastCommitInfoProtoMsg { + toProtoMsg(message: ExtendedCommitInfo): ExtendedCommitInfoProtoMsg { return { - typeUrl: "/tendermint.abci.LastCommitInfo", - value: LastCommitInfo.encode(message).finish() + typeUrl: "/tendermint.abci.ExtendedCommitInfo", + value: ExtendedCommitInfo.encode(message).finish() }; } }; @@ -4834,19 +5380,19 @@ export const Event = { }; function createBaseEventAttribute(): EventAttribute { return { - key: new Uint8Array(), - value: new Uint8Array(), + key: "", + value: "", index: false }; } export const EventAttribute = { typeUrl: "/tendermint.abci.EventAttribute", encode(message: EventAttribute, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.key.length !== 0) { - writer.uint32(10).bytes(message.key); + if (message.key !== "") { + writer.uint32(10).string(message.key); } - if (message.value.length !== 0) { - writer.uint32(18).bytes(message.value); + if (message.value !== "") { + writer.uint32(18).string(message.value); } if (message.index === true) { writer.uint32(24).bool(message.index); @@ -4861,10 +5407,10 @@ export const EventAttribute = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.key = reader.bytes(); + message.key = reader.string(); break; case 2: - message.value = reader.bytes(); + message.value = reader.string(); break; case 3: message.index = reader.bool(); @@ -4878,18 +5424,18 @@ export const EventAttribute = { }, fromPartial(object: Partial): EventAttribute { const message = createBaseEventAttribute(); - message.key = object.key ?? new Uint8Array(); - message.value = object.value ?? new Uint8Array(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; message.index = object.index ?? false; return message; }, fromAmino(object: EventAttributeAmino): EventAttribute { const message = createBaseEventAttribute(); if (object.key !== undefined && object.key !== null) { - message.key = bytesFromBase64(object.key); + message.key = object.key; } if (object.value !== undefined && object.value !== null) { - message.value = bytesFromBase64(object.value); + message.value = object.value; } if (object.index !== undefined && object.index !== null) { message.index = object.index; @@ -4898,8 +5444,8 @@ export const EventAttribute = { }, toAmino(message: EventAttribute): EventAttributeAmino { const obj: any = {}; - obj.key = message.key ? base64FromBytes(message.key) : undefined; - obj.value = message.value ? base64FromBytes(message.value) : undefined; + obj.key = message.key === "" ? undefined : message.key; + obj.value = message.value === "" ? undefined : message.value; obj.index = message.index === false ? undefined : message.index; return obj; }, @@ -4919,12 +5465,161 @@ export const EventAttribute = { }; } }; +function createBaseExecTxResult(): ExecTxResult { + return { + code: 0, + data: new Uint8Array(), + log: "", + info: "", + gasWanted: BigInt(0), + gasUsed: BigInt(0), + events: [], + codespace: "" + }; +} +export const ExecTxResult = { + typeUrl: "/tendermint.abci.ExecTxResult", + encode(message: ExecTxResult, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.code !== 0) { + writer.uint32(8).uint32(message.code); + } + if (message.data.length !== 0) { + writer.uint32(18).bytes(message.data); + } + if (message.log !== "") { + writer.uint32(26).string(message.log); + } + if (message.info !== "") { + writer.uint32(34).string(message.info); + } + if (message.gasWanted !== BigInt(0)) { + writer.uint32(40).int64(message.gasWanted); + } + if (message.gasUsed !== BigInt(0)) { + writer.uint32(48).int64(message.gasUsed); + } + for (const v of message.events) { + Event.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.codespace !== "") { + writer.uint32(66).string(message.codespace); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ExecTxResult { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExecTxResult(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.code = reader.uint32(); + break; + case 2: + message.data = reader.bytes(); + break; + case 3: + message.log = reader.string(); + break; + case 4: + message.info = reader.string(); + break; + case 5: + message.gasWanted = reader.int64(); + break; + case 6: + message.gasUsed = reader.int64(); + break; + case 7: + message.events.push(Event.decode(reader, reader.uint32())); + break; + case 8: + message.codespace = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ExecTxResult { + const message = createBaseExecTxResult(); + message.code = object.code ?? 0; + message.data = object.data ?? new Uint8Array(); + message.log = object.log ?? ""; + message.info = object.info ?? ""; + message.gasWanted = object.gasWanted !== undefined && object.gasWanted !== null ? BigInt(object.gasWanted.toString()) : BigInt(0); + message.gasUsed = object.gasUsed !== undefined && object.gasUsed !== null ? BigInt(object.gasUsed.toString()) : BigInt(0); + message.events = object.events?.map(e => Event.fromPartial(e)) || []; + message.codespace = object.codespace ?? ""; + return message; + }, + fromAmino(object: ExecTxResultAmino): ExecTxResult { + const message = createBaseExecTxResult(); + if (object.code !== undefined && object.code !== null) { + message.code = object.code; + } + if (object.data !== undefined && object.data !== null) { + message.data = bytesFromBase64(object.data); + } + if (object.log !== undefined && object.log !== null) { + message.log = object.log; + } + if (object.info !== undefined && object.info !== null) { + message.info = object.info; + } + if (object.gas_wanted !== undefined && object.gas_wanted !== null) { + message.gasWanted = BigInt(object.gas_wanted); + } + if (object.gas_used !== undefined && object.gas_used !== null) { + message.gasUsed = BigInt(object.gas_used); + } + message.events = object.events?.map(e => Event.fromAmino(e)) || []; + if (object.codespace !== undefined && object.codespace !== null) { + message.codespace = object.codespace; + } + return message; + }, + toAmino(message: ExecTxResult): ExecTxResultAmino { + const obj: any = {}; + obj.code = message.code === 0 ? undefined : message.code; + obj.data = message.data ? base64FromBytes(message.data) : undefined; + obj.log = message.log === "" ? undefined : message.log; + obj.info = message.info === "" ? undefined : message.info; + obj.gas_wanted = message.gasWanted !== BigInt(0) ? message.gasWanted.toString() : undefined; + obj.gas_used = message.gasUsed !== BigInt(0) ? message.gasUsed.toString() : undefined; + if (message.events) { + obj.events = message.events.map(e => e ? Event.toAmino(e) : undefined); + } else { + obj.events = message.events; + } + obj.codespace = message.codespace === "" ? undefined : message.codespace; + return obj; + }, + fromAminoMsg(object: ExecTxResultAminoMsg): ExecTxResult { + return ExecTxResult.fromAmino(object.value); + }, + fromProtoMsg(message: ExecTxResultProtoMsg): ExecTxResult { + return ExecTxResult.decode(message.value); + }, + toProto(message: ExecTxResult): Uint8Array { + return ExecTxResult.encode(message).finish(); + }, + toProtoMsg(message: ExecTxResult): ExecTxResultProtoMsg { + return { + typeUrl: "/tendermint.abci.ExecTxResult", + value: ExecTxResult.encode(message).finish() + }; + } +}; function createBaseTxResult(): TxResult { return { height: BigInt(0), index: 0, tx: new Uint8Array(), - result: ResponseDeliverTx.fromPartial({}) + result: ExecTxResult.fromPartial({}) }; } export const TxResult = { @@ -4940,7 +5635,7 @@ export const TxResult = { writer.uint32(26).bytes(message.tx); } if (message.result !== undefined) { - ResponseDeliverTx.encode(message.result, writer.uint32(34).fork()).ldelim(); + ExecTxResult.encode(message.result, writer.uint32(34).fork()).ldelim(); } return writer; }, @@ -4961,7 +5656,7 @@ export const TxResult = { message.tx = reader.bytes(); break; case 4: - message.result = ResponseDeliverTx.decode(reader, reader.uint32()); + message.result = ExecTxResult.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -4975,7 +5670,7 @@ export const TxResult = { message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); message.index = object.index ?? 0; message.tx = object.tx ?? new Uint8Array(); - message.result = object.result !== undefined && object.result !== null ? ResponseDeliverTx.fromPartial(object.result) : undefined; + message.result = object.result !== undefined && object.result !== null ? ExecTxResult.fromPartial(object.result) : undefined; return message; }, fromAmino(object: TxResultAmino): TxResult { @@ -4990,7 +5685,7 @@ export const TxResult = { message.tx = bytesFromBase64(object.tx); } if (object.result !== undefined && object.result !== null) { - message.result = ResponseDeliverTx.fromAmino(object.result); + message.result = ExecTxResult.fromAmino(object.result); } return message; }, @@ -4999,7 +5694,7 @@ export const TxResult = { obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; obj.index = message.index === 0 ? undefined : message.index; obj.tx = message.tx ? base64FromBytes(message.tx) : undefined; - obj.result = message.result ? ResponseDeliverTx.toAmino(message.result) : undefined; + obj.result = message.result ? ExecTxResult.toAmino(message.result) : undefined; return obj; }, fromAminoMsg(object: TxResultAminoMsg): TxResult { @@ -5171,7 +5866,7 @@ export const ValidatorUpdate = { function createBaseVoteInfo(): VoteInfo { return { validator: Validator.fromPartial({}), - signedLastBlock: false + blockIdFlag: 0 }; } export const VoteInfo = { @@ -5180,8 +5875,8 @@ export const VoteInfo = { if (message.validator !== undefined) { Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); } - if (message.signedLastBlock === true) { - writer.uint32(16).bool(message.signedLastBlock); + if (message.blockIdFlag !== 0) { + writer.uint32(24).int32(message.blockIdFlag); } return writer; }, @@ -5195,8 +5890,8 @@ export const VoteInfo = { case 1: message.validator = Validator.decode(reader, reader.uint32()); break; - case 2: - message.signedLastBlock = reader.bool(); + case 3: + message.blockIdFlag = (reader.int32() as any); break; default: reader.skipType(tag & 7); @@ -5208,7 +5903,7 @@ export const VoteInfo = { fromPartial(object: Partial): VoteInfo { const message = createBaseVoteInfo(); message.validator = object.validator !== undefined && object.validator !== null ? Validator.fromPartial(object.validator) : undefined; - message.signedLastBlock = object.signedLastBlock ?? false; + message.blockIdFlag = object.blockIdFlag ?? 0; return message; }, fromAmino(object: VoteInfoAmino): VoteInfo { @@ -5216,15 +5911,15 @@ export const VoteInfo = { if (object.validator !== undefined && object.validator !== null) { message.validator = Validator.fromAmino(object.validator); } - if (object.signed_last_block !== undefined && object.signed_last_block !== null) { - message.signedLastBlock = object.signed_last_block; + if (object.block_id_flag !== undefined && object.block_id_flag !== null) { + message.blockIdFlag = object.block_id_flag; } return message; }, toAmino(message: VoteInfo): VoteInfoAmino { const obj: any = {}; obj.validator = message.validator ? Validator.toAmino(message.validator) : undefined; - obj.signed_last_block = message.signedLastBlock === false ? undefined : message.signedLastBlock; + obj.block_id_flag = message.blockIdFlag === 0 ? undefined : message.blockIdFlag; return obj; }, fromAminoMsg(object: VoteInfoAminoMsg): VoteInfo { @@ -5243,7 +5938,106 @@ export const VoteInfo = { }; } }; -function createBaseEvidence(): Evidence { +function createBaseExtendedVoteInfo(): ExtendedVoteInfo { + return { + validator: Validator.fromPartial({}), + voteExtension: new Uint8Array(), + extensionSignature: new Uint8Array(), + blockIdFlag: 0 + }; +} +export const ExtendedVoteInfo = { + typeUrl: "/tendermint.abci.ExtendedVoteInfo", + encode(message: ExtendedVoteInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.validator !== undefined) { + Validator.encode(message.validator, writer.uint32(10).fork()).ldelim(); + } + if (message.voteExtension.length !== 0) { + writer.uint32(26).bytes(message.voteExtension); + } + if (message.extensionSignature.length !== 0) { + writer.uint32(34).bytes(message.extensionSignature); + } + if (message.blockIdFlag !== 0) { + writer.uint32(40).int32(message.blockIdFlag); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ExtendedVoteInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExtendedVoteInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.validator = Validator.decode(reader, reader.uint32()); + break; + case 3: + message.voteExtension = reader.bytes(); + break; + case 4: + message.extensionSignature = reader.bytes(); + break; + case 5: + message.blockIdFlag = (reader.int32() as any); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ExtendedVoteInfo { + const message = createBaseExtendedVoteInfo(); + message.validator = object.validator !== undefined && object.validator !== null ? Validator.fromPartial(object.validator) : undefined; + message.voteExtension = object.voteExtension ?? new Uint8Array(); + message.extensionSignature = object.extensionSignature ?? new Uint8Array(); + message.blockIdFlag = object.blockIdFlag ?? 0; + return message; + }, + fromAmino(object: ExtendedVoteInfoAmino): ExtendedVoteInfo { + const message = createBaseExtendedVoteInfo(); + if (object.validator !== undefined && object.validator !== null) { + message.validator = Validator.fromAmino(object.validator); + } + if (object.vote_extension !== undefined && object.vote_extension !== null) { + message.voteExtension = bytesFromBase64(object.vote_extension); + } + if (object.extension_signature !== undefined && object.extension_signature !== null) { + message.extensionSignature = bytesFromBase64(object.extension_signature); + } + if (object.block_id_flag !== undefined && object.block_id_flag !== null) { + message.blockIdFlag = object.block_id_flag; + } + return message; + }, + toAmino(message: ExtendedVoteInfo): ExtendedVoteInfoAmino { + const obj: any = {}; + obj.validator = message.validator ? Validator.toAmino(message.validator) : undefined; + obj.vote_extension = message.voteExtension ? base64FromBytes(message.voteExtension) : undefined; + obj.extension_signature = message.extensionSignature ? base64FromBytes(message.extensionSignature) : undefined; + obj.block_id_flag = message.blockIdFlag === 0 ? undefined : message.blockIdFlag; + return obj; + }, + fromAminoMsg(object: ExtendedVoteInfoAminoMsg): ExtendedVoteInfo { + return ExtendedVoteInfo.fromAmino(object.value); + }, + fromProtoMsg(message: ExtendedVoteInfoProtoMsg): ExtendedVoteInfo { + return ExtendedVoteInfo.decode(message.value); + }, + toProto(message: ExtendedVoteInfo): Uint8Array { + return ExtendedVoteInfo.encode(message).finish(); + }, + toProtoMsg(message: ExtendedVoteInfo): ExtendedVoteInfoProtoMsg { + return { + typeUrl: "/tendermint.abci.ExtendedVoteInfo", + value: ExtendedVoteInfo.encode(message).finish() + }; + } +}; +function createBaseMisbehavior(): Misbehavior { return { type: 0, validator: Validator.fromPartial({}), @@ -5252,9 +6046,9 @@ function createBaseEvidence(): Evidence { totalVotingPower: BigInt(0) }; } -export const Evidence = { - typeUrl: "/tendermint.abci.Evidence", - encode(message: Evidence, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { +export const Misbehavior = { + typeUrl: "/tendermint.abci.Misbehavior", + encode(message: Misbehavior, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { if (message.type !== 0) { writer.uint32(8).int32(message.type); } @@ -5272,10 +6066,10 @@ export const Evidence = { } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): Evidence { + decode(input: BinaryReader | Uint8Array, length?: number): Misbehavior { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEvidence(); + const message = createBaseMisbehavior(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -5301,8 +6095,8 @@ export const Evidence = { } return message; }, - fromPartial(object: Partial): Evidence { - const message = createBaseEvidence(); + fromPartial(object: Partial): Misbehavior { + const message = createBaseMisbehavior(); message.type = object.type ?? 0; message.validator = object.validator !== undefined && object.validator !== null ? Validator.fromPartial(object.validator) : undefined; message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); @@ -5310,8 +6104,8 @@ export const Evidence = { message.totalVotingPower = object.totalVotingPower !== undefined && object.totalVotingPower !== null ? BigInt(object.totalVotingPower.toString()) : BigInt(0); return message; }, - fromAmino(object: EvidenceAmino): Evidence { - const message = createBaseEvidence(); + fromAmino(object: MisbehaviorAmino): Misbehavior { + const message = createBaseMisbehavior(); if (object.type !== undefined && object.type !== null) { message.type = object.type; } @@ -5329,7 +6123,7 @@ export const Evidence = { } return message; }, - toAmino(message: Evidence): EvidenceAmino { + toAmino(message: Misbehavior): MisbehaviorAmino { const obj: any = {}; obj.type = message.type === 0 ? undefined : message.type; obj.validator = message.validator ? Validator.toAmino(message.validator) : undefined; @@ -5338,19 +6132,19 @@ export const Evidence = { obj.total_voting_power = message.totalVotingPower !== BigInt(0) ? message.totalVotingPower.toString() : undefined; return obj; }, - fromAminoMsg(object: EvidenceAminoMsg): Evidence { - return Evidence.fromAmino(object.value); + fromAminoMsg(object: MisbehaviorAminoMsg): Misbehavior { + return Misbehavior.fromAmino(object.value); }, - fromProtoMsg(message: EvidenceProtoMsg): Evidence { - return Evidence.decode(message.value); + fromProtoMsg(message: MisbehaviorProtoMsg): Misbehavior { + return Misbehavior.decode(message.value); }, - toProto(message: Evidence): Uint8Array { - return Evidence.encode(message).finish(); + toProto(message: Misbehavior): Uint8Array { + return Misbehavior.encode(message).finish(); }, - toProtoMsg(message: Evidence): EvidenceProtoMsg { + toProtoMsg(message: Misbehavior): MisbehaviorProtoMsg { return { - typeUrl: "/tendermint.abci.Evidence", - value: Evidence.encode(message).finish() + typeUrl: "/tendermint.abci.Misbehavior", + value: Misbehavior.encode(message).finish() }; } }; diff --git a/src/codegen/tendermint/bundle.ts b/src/codegen/tendermint/bundle.ts index 2878f9b..9a1c8f4 100644 --- a/src/codegen/tendermint/bundle.ts +++ b/src/codegen/tendermint/bundle.ts @@ -1,38 +1,38 @@ -import * as _126 from "./abci/types"; -import * as _127 from "./crypto/keys"; -import * as _128 from "./crypto/proof"; -import * as _129 from "./libs/bits/types"; -import * as _130 from "./p2p/types"; -import * as _131 from "./types/block"; -import * as _132 from "./types/evidence"; -import * as _133 from "./types/params"; -import * as _134 from "./types/types"; -import * as _135 from "./types/validator"; -import * as _136 from "./version/types"; +import * as _209 from "./abci/types"; +import * as _210 from "./crypto/keys"; +import * as _211 from "./crypto/proof"; +import * as _212 from "./libs/bits/types"; +import * as _213 from "./p2p/types"; +import * as _214 from "./types/block"; +import * as _215 from "./types/evidence"; +import * as _216 from "./types/params"; +import * as _217 from "./types/types"; +import * as _218 from "./types/validator"; +import * as _219 from "./version/types"; export namespace tendermint { export const abci = { - ..._126 + ..._209 }; export const crypto = { - ..._127, - ..._128 + ..._210, + ..._211 }; export namespace libs { export const bits = { - ..._129 + ..._212 }; } export const p2p = { - ..._130 + ..._213 }; export const types = { - ..._131, - ..._132, - ..._133, - ..._134, - ..._135 + ..._214, + ..._215, + ..._216, + ..._217, + ..._218 }; export const version = { - ..._136 + ..._219 }; } \ No newline at end of file diff --git a/src/codegen/tendermint/types/params.ts b/src/codegen/tendermint/types/params.ts index e2c645a..f8621ec 100644 --- a/src/codegen/tendermint/types/params.ts +++ b/src/codegen/tendermint/types/params.ts @@ -5,10 +5,11 @@ import { BinaryReader, BinaryWriter } from "../../binary"; * validity of blocks. */ export interface ConsensusParams { - block: BlockParams; - evidence: EvidenceParams; - validator: ValidatorParams; - version: VersionParams; + block?: BlockParams; + evidence?: EvidenceParams; + validator?: ValidatorParams; + version?: VersionParams; + abci?: ABCIParams; } export interface ConsensusParamsProtoMsg { typeUrl: "/tendermint.types.ConsensusParams"; @@ -23,6 +24,7 @@ export interface ConsensusParamsAmino { evidence?: EvidenceParamsAmino; validator?: ValidatorParamsAmino; version?: VersionParamsAmino; + abci?: ABCIParamsAmino; } export interface ConsensusParamsAminoMsg { type: "/tendermint.types.ConsensusParams"; @@ -33,10 +35,11 @@ export interface ConsensusParamsAminoMsg { * validity of blocks. */ export interface ConsensusParamsSDKType { - block: BlockParamsSDKType; - evidence: EvidenceParamsSDKType; - validator: ValidatorParamsSDKType; - version: VersionParamsSDKType; + block?: BlockParamsSDKType; + evidence?: EvidenceParamsSDKType; + validator?: ValidatorParamsSDKType; + version?: VersionParamsSDKType; + abci?: ABCIParamsSDKType; } /** BlockParams contains limits on the block size. */ export interface BlockParams { @@ -50,13 +53,6 @@ export interface BlockParams { * Note: must be greater or equal to -1 */ maxGas: bigint; - /** - * Minimum time increment between consecutive blocks (in milliseconds) If the - * block header timestamp is ahead of the system clock, decrease this value. - * - * Not exposed to the application. - */ - timeIotaMs: bigint; } export interface BlockParamsProtoMsg { typeUrl: "/tendermint.types.BlockParams"; @@ -74,13 +70,6 @@ export interface BlockParamsAmino { * Note: must be greater or equal to -1 */ max_gas?: string; - /** - * Minimum time increment between consecutive blocks (in milliseconds) If the - * block header timestamp is ahead of the system clock, decrease this value. - * - * Not exposed to the application. - */ - time_iota_ms?: string; } export interface BlockParamsAminoMsg { type: "/tendermint.types.BlockParams"; @@ -90,7 +79,6 @@ export interface BlockParamsAminoMsg { export interface BlockParamsSDKType { max_bytes: bigint; max_gas: bigint; - time_iota_ms: bigint; } /** EvidenceParams determine how we handle evidence of malfeasance. */ export interface EvidenceParams { @@ -185,7 +173,7 @@ export interface ValidatorParamsSDKType { } /** VersionParams contains the ABCI application version. */ export interface VersionParams { - appVersion: bigint; + app: bigint; } export interface VersionParamsProtoMsg { typeUrl: "/tendermint.types.VersionParams"; @@ -193,7 +181,7 @@ export interface VersionParamsProtoMsg { } /** VersionParams contains the ABCI application version. */ export interface VersionParamsAmino { - app_version?: string; + app?: string; } export interface VersionParamsAminoMsg { type: "/tendermint.types.VersionParams"; @@ -201,7 +189,7 @@ export interface VersionParamsAminoMsg { } /** VersionParams contains the ABCI application version. */ export interface VersionParamsSDKType { - app_version: bigint; + app: bigint; } /** * HashedParams is a subset of ConsensusParams. @@ -238,12 +226,55 @@ export interface HashedParamsSDKType { block_max_bytes: bigint; block_max_gas: bigint; } +/** ABCIParams configure functionality specific to the Application Blockchain Interface. */ +export interface ABCIParams { + /** + * vote_extensions_enable_height configures the first height during which + * vote extensions will be enabled. During this specified height, and for all + * subsequent heights, precommit messages that do not contain valid extension data + * will be considered invalid. Prior to this height, vote extensions will not + * be used or accepted by validators on the network. + * + * Once enabled, vote extensions will be created by the application in ExtendVote, + * passed to the application for validation in VerifyVoteExtension and given + * to the application to use when proposing a block during PrepareProposal. + */ + voteExtensionsEnableHeight: bigint; +} +export interface ABCIParamsProtoMsg { + typeUrl: "/tendermint.types.ABCIParams"; + value: Uint8Array; +} +/** ABCIParams configure functionality specific to the Application Blockchain Interface. */ +export interface ABCIParamsAmino { + /** + * vote_extensions_enable_height configures the first height during which + * vote extensions will be enabled. During this specified height, and for all + * subsequent heights, precommit messages that do not contain valid extension data + * will be considered invalid. Prior to this height, vote extensions will not + * be used or accepted by validators on the network. + * + * Once enabled, vote extensions will be created by the application in ExtendVote, + * passed to the application for validation in VerifyVoteExtension and given + * to the application to use when proposing a block during PrepareProposal. + */ + vote_extensions_enable_height?: string; +} +export interface ABCIParamsAminoMsg { + type: "/tendermint.types.ABCIParams"; + value: ABCIParamsAmino; +} +/** ABCIParams configure functionality specific to the Application Blockchain Interface. */ +export interface ABCIParamsSDKType { + vote_extensions_enable_height: bigint; +} function createBaseConsensusParams(): ConsensusParams { return { - block: BlockParams.fromPartial({}), - evidence: EvidenceParams.fromPartial({}), - validator: ValidatorParams.fromPartial({}), - version: VersionParams.fromPartial({}) + block: undefined, + evidence: undefined, + validator: undefined, + version: undefined, + abci: undefined }; } export const ConsensusParams = { @@ -261,6 +292,9 @@ export const ConsensusParams = { if (message.version !== undefined) { VersionParams.encode(message.version, writer.uint32(34).fork()).ldelim(); } + if (message.abci !== undefined) { + ABCIParams.encode(message.abci, writer.uint32(42).fork()).ldelim(); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ConsensusParams { @@ -282,6 +316,9 @@ export const ConsensusParams = { case 4: message.version = VersionParams.decode(reader, reader.uint32()); break; + case 5: + message.abci = ABCIParams.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -295,6 +332,7 @@ export const ConsensusParams = { message.evidence = object.evidence !== undefined && object.evidence !== null ? EvidenceParams.fromPartial(object.evidence) : undefined; message.validator = object.validator !== undefined && object.validator !== null ? ValidatorParams.fromPartial(object.validator) : undefined; message.version = object.version !== undefined && object.version !== null ? VersionParams.fromPartial(object.version) : undefined; + message.abci = object.abci !== undefined && object.abci !== null ? ABCIParams.fromPartial(object.abci) : undefined; return message; }, fromAmino(object: ConsensusParamsAmino): ConsensusParams { @@ -311,6 +349,9 @@ export const ConsensusParams = { if (object.version !== undefined && object.version !== null) { message.version = VersionParams.fromAmino(object.version); } + if (object.abci !== undefined && object.abci !== null) { + message.abci = ABCIParams.fromAmino(object.abci); + } return message; }, toAmino(message: ConsensusParams): ConsensusParamsAmino { @@ -319,6 +360,7 @@ export const ConsensusParams = { obj.evidence = message.evidence ? EvidenceParams.toAmino(message.evidence) : undefined; obj.validator = message.validator ? ValidatorParams.toAmino(message.validator) : undefined; obj.version = message.version ? VersionParams.toAmino(message.version) : undefined; + obj.abci = message.abci ? ABCIParams.toAmino(message.abci) : undefined; return obj; }, fromAminoMsg(object: ConsensusParamsAminoMsg): ConsensusParams { @@ -340,8 +382,7 @@ export const ConsensusParams = { function createBaseBlockParams(): BlockParams { return { maxBytes: BigInt(0), - maxGas: BigInt(0), - timeIotaMs: BigInt(0) + maxGas: BigInt(0) }; } export const BlockParams = { @@ -353,9 +394,6 @@ export const BlockParams = { if (message.maxGas !== BigInt(0)) { writer.uint32(16).int64(message.maxGas); } - if (message.timeIotaMs !== BigInt(0)) { - writer.uint32(24).int64(message.timeIotaMs); - } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): BlockParams { @@ -371,9 +409,6 @@ export const BlockParams = { case 2: message.maxGas = reader.int64(); break; - case 3: - message.timeIotaMs = reader.int64(); - break; default: reader.skipType(tag & 7); break; @@ -385,7 +420,6 @@ export const BlockParams = { const message = createBaseBlockParams(); message.maxBytes = object.maxBytes !== undefined && object.maxBytes !== null ? BigInt(object.maxBytes.toString()) : BigInt(0); message.maxGas = object.maxGas !== undefined && object.maxGas !== null ? BigInt(object.maxGas.toString()) : BigInt(0); - message.timeIotaMs = object.timeIotaMs !== undefined && object.timeIotaMs !== null ? BigInt(object.timeIotaMs.toString()) : BigInt(0); return message; }, fromAmino(object: BlockParamsAmino): BlockParams { @@ -396,16 +430,12 @@ export const BlockParams = { if (object.max_gas !== undefined && object.max_gas !== null) { message.maxGas = BigInt(object.max_gas); } - if (object.time_iota_ms !== undefined && object.time_iota_ms !== null) { - message.timeIotaMs = BigInt(object.time_iota_ms); - } return message; }, toAmino(message: BlockParams): BlockParamsAmino { const obj: any = {}; obj.max_bytes = message.maxBytes !== BigInt(0) ? message.maxBytes.toString() : undefined; obj.max_gas = message.maxGas !== BigInt(0) ? message.maxGas.toString() : undefined; - obj.time_iota_ms = message.timeIotaMs !== BigInt(0) ? message.timeIotaMs.toString() : undefined; return obj; }, fromAminoMsg(object: BlockParamsAminoMsg): BlockParams { @@ -578,14 +608,14 @@ export const ValidatorParams = { }; function createBaseVersionParams(): VersionParams { return { - appVersion: BigInt(0) + app: BigInt(0) }; } export const VersionParams = { typeUrl: "/tendermint.types.VersionParams", encode(message: VersionParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { - if (message.appVersion !== BigInt(0)) { - writer.uint32(8).uint64(message.appVersion); + if (message.app !== BigInt(0)) { + writer.uint32(8).uint64(message.app); } return writer; }, @@ -597,7 +627,7 @@ export const VersionParams = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.appVersion = reader.uint64(); + message.app = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -608,19 +638,19 @@ export const VersionParams = { }, fromPartial(object: Partial): VersionParams { const message = createBaseVersionParams(); - message.appVersion = object.appVersion !== undefined && object.appVersion !== null ? BigInt(object.appVersion.toString()) : BigInt(0); + message.app = object.app !== undefined && object.app !== null ? BigInt(object.app.toString()) : BigInt(0); return message; }, fromAmino(object: VersionParamsAmino): VersionParams { const message = createBaseVersionParams(); - if (object.app_version !== undefined && object.app_version !== null) { - message.appVersion = BigInt(object.app_version); + if (object.app !== undefined && object.app !== null) { + message.app = BigInt(object.app); } return message; }, toAmino(message: VersionParams): VersionParamsAmino { const obj: any = {}; - obj.app_version = message.appVersion !== BigInt(0) ? message.appVersion.toString() : undefined; + obj.app = message.app !== BigInt(0) ? message.app.toString() : undefined; return obj; }, fromAminoMsg(object: VersionParamsAminoMsg): VersionParams { @@ -713,4 +743,67 @@ export const HashedParams = { value: HashedParams.encode(message).finish() }; } +}; +function createBaseABCIParams(): ABCIParams { + return { + voteExtensionsEnableHeight: BigInt(0) + }; +} +export const ABCIParams = { + typeUrl: "/tendermint.types.ABCIParams", + encode(message: ABCIParams, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.voteExtensionsEnableHeight !== BigInt(0)) { + writer.uint32(8).int64(message.voteExtensionsEnableHeight); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ABCIParams { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseABCIParams(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.voteExtensionsEnableHeight = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ABCIParams { + const message = createBaseABCIParams(); + message.voteExtensionsEnableHeight = object.voteExtensionsEnableHeight !== undefined && object.voteExtensionsEnableHeight !== null ? BigInt(object.voteExtensionsEnableHeight.toString()) : BigInt(0); + return message; + }, + fromAmino(object: ABCIParamsAmino): ABCIParams { + const message = createBaseABCIParams(); + if (object.vote_extensions_enable_height !== undefined && object.vote_extensions_enable_height !== null) { + message.voteExtensionsEnableHeight = BigInt(object.vote_extensions_enable_height); + } + return message; + }, + toAmino(message: ABCIParams): ABCIParamsAmino { + const obj: any = {}; + obj.vote_extensions_enable_height = message.voteExtensionsEnableHeight !== BigInt(0) ? message.voteExtensionsEnableHeight.toString() : undefined; + return obj; + }, + fromAminoMsg(object: ABCIParamsAminoMsg): ABCIParams { + return ABCIParams.fromAmino(object.value); + }, + fromProtoMsg(message: ABCIParamsProtoMsg): ABCIParams { + return ABCIParams.decode(message.value); + }, + toProto(message: ABCIParams): Uint8Array { + return ABCIParams.encode(message).finish(); + }, + toProtoMsg(message: ABCIParams): ABCIParamsProtoMsg { + return { + typeUrl: "/tendermint.types.ABCIParams", + value: ABCIParams.encode(message).finish() + }; + } }; \ No newline at end of file diff --git a/src/codegen/tendermint/types/types.ts b/src/codegen/tendermint/types/types.ts index 98aafa7..6b593b6 100644 --- a/src/codegen/tendermint/types/types.ts +++ b/src/codegen/tendermint/types/types.ts @@ -1,54 +1,9 @@ import { Proof, ProofAmino, ProofSDKType } from "../crypto/proof"; import { Consensus, ConsensusAmino, ConsensusSDKType } from "../version/types"; import { Timestamp } from "../../google/protobuf/timestamp"; -import { ValidatorSet, ValidatorSetAmino, ValidatorSetSDKType } from "./validator"; +import { BlockIDFlag, ValidatorSet, ValidatorSetAmino, ValidatorSetSDKType } from "./validator"; import { BinaryReader, BinaryWriter } from "../../binary"; import { bytesFromBase64, base64FromBytes, toTimestamp, fromTimestamp } from "../../helpers"; -/** BlockIdFlag indicates which BlcokID the signature is for */ -export enum BlockIDFlag { - BLOCK_ID_FLAG_UNKNOWN = 0, - BLOCK_ID_FLAG_ABSENT = 1, - BLOCK_ID_FLAG_COMMIT = 2, - BLOCK_ID_FLAG_NIL = 3, - UNRECOGNIZED = -1, -} -export const BlockIDFlagSDKType = BlockIDFlag; -export const BlockIDFlagAmino = BlockIDFlag; -export function blockIDFlagFromJSON(object: any): BlockIDFlag { - switch (object) { - case 0: - case "BLOCK_ID_FLAG_UNKNOWN": - return BlockIDFlag.BLOCK_ID_FLAG_UNKNOWN; - case 1: - case "BLOCK_ID_FLAG_ABSENT": - return BlockIDFlag.BLOCK_ID_FLAG_ABSENT; - case 2: - case "BLOCK_ID_FLAG_COMMIT": - return BlockIDFlag.BLOCK_ID_FLAG_COMMIT; - case 3: - case "BLOCK_ID_FLAG_NIL": - return BlockIDFlag.BLOCK_ID_FLAG_NIL; - case -1: - case "UNRECOGNIZED": - default: - return BlockIDFlag.UNRECOGNIZED; - } -} -export function blockIDFlagToJSON(object: BlockIDFlag): string { - switch (object) { - case BlockIDFlag.BLOCK_ID_FLAG_UNKNOWN: - return "BLOCK_ID_FLAG_UNKNOWN"; - case BlockIDFlag.BLOCK_ID_FLAG_ABSENT: - return "BLOCK_ID_FLAG_ABSENT"; - case BlockIDFlag.BLOCK_ID_FLAG_COMMIT: - return "BLOCK_ID_FLAG_COMMIT"; - case BlockIDFlag.BLOCK_ID_FLAG_NIL: - return "BLOCK_ID_FLAG_NIL"; - case BlockIDFlag.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} /** SignedMsgType is a type of signed message in the consensus. */ export enum SignedMsgType { SIGNED_MSG_TYPE_UNKNOWN = 0, @@ -273,43 +228,75 @@ export interface DataSDKType { txs: Uint8Array[]; } /** - * Vote represents a prevote, precommit, or commit vote from validators for + * Vote represents a prevote or precommit vote from validators for * consensus. */ export interface Vote { type: SignedMsgType; height: bigint; round: number; + /** zero if vote is nil. */ blockId: BlockID; timestamp: Date; validatorAddress: Uint8Array; validatorIndex: number; + /** + * Vote signature by the validator if they participated in consensus for the + * associated block. + */ signature: Uint8Array; + /** + * Vote extension provided by the application. Only valid for precommit + * messages. + */ + extension: Uint8Array; + /** + * Vote extension signature by the validator if they participated in + * consensus for the associated block. + * Only valid for precommit messages. + */ + extensionSignature: Uint8Array; } export interface VoteProtoMsg { typeUrl: "/tendermint.types.Vote"; value: Uint8Array; } /** - * Vote represents a prevote, precommit, or commit vote from validators for + * Vote represents a prevote or precommit vote from validators for * consensus. */ export interface VoteAmino { type?: SignedMsgType; height?: string; round?: number; + /** zero if vote is nil. */ block_id?: BlockIDAmino; timestamp?: string; validator_address?: string; validator_index?: number; + /** + * Vote signature by the validator if they participated in consensus for the + * associated block. + */ signature?: string; + /** + * Vote extension provided by the application. Only valid for precommit + * messages. + */ + extension?: string; + /** + * Vote extension signature by the validator if they participated in + * consensus for the associated block. + * Only valid for precommit messages. + */ + extension_signature?: string; } export interface VoteAminoMsg { type: "/tendermint.types.Vote"; value: VoteAmino; } /** - * Vote represents a prevote, precommit, or commit vote from validators for + * Vote represents a prevote or precommit vote from validators for * consensus. */ export interface VoteSDKType { @@ -321,6 +308,8 @@ export interface VoteSDKType { validator_address: Uint8Array; validator_index: number; signature: Uint8Array; + extension: Uint8Array; + extension_signature: Uint8Array; } /** Commit contains the evidence that a block was committed by a set of validators. */ export interface Commit { @@ -380,6 +369,83 @@ export interface CommitSigSDKType { timestamp: Date; signature: Uint8Array; } +export interface ExtendedCommit { + height: bigint; + round: number; + blockId: BlockID; + extendedSignatures: ExtendedCommitSig[]; +} +export interface ExtendedCommitProtoMsg { + typeUrl: "/tendermint.types.ExtendedCommit"; + value: Uint8Array; +} +export interface ExtendedCommitAmino { + height?: string; + round?: number; + block_id?: BlockIDAmino; + extended_signatures?: ExtendedCommitSigAmino[]; +} +export interface ExtendedCommitAminoMsg { + type: "/tendermint.types.ExtendedCommit"; + value: ExtendedCommitAmino; +} +export interface ExtendedCommitSDKType { + height: bigint; + round: number; + block_id: BlockIDSDKType; + extended_signatures: ExtendedCommitSigSDKType[]; +} +/** + * ExtendedCommitSig retains all the same fields as CommitSig but adds vote + * extension-related fields. We use two signatures to ensure backwards compatibility. + * That is the digest of the original signature is still the same in prior versions + */ +export interface ExtendedCommitSig { + blockIdFlag: BlockIDFlag; + validatorAddress: Uint8Array; + timestamp: Date; + signature: Uint8Array; + /** Vote extension data */ + extension: Uint8Array; + /** Vote extension signature */ + extensionSignature: Uint8Array; +} +export interface ExtendedCommitSigProtoMsg { + typeUrl: "/tendermint.types.ExtendedCommitSig"; + value: Uint8Array; +} +/** + * ExtendedCommitSig retains all the same fields as CommitSig but adds vote + * extension-related fields. We use two signatures to ensure backwards compatibility. + * That is the digest of the original signature is still the same in prior versions + */ +export interface ExtendedCommitSigAmino { + block_id_flag?: BlockIDFlag; + validator_address?: string; + timestamp?: string; + signature?: string; + /** Vote extension data */ + extension?: string; + /** Vote extension signature */ + extension_signature?: string; +} +export interface ExtendedCommitSigAminoMsg { + type: "/tendermint.types.ExtendedCommitSig"; + value: ExtendedCommitSigAmino; +} +/** + * ExtendedCommitSig retains all the same fields as CommitSig but adds vote + * extension-related fields. We use two signatures to ensure backwards compatibility. + * That is the digest of the original signature is still the same in prior versions + */ +export interface ExtendedCommitSigSDKType { + block_id_flag: BlockIDFlag; + validator_address: Uint8Array; + timestamp: Date; + signature: Uint8Array; + extension: Uint8Array; + extension_signature: Uint8Array; +} export interface Proposal { type: SignedMsgType; height: bigint; @@ -1037,7 +1103,9 @@ function createBaseVote(): Vote { timestamp: new Date(), validatorAddress: new Uint8Array(), validatorIndex: 0, - signature: new Uint8Array() + signature: new Uint8Array(), + extension: new Uint8Array(), + extensionSignature: new Uint8Array() }; } export const Vote = { @@ -1067,6 +1135,12 @@ export const Vote = { if (message.signature.length !== 0) { writer.uint32(66).bytes(message.signature); } + if (message.extension.length !== 0) { + writer.uint32(74).bytes(message.extension); + } + if (message.extensionSignature.length !== 0) { + writer.uint32(82).bytes(message.extensionSignature); + } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Vote { @@ -1100,6 +1174,12 @@ export const Vote = { case 8: message.signature = reader.bytes(); break; + case 9: + message.extension = reader.bytes(); + break; + case 10: + message.extensionSignature = reader.bytes(); + break; default: reader.skipType(tag & 7); break; @@ -1117,6 +1197,8 @@ export const Vote = { message.validatorAddress = object.validatorAddress ?? new Uint8Array(); message.validatorIndex = object.validatorIndex ?? 0; message.signature = object.signature ?? new Uint8Array(); + message.extension = object.extension ?? new Uint8Array(); + message.extensionSignature = object.extensionSignature ?? new Uint8Array(); return message; }, fromAmino(object: VoteAmino): Vote { @@ -1145,6 +1227,12 @@ export const Vote = { if (object.signature !== undefined && object.signature !== null) { message.signature = bytesFromBase64(object.signature); } + if (object.extension !== undefined && object.extension !== null) { + message.extension = bytesFromBase64(object.extension); + } + if (object.extension_signature !== undefined && object.extension_signature !== null) { + message.extensionSignature = bytesFromBase64(object.extension_signature); + } return message; }, toAmino(message: Vote): VoteAmino { @@ -1157,6 +1245,8 @@ export const Vote = { obj.validator_address = message.validatorAddress ? base64FromBytes(message.validatorAddress) : undefined; obj.validator_index = message.validatorIndex === 0 ? undefined : message.validatorIndex; obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; + obj.extension = message.extension ? base64FromBytes(message.extension) : undefined; + obj.extension_signature = message.extensionSignature ? base64FromBytes(message.extensionSignature) : undefined; return obj; }, fromAminoMsg(object: VoteAminoMsg): Vote { @@ -1375,6 +1465,230 @@ export const CommitSig = { }; } }; +function createBaseExtendedCommit(): ExtendedCommit { + return { + height: BigInt(0), + round: 0, + blockId: BlockID.fromPartial({}), + extendedSignatures: [] + }; +} +export const ExtendedCommit = { + typeUrl: "/tendermint.types.ExtendedCommit", + encode(message: ExtendedCommit, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.height !== BigInt(0)) { + writer.uint32(8).int64(message.height); + } + if (message.round !== 0) { + writer.uint32(16).int32(message.round); + } + if (message.blockId !== undefined) { + BlockID.encode(message.blockId, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.extendedSignatures) { + ExtendedCommitSig.encode(v!, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ExtendedCommit { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExtendedCommit(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + case 2: + message.round = reader.int32(); + break; + case 3: + message.blockId = BlockID.decode(reader, reader.uint32()); + break; + case 4: + message.extendedSignatures.push(ExtendedCommitSig.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ExtendedCommit { + const message = createBaseExtendedCommit(); + message.height = object.height !== undefined && object.height !== null ? BigInt(object.height.toString()) : BigInt(0); + message.round = object.round ?? 0; + message.blockId = object.blockId !== undefined && object.blockId !== null ? BlockID.fromPartial(object.blockId) : undefined; + message.extendedSignatures = object.extendedSignatures?.map(e => ExtendedCommitSig.fromPartial(e)) || []; + return message; + }, + fromAmino(object: ExtendedCommitAmino): ExtendedCommit { + const message = createBaseExtendedCommit(); + if (object.height !== undefined && object.height !== null) { + message.height = BigInt(object.height); + } + if (object.round !== undefined && object.round !== null) { + message.round = object.round; + } + if (object.block_id !== undefined && object.block_id !== null) { + message.blockId = BlockID.fromAmino(object.block_id); + } + message.extendedSignatures = object.extended_signatures?.map(e => ExtendedCommitSig.fromAmino(e)) || []; + return message; + }, + toAmino(message: ExtendedCommit): ExtendedCommitAmino { + const obj: any = {}; + obj.height = message.height !== BigInt(0) ? message.height.toString() : undefined; + obj.round = message.round === 0 ? undefined : message.round; + obj.block_id = message.blockId ? BlockID.toAmino(message.blockId) : undefined; + if (message.extendedSignatures) { + obj.extended_signatures = message.extendedSignatures.map(e => e ? ExtendedCommitSig.toAmino(e) : undefined); + } else { + obj.extended_signatures = message.extendedSignatures; + } + return obj; + }, + fromAminoMsg(object: ExtendedCommitAminoMsg): ExtendedCommit { + return ExtendedCommit.fromAmino(object.value); + }, + fromProtoMsg(message: ExtendedCommitProtoMsg): ExtendedCommit { + return ExtendedCommit.decode(message.value); + }, + toProto(message: ExtendedCommit): Uint8Array { + return ExtendedCommit.encode(message).finish(); + }, + toProtoMsg(message: ExtendedCommit): ExtendedCommitProtoMsg { + return { + typeUrl: "/tendermint.types.ExtendedCommit", + value: ExtendedCommit.encode(message).finish() + }; + } +}; +function createBaseExtendedCommitSig(): ExtendedCommitSig { + return { + blockIdFlag: 0, + validatorAddress: new Uint8Array(), + timestamp: new Date(), + signature: new Uint8Array(), + extension: new Uint8Array(), + extensionSignature: new Uint8Array() + }; +} +export const ExtendedCommitSig = { + typeUrl: "/tendermint.types.ExtendedCommitSig", + encode(message: ExtendedCommitSig, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter { + if (message.blockIdFlag !== 0) { + writer.uint32(8).int32(message.blockIdFlag); + } + if (message.validatorAddress.length !== 0) { + writer.uint32(18).bytes(message.validatorAddress); + } + if (message.timestamp !== undefined) { + Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(26).fork()).ldelim(); + } + if (message.signature.length !== 0) { + writer.uint32(34).bytes(message.signature); + } + if (message.extension.length !== 0) { + writer.uint32(42).bytes(message.extension); + } + if (message.extensionSignature.length !== 0) { + writer.uint32(50).bytes(message.extensionSignature); + } + return writer; + }, + decode(input: BinaryReader | Uint8Array, length?: number): ExtendedCommitSig { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExtendedCommitSig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockIdFlag = (reader.int32() as any); + break; + case 2: + message.validatorAddress = reader.bytes(); + break; + case 3: + message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + break; + case 4: + message.signature = reader.bytes(); + break; + case 5: + message.extension = reader.bytes(); + break; + case 6: + message.extensionSignature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + fromPartial(object: Partial): ExtendedCommitSig { + const message = createBaseExtendedCommitSig(); + message.blockIdFlag = object.blockIdFlag ?? 0; + message.validatorAddress = object.validatorAddress ?? new Uint8Array(); + message.timestamp = object.timestamp ?? undefined; + message.signature = object.signature ?? new Uint8Array(); + message.extension = object.extension ?? new Uint8Array(); + message.extensionSignature = object.extensionSignature ?? new Uint8Array(); + return message; + }, + fromAmino(object: ExtendedCommitSigAmino): ExtendedCommitSig { + const message = createBaseExtendedCommitSig(); + if (object.block_id_flag !== undefined && object.block_id_flag !== null) { + message.blockIdFlag = object.block_id_flag; + } + if (object.validator_address !== undefined && object.validator_address !== null) { + message.validatorAddress = bytesFromBase64(object.validator_address); + } + if (object.timestamp !== undefined && object.timestamp !== null) { + message.timestamp = fromTimestamp(Timestamp.fromAmino(object.timestamp)); + } + if (object.signature !== undefined && object.signature !== null) { + message.signature = bytesFromBase64(object.signature); + } + if (object.extension !== undefined && object.extension !== null) { + message.extension = bytesFromBase64(object.extension); + } + if (object.extension_signature !== undefined && object.extension_signature !== null) { + message.extensionSignature = bytesFromBase64(object.extension_signature); + } + return message; + }, + toAmino(message: ExtendedCommitSig): ExtendedCommitSigAmino { + const obj: any = {}; + obj.block_id_flag = message.blockIdFlag === 0 ? undefined : message.blockIdFlag; + obj.validator_address = message.validatorAddress ? base64FromBytes(message.validatorAddress) : undefined; + obj.timestamp = message.timestamp ? Timestamp.toAmino(toTimestamp(message.timestamp)) : undefined; + obj.signature = message.signature ? base64FromBytes(message.signature) : undefined; + obj.extension = message.extension ? base64FromBytes(message.extension) : undefined; + obj.extension_signature = message.extensionSignature ? base64FromBytes(message.extensionSignature) : undefined; + return obj; + }, + fromAminoMsg(object: ExtendedCommitSigAminoMsg): ExtendedCommitSig { + return ExtendedCommitSig.fromAmino(object.value); + }, + fromProtoMsg(message: ExtendedCommitSigProtoMsg): ExtendedCommitSig { + return ExtendedCommitSig.decode(message.value); + }, + toProto(message: ExtendedCommitSig): Uint8Array { + return ExtendedCommitSig.encode(message).finish(); + }, + toProtoMsg(message: ExtendedCommitSig): ExtendedCommitSigProtoMsg { + return { + typeUrl: "/tendermint.types.ExtendedCommitSig", + value: ExtendedCommitSig.encode(message).finish() + }; + } +}; function createBaseProposal(): Proposal { return { type: 0, diff --git a/src/codegen/tendermint/types/validator.ts b/src/codegen/tendermint/types/validator.ts index f926406..cd7c988 100644 --- a/src/codegen/tendermint/types/validator.ts +++ b/src/codegen/tendermint/types/validator.ts @@ -1,6 +1,54 @@ import { PublicKey, PublicKeyAmino, PublicKeySDKType } from "../crypto/keys"; import { BinaryReader, BinaryWriter } from "../../binary"; import { bytesFromBase64, base64FromBytes } from "../../helpers"; +/** BlockIdFlag indicates which BlockID the signature is for */ +export enum BlockIDFlag { + /** BLOCK_ID_FLAG_UNKNOWN - indicates an error condition */ + BLOCK_ID_FLAG_UNKNOWN = 0, + /** BLOCK_ID_FLAG_ABSENT - the vote was not received */ + BLOCK_ID_FLAG_ABSENT = 1, + BLOCK_ID_FLAG_COMMIT = 2, + /** BLOCK_ID_FLAG_NIL - voted for nil */ + BLOCK_ID_FLAG_NIL = 3, + UNRECOGNIZED = -1, +} +export const BlockIDFlagSDKType = BlockIDFlag; +export const BlockIDFlagAmino = BlockIDFlag; +export function blockIDFlagFromJSON(object: any): BlockIDFlag { + switch (object) { + case 0: + case "BLOCK_ID_FLAG_UNKNOWN": + return BlockIDFlag.BLOCK_ID_FLAG_UNKNOWN; + case 1: + case "BLOCK_ID_FLAG_ABSENT": + return BlockIDFlag.BLOCK_ID_FLAG_ABSENT; + case 2: + case "BLOCK_ID_FLAG_COMMIT": + return BlockIDFlag.BLOCK_ID_FLAG_COMMIT; + case 3: + case "BLOCK_ID_FLAG_NIL": + return BlockIDFlag.BLOCK_ID_FLAG_NIL; + case -1: + case "UNRECOGNIZED": + default: + return BlockIDFlag.UNRECOGNIZED; + } +} +export function blockIDFlagToJSON(object: BlockIDFlag): string { + switch (object) { + case BlockIDFlag.BLOCK_ID_FLAG_UNKNOWN: + return "BLOCK_ID_FLAG_UNKNOWN"; + case BlockIDFlag.BLOCK_ID_FLAG_ABSENT: + return "BLOCK_ID_FLAG_ABSENT"; + case BlockIDFlag.BLOCK_ID_FLAG_COMMIT: + return "BLOCK_ID_FLAG_COMMIT"; + case BlockIDFlag.BLOCK_ID_FLAG_NIL: + return "BLOCK_ID_FLAG_NIL"; + case BlockIDFlag.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} export interface ValidatorSet { validators: Validator[]; proposer?: Validator;